This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: PATCH: Always avoid lea if possible on x86
- From: Richard Henderson <rth at redhat dot com>
- To: "H.J. Lu" <hjl dot tools at gmail dot com>
- Cc: "H.J. Lu" <hongjiu dot lu at intel dot com>, gcc-patches at gcc dot gnu dot org, Uros Bizjak <ubizjak at gmail dot com>, Bernd Schmidt <bernds at codesourcery dot com>
- Date: Tue, 17 Aug 2010 08:18:25 -0700
- Subject: Re: PATCH: Always avoid lea if possible on x86
- References: <20100817144925.GA26996@intel.com>
On 08/17/2010 07:49 AM, H.J. Lu wrote:
> default:
> - /* Use add as much as possible to replace lea for AGU optimization. */
> - if (which_alternative == 2 && TARGET_OPT_AGU)
> + /* This alternative was added for TARGET_OPT_AGU to use add as
> + much as possible. But add is also faster than lea for
> + !TARGET_OPT_AGU. */
> + if (which_alternative == 2)
> return "add{<imodesuffix>}\t{%1, %0|%0, %1}";
>
> gcc_assert (rtx_equal_p (operands[0], operands[1]));
> @@ -5825,10 +5827,7 @@
> }
> }
> [(set (attr "type")
> - (cond [(and (eq_attr "alternative" "2")
> - (eq (symbol_ref "TARGET_OPT_AGU") (const_int 0)))
> - (const_string "lea")
> - (eq_attr "alternative" "3")
> + (cond [(eq_attr "alternative" "3")
> (const_string "lea")
> (match_operand:SWI48 2 "incdec_operand" "")
> (const_string "incdec")
Is there any reason not to remove alternative 2 now that
you're not doing anything special with it?
r~