This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Reload tweek


Hi,
the comment in front of reload_cse_delete_insn appears to be out of date.  No
passes after reload can rely on the fact that spill register is dead at the BB
boundaries. The attached patch removes the hack of keeping use as it appears
to be no longer needed.  We always generate reg-reg move to return register
before the use of return register and nowhere else, so this should be safe.

I've bootstrapped/regtested the patch on i386.
Sun May 12 13:07:45 CEST 2002  Jan Hubicka  <jh@suse.cz>
	* reload1.c (reload_cse_delete_noop_set): Kill.
	(reload_cse_simplify): use delte_insn_and_edges.

*** reload1.c.rty	Sun May 12 12:36:36 2002
--- reload1.c	Sun May 12 12:38:07 2002
*************** static HOST_WIDE_INT sext_for_mode	PARAM
*** 458,464 ****
  						 HOST_WIDE_INT));
  static void failed_reload		PARAMS ((rtx, int));
  static int set_reload_reg		PARAMS ((int, int));
- static void reload_cse_delete_noop_set	PARAMS ((rtx, rtx));
  static void reload_cse_simplify		PARAMS ((rtx));
  void fixup_abnormal_edges		PARAMS ((void));
  extern void dump_needs			PARAMS ((struct insn_chain *));
--- 458,463 ----
*************** constraint_accepts_reg_p (string, reg)
*** 8026,8055 ****
        }
  }
  
- /* INSN is a no-op; delete it.
-    If this sets the return value of the function, we must keep a USE around,
-    in case this is in a different basic block than the final USE.  Otherwise,
-    we could loose important register lifeness information on
-    SMALL_REGISTER_CLASSES machines, where return registers might be used as
-    spills:  subsequent passes assume that spill registers are dead at the end
-    of a basic block.
-    VALUE must be the return value in such a case, NULL otherwise.  */
- static void
- reload_cse_delete_noop_set (insn, value)
-      rtx insn, value;
- {
-   bool purge = BLOCK_FOR_INSN (insn)->end == insn;
-   if (value)
-     {
-       PATTERN (insn) = gen_rtx_USE (VOIDmode, value);
-       INSN_CODE (insn) = -1;
-       REG_NOTES (insn) = NULL_RTX;
-     }
-   else
-     delete_insn (insn);
-   if (purge)
-     purge_dead_edges (BLOCK_FOR_INSN (insn));
- }
  
  /* See whether a single set SET is a noop.  */
  static int
--- 8025,8030 ----
*************** reload_cse_simplify (insn)
*** 8083,8089 ****
  	  if (GET_CODE (body) == REG
  	      && ! REG_FUNCTION_VALUE_P (SET_DEST (body)))
  	    value = 0;
! 	  reload_cse_delete_noop_set (insn, value);
  	  return;
  	}
  
--- 8058,8064 ----
  	  if (GET_CODE (body) == REG
  	      && ! REG_FUNCTION_VALUE_P (SET_DEST (body)))
  	    value = 0;
! 	  delete_insn_and_edges (insn);
  	  return;
  	}
  
*************** reload_cse_simplify (insn)
*** 8120,8126 ****
  
        if (i < 0)
  	{
! 	  reload_cse_delete_noop_set (insn, value);
  	  /* We're done with this insn.  */
  	  return;
  	}
--- 8095,8101 ----
  
        if (i < 0)
  	{
! 	  delete_insn_and_edges (insn);
  	  /* We're done with this insn.  */
  	  return;
  	}


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]