PR57073 - Optimize __builtin_powif (-1.0, k) to k & 1 ? -1.0 : 1.0

Richard Biener richard.guenther@gmail.com
Fri May 31 08:58:00 GMT 2013


On Fri, May 31, 2013 at 10:57 AM, Tobias Burnus <burnus@net-b.de> wrote:
> Richard Biener wrote:
>>
>> Why sink the !host_integerp check?  Please keep it where it is now.
>> Then
>>
>> +                 if (real_minus_onep (arg0)
>> +                     && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
>>
>> this check is redundant, too.
>
>
> Good point - I will commit the patch below after another bootstrap and
> regtesting.
>
> Tobias
>
> --- a/gcc/tree-ssa-math-opts.c
> +++ b/gcc/tree-ssa-math-opts.c
> @@ -1448,7 +1448,9 @@ execute_cse_sincos (void)
>                   loc = gimple_location (stmt);
>
>
> -                 if (real_minus_onep (arg0)
> -                     && TREE_CODE (TREE_TYPE (arg1)) == INTEGER_TYPE
> -                     && !host_integerp (arg1,0))
>
> +                 if (!host_integerp (arg1, 0))
> +                   break;
> +
> +

Very too much vertical space here and above.

> +                 if (real_minus_onep (arg0))
>                     {
>                        tree t0, t1, cond, one, minus_one;
> @@ -1477,7 +1479,4 @@ execute_cse_sincos (void)
>                   else
>                     {
> -                     if (!host_integerp (arg1, 0))
> -                       break;
> -
>                       n = TREE_INT_CST_LOW (arg1);
>
>                       result = gimple_expand_builtin_powi (&gsi, loc, arg0,
> n);



More information about the Gcc-patches mailing list