This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch ARM] Fix address cost.
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: ramana dot radhakrishnan at arm dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 30 Jul 2009 17:16:32 +0100
- Subject: Re: [Patch ARM] Fix address cost.
- References: <1248970533.19393.142.camel@e200593-lin.cambridge.arm.com>
On Thu, 2009-07-30 at 17:15 +0100, Ramana Radhakrishnan wrote:
> Hi,
>
> This patch is effectively a 1-bit fix that fixes what was a typo in the
> way address costs were being calculated for PLUS expressions in
> addresses. I've also taken the opportunity to remove the check for MINUS
> because no addresses will be generated with a MINUS expression as that
> is disabled in legitimate_address.
>
> This produced a 1% improvement in performance at -O3 with Coremark on
> Cortex A8. Ok to commit on trunk after testing finishes.?
>
> cheers
> Ramana
>
> 2009-07-30 Ramana Radhakrishnan <ramana.radhakrishnan@arm.com>
>
> * config/arm/arm.c (arm_arm_address_cost): Fix typo.
> Remove dead code for MINUS.
>
>
>
> Index: gcc/config/arm/arm.c
> ===================================================================
> --- gcc/config/arm/arm.c (revision 150250)
> +++ gcc/config/arm/arm.c (working copy)
> @@ -6329,9 +6329,9 @@ arm_arm_address_cost (rtx x)
> if (c == MEM || c == LABEL_REF || c == SYMBOL_REF)
> return 10;
>
> - if (c == PLUS || c == MINUS)
> + if (c == PLUS)
> {
> - if (GET_CODE (XEXP (x, 0)) == CONST_INT)
> + if (GET_CODE (XEXP (x, 1)) == CONST_INT)
> return 2;
>
> if (ARITHMETIC_P (XEXP (x, 0)) || ARITHMETIC_P (XEXP (x, 1)))
>
>
OK.
R.