This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Improve ifcombine (PR 52005)
- From: Richard Guenther <richard dot guenther at gmail dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: Andrew Pinski <pinskia at gmail dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Mon, 6 Aug 2012 10:23:37 +0200
- Subject: Re: [PATCH] Improve ifcombine (PR 52005)
- References: <CA+=Sn1m-fUff_=9T4T9iMkJ_CL-aWZnjXLgVo5F8Cagb_z6mRA@mail.gmail.com> <alpine.DEB.2.02.1207241019280.5117@laptop-mg.saclay.inria.fr> <CAFiYyc3dcH9bNdpRqjOjNX+ic1GRtqzHSDzmxELdVGFJAsGGkg@mail.gmail.com> <CA+=Sn1=APAmtqqRUP8WaKuMqPuo8rtHEEedvEsFt8r6kZARP3w@mail.gmail.com> <alpine.DEB.2.02.1207241852500.3241@laptop-mg.saclay.inria.fr> <alpine.DEB.2.02.1207261748040.17097@stedding.saclay.inria.fr> <alpine.DEB.2.02.1208060821100.3253@laptop-mg.saclay.inria.fr>
On Mon, Aug 6, 2012 at 8:27 AM, Marc Glisse <marc.glisse@inria.fr> wrote:
>
> Hello,
>
> do you have an opinion on this patch (available here:
> http://gcc.gnu.org/ml/gcc-patches/2012-07/msg01352.html
> ) ?
I like it. Thus, the referenced patch is ok for trunk.
Thanks,
Richard.
> Or should we go back to my old patch, or Andrew's patch?
>
>
> On Thu, 26 Jul 2012, Marc Glisse wrote:
>
>> Hello,
>>
>> here is a new version of the ifcombine patch, which handles Andrew's
>> examples (though only with -O2 for one of them, same_phi_args_p returns
>> false otherwise).
>>
>> Note that the new patch never calls maybe_fold_or_comparisons, only
>> maybe_fold_and_comparisons. It would be possible to call
>> maybe_fold_or_comparisons, when maybe_fold_and_comparisons fails, but I
>> don't know if there are optimizations that one does and not the other,
>> except for the odd trapping-math case.
>>
>> Bootstrap and testsuite are fine.
>>
>> 2012-07-26 Marc Glisse <marc.glisse@inria.fr>
>>
>> gcc/
>> PR tree-optimization/51938
>> PR tree-optimization/52005
>> * tree-ssa-ifcombine.c (ifcombine_ifandif): New parameters for
>> inverted conditions.
>> (ifcombine_iforif): Remove, merge code into ifcombine_ifandif.
>> (tree_ssa_ifcombine_bb): Update calls to the above. Detect !a&&b
>> and !a||b patterns.
>>
>>
>> gcc/testsuite/
>> PR tree-optimization/51938
>> PR tree-optimization/52005
>> * gcc.dg/tree-ssa/ssa-ifcombine-8.c: New testcase.
>> * gcc.dg/tree-ssa/ssa-ifcombine-9.c: Likewise.
>> * gcc.dg/tree-ssa/ssa-ifcombine-10.c: Likewise.
>> * gcc.dg/tree-ssa/ssa-ifcombine-11.c: Likewise.
>
>
> --
> Marc Glisse