aboutsummaryrefslogtreecommitdiff
path: root/gcc/df-scan.c
diff options
context:
space:
mode:
authorSegher Boessenkool <segher@kernel.crashing.org>2016-11-16 16:23:36 +0100
committerSegher Boessenkool <segher@gcc.gnu.org>2016-11-16 16:23:36 +0100
commit7157aa8583f7ca32d5bee783e83103da92e3a1f3 (patch)
tree21e2efc1ded38ef3fcce361644e9b761e392f183 /gcc/df-scan.c
parent307ca54339bfce88e67f7e446ee4bbf5f1961eba (diff)
downloadgcc-7157aa8583f7ca32d5bee783e83103da92e3a1f3.zip
gcc-7157aa8583f7ca32d5bee783e83103da92e3a1f3.tar.gz
gcc-7157aa8583f7ca32d5bee783e83103da92e3a1f3.tar.bz2
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. From-SVN: r242497
Diffstat (limited to 'gcc/df-scan.c')
-rw-r--r--gcc/df-scan.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/df-scan.c b/gcc/df-scan.c
index 7cfd34b..e6b55b5 100644
--- a/gcc/df-scan.c
+++ b/gcc/df-scan.c
@@ -3506,6 +3506,14 @@ df_get_entry_block_def_set (bitmap entry_block_defs)
bitmap_clear (entry_block_defs);
+ /* For separate shrink-wrapping we use LIVE to analyze which basic blocks
+ need a prologue for some component to be executed before that block,
+ and we do not care about any other registers. Hence, we do not want
+ any register for any component defined in the entry block, and we can
+ just leave all registers undefined. */
+ if (df_scan->local_flags & DF_SCAN_EMPTY_ENTRY_EXIT)
+ return;
+
for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
{
if (global_regs[i])
@@ -3665,6 +3673,14 @@ df_get_exit_block_use_set (bitmap exit_block_uses)
bitmap_clear (exit_block_uses);
+ /* For separate shrink-wrapping we use LIVE to analyze which basic blocks
+ need an epilogue for some component to be executed after that block,
+ and we do not care about any other registers. Hence, we do not want
+ any register for any component seen as used in the exit block, and we
+ can just say no registers at all are used. */
+ if (df_scan->local_flags & DF_SCAN_EMPTY_ENTRY_EXIT)
+ return;
+
/* Stack pointer is always live at the exit. */
bitmap_set_bit (exit_block_uses, STACK_POINTER_REGNUM);