This is the mail archive of the
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: <email@example.com>
- Reply-to: law at redhat dot com
On Thu, 2005-01-27 at 07:40 -0500, Kazu Hirata wrote:
> Attached is a patch to speed up find_bast_addr, a revised version of
> the patch posted at
> Some numbers about the above patch is posted at:
> 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 <firstname.lastname@example.org>
> Kazu Hirata <email@example.com>
> * 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
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.