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]

Re: [PATCH] GCSE the content of REG_EQUAL/REG_EQUIV notes as well


Paolo Bonzini <paolo.bonzini@lu.unisi.ch> writes:

> 2005-11-23  Paolo Bonzini  <bonzini@gnu.org>
> 
> 	* gcse.c (hash_scan_set): Look through REG_EQUAL or REG_EQUIV notes
> 	also when doing PRE, rather than only for global CPROP.

This is OK if you fix the comment.

>        /* If this is a single set and we are doing constant propagation,
>  	 see if a REG_NOTE shows this equivalent to a constant.  */
> -      if (table->set_p && (note = find_reg_equal_equiv_note (insn)) != 0
> -	  && gcse_constant_p (XEXP (note, 0)))
> +      note = find_reg_equal_equiv_note (insn);
> +      if (note != 0
> +	  && (table->set_p
> +	      ? gcse_constant_p (XEXP (note, 0))
> +	      : want_to_gcse_p (XEXP (note, 0))))
>  	src = XEXP (note, 0), pat = gen_rtx_SET (VOIDmode, dest, src);

The comment says we are only going to look at a note when doing
constant propagation, and your patch changes that.

Thanks.

Ian


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