[14/32] Remove global call sets: DF (entry/exit defs)
diff mbox series

Message ID mpttv9iwswu.fsf@arm.com
State New
Headers show
Series
  • Support multiple ABIs in the same translation unit
Related show

Commit Message

Richard Sandiford Sept. 11, 2019, 7:10 p.m. UTC
The code patched here is seeing whether the current function
needs to save at least part of a register before using it.


2019-09-11  Richard Sandiford  <richard.sandiford@arm.com>

gcc/
	* df-scan.c (df_get_entry_block_def_set): Use crtl->abi to test
	whether the current function needs to save at least part of a
	register before using it.
	(df_get_exit_block_use_set): Likewise for epilogue restores.

Patch
diff mbox series

Index: gcc/df-scan.c
===================================================================
--- gcc/df-scan.c	2019-09-11 19:48:07.405959747 +0100
+++ gcc/df-scan.c	2019-09-11 19:48:11.009934354 +0100
@@ -3499,7 +3499,9 @@  df_get_entry_block_def_set (bitmap entry
       /* Defs for the callee saved registers are inserted so that the
 	 pushes have some defining location.  */
       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-	if ((call_used_or_fixed_reg_p (i) == 0) && (df_regs_ever_live_p (i)))
+	if (!crtl->abi->clobbers_full_reg_p (i)
+	    && !fixed_regs[i]
+	    && df_regs_ever_live_p (i))
 	  bitmap_set_bit (entry_block_defs, i);
     }
 
@@ -3672,8 +3674,9 @@  df_get_exit_block_use_set (bitmap exit_b
     {
       /* Mark all call-saved registers that we actually used.  */
       for (i = 0; i < FIRST_PSEUDO_REGISTER; i++)
-	if (df_regs_ever_live_p (i) && !LOCAL_REGNO (i)
-	    && !TEST_HARD_REG_BIT (regs_invalidated_by_call, i))
+	if (df_regs_ever_live_p (i)
+	    && !LOCAL_REGNO (i)
+	    && !crtl->abi->clobbers_full_reg_p (i))
 	  bitmap_set_bit (exit_block_uses, i);
     }