Patchwork [03/10] -fuse-caller-save - Add implicit parameter to find_all_hard_reg_sets

login
register
mail settings
Submitter Tom de Vries
Date March 30, 2013, 5:11 p.m.
Message ID <20130330171105.6DCFB421213@build1-lucid-cs>
Download mbox | patch
Permalink /patch/232535/
State New
Headers show

Comments

Tom de Vries - March 30, 2013, 5:11 p.m.
Vladimir,

This patch adds an implicit parameter to find_all_hard_reg_sets.

Thanks,
  -Tom

2013-03-30  Radovan Obradovic  <robradovic@mips.com>
            Tom de Vries  <tom@codesourcery.com>

	* rtlanal.c (find_all_hard_reg_sets): Add bool implicit parameter and
	handle.
	* rtl.h (find_all_hard_reg_sets): Add bool parameter.
	* haifa-sched.c (recompute_todo_spec, check_clobbered_conditions): Add
	new argument to find_all_hard_reg_sets call.

Patch

diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c
index c4591bfe..fe24d43 100644
--- a/gcc/haifa-sched.c
+++ b/gcc/haifa-sched.c
@@ -1271,7 +1271,7 @@  recompute_todo_spec (rtx next, bool for_backtrack)
 	  {
 	    HARD_REG_SET t;
 
-	    find_all_hard_reg_sets (prev, &t);
+	    find_all_hard_reg_sets (prev, &t, true);
 	    if (TEST_HARD_REG_BIT (t, regno))
 	      return HARD_DEP;
 	    if (prev == pro)
@@ -3041,7 +3041,7 @@  check_clobbered_conditions (rtx insn)
   if ((current_sched_info->flags & DO_PREDICATION) == 0)
     return;
 
-  find_all_hard_reg_sets (insn, &t);
+  find_all_hard_reg_sets (insn, &t, true);
 
  restart:
   for (i = 0; i < ready.n_ready; i++)
diff --git a/gcc/rtl.h b/gcc/rtl.h
index b9defcc..6486f20 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2038,7 +2038,7 @@  extern const_rtx set_of (const_rtx, const_rtx);
 extern void record_hard_reg_sets (rtx, const_rtx, void *);
 extern void record_hard_reg_uses (rtx *, void *);
 #ifdef HARD_CONST
-extern void find_all_hard_reg_sets (const_rtx, HARD_REG_SET *);
+extern void find_all_hard_reg_sets (const_rtx, HARD_REG_SET *, bool);
 #endif
 extern void note_stores (const_rtx, void (*) (rtx, const_rtx, void *), void *);
 extern void note_uses (rtx *, void (*) (rtx *, void *), void *);
diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c
index b198685..27c1974 100644
--- a/gcc/rtlanal.c
+++ b/gcc/rtlanal.c
@@ -1028,13 +1028,13 @@  record_hard_reg_sets (rtx x, const_rtx pat ATTRIBUTE_UNUSED, void *data)
 /* Examine INSN, and compute the set of hard registers written by it.
    Store it in *PSET.  Should only be called after reload.  */
 void
-find_all_hard_reg_sets (const_rtx insn, HARD_REG_SET *pset)
+find_all_hard_reg_sets (const_rtx insn, HARD_REG_SET *pset, bool implicit)
 {
   rtx link;
 
   CLEAR_HARD_REG_SET (*pset);
   note_stores (PATTERN (insn), record_hard_reg_sets, pset);
-  if (CALL_P (insn))
+  if (implicit && CALL_P (insn))
     IOR_HARD_REG_SET (*pset, call_used_reg_set);
   for (link = REG_NOTES (insn); link; link = XEXP (link, 1))
     if (REG_NOTE_KIND (link) == REG_INC)