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] cse.c: Speed up find_best_addr.


On Thu, 2005-01-27 at 07:40 -0500, Kazu Hirata wrote:
> Hi,
> 
> Attached is a patch to speed up find_bast_addr, a revised version of
> the patch posted at
> 
>   http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01818.html
> 
> Some numbers about the above patch is posted at:
> 
>   http://gcc.gnu.org/ml/gcc-patches/2005-01/msg01851.html
> 
> Jeff raised a concern that it may not be safe to omit a call to
> copy_rtx before calling fold_rtx.  In particular, he was afraid that
> we might change the original rtx X when it is ASM_OPERAND.
> 
> To address his concern, I put an "if" statement around the case that
> handles ASM_OPERAND.  This is superflous because validate_change and
> its children do basically nothing if its first argument is NULL_RTX.
> Technically, it sets BB_DIRTY flags, but that does not mean that the
> instruction stream is modified.
> 
> Tested on i686-pc-linux-gnu.  OK to apply?
> 
> Kazu Hirata
> 
> 2005-01-26  Arend Bayer  <arend.bayer@web.de>
> 	    Kazu Hirata  <kazu@cs.umass.edu>
> 
> 	* cse.c: (find_best_addr): Don't call copy_rtx before calling
> 	fold_rtx.  Save cost recomputation if fold_rtx did nothing.
> 	(fold_rtx) <ASM_OPERANDS>: Don't do anything if INSN is
> 	NULL_RTX.
This is fine.  I like the conditional as it avoids cse knowing too
many implementation details of validate_change.  Another approach
would be to assert that insn is non-null for ASM_OPERANDS.  Either
way is fine with me.

jeff



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