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: Always avoid lea if possible on x86


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~


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