This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] cse.c: Speed up find_best_addr.
- From: Jeffrey A Law <law at redhat dot com>
- To: Kazu Hirata <kazu at cs dot umass dot edu>
- Cc: gcc-patches at gcc dot gnu dot org, arend dot bayer at web dot de
- Date: Thu, 27 Jan 2005 15:41:56 -0700
- Subject: Re: [patch] cse.c: Speed up find_best_addr.
- Organization: Red Hat, Inc
- References: <20050127.074033.63131279.kazu@cs.umass.edu>
- Reply-to: law at redhat dot com
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