df: Change defs in entry and uses in exit block during separate shrink-wrapping
commitb06532c273711ae47d148104c6f137d1afb5043c
authorsegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Nov 2016 15:23:36 +0000 (16 15:23 +0000)
committersegher <segher@138bc75d-0d04-0410-961f-82ee72b054a4>
Wed, 16 Nov 2016 15:23:36 +0000 (16 15:23 +0000)
tree21e2efc1ded38ef3fcce361644e9b761e392f183
parentaa273769182f68349e907df9dfa0fcee0642796d
df: Change defs in entry and uses in exit block during separate shrink-wrapping

So far all target implementations of the separate shrink-wrapping hooks
use the DF LIVE info to figure out around which basic blocks the non-
volatile registers need to be saved.  This is done by looking at the
IN+GEN+KILL sets of the basic blocks.  However, that doesn't work for
registers that DF says are defined in the entry block, or used in the
exit block.

This patch introduces a local flag DF_SCAN_EMPTY_ENTRY_EXIT that says
no registers should be defined in the entry block, and none used in the
exit block.  It also makes try_shrink_wrapping_separate use it.  The
rs6000 port is changed to use IN+GEN+KILL for the LR component.

* config/rs6000/rs6000.c (rs6000_components_for_bb): Mark the LR
component as used also if LR_REGNO is a live input to the bb.
* df-scan.c (df_get_entry_block_def_set): Return immediately after
clearing the set if DF_SCAN_EMPTY_ENTRY_EXIT is set.
(df_get_exit_block_use_set): Ditto.
* df.h (df_scan_flags): New enum.
* shrink-wrap.c (try_shrink_wrapping_separate): Set
DF_SCAN_EMPTY_ENTRY_EXIT in df_scan->local_flags, and call
df_update_entry_block_defs and df_update_exit_block_uses
at the start; clear the flag and call those functions at the end.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@242497 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/rs6000/rs6000.c
gcc/df-scan.c
gcc/df.h
gcc/shrink-wrap.c