This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH][combine][1/2] Try to simplify before substituting
- From: "Pinski, Andrew" <Andrew dot Pinski at caviumnetworks dot com>
- To: Kyrill Tkachov <kyrylo dot tkachov at arm dot com>
- Cc: Segher Boessenkool <segher at kernel dot crashing dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, Andrew Pinski <apinski at cavium dot com>
- Date: Fri, 17 Jul 2015 11:52:43 +0000
- Subject: Re: [PATCH][combine][1/2] Try to simplify before substituting
- Authentication-results: sourceware.org; auth=none
- Authentication-results: arm.com; dkim=none (message not signed) header.d=none;
- References: <55A7CCDA dot 8050203 at arm dot com> <20150716181306 dot GA8497 at gate dot crashing dot org> <55A7F552 dot 9030003 at arm dot com> <20150716182801 dot GB8497 at gate dot crashing dot org>,<55A8E8B2 dot 9070002 at arm dot com>
> On Jul 17, 2015, at 7:36 PM, Kyrill Tkachov <kyrylo.tkachov@arm.com> wrote:
>
>
>> On 16/07/15 19:28, Segher Boessenkool wrote:
>> On Thu, Jul 16, 2015 at 07:17:54PM +0100, Kyrill Tkachov wrote:
>>>> If you always want to simplify first, does it work to move this whole big
>>>> block behind the simplify just following it? Or do you want to simplify
>>>> after the transform as well?
>>> You mean move this hunk outside the "if (BINARY_P (x)...)" block it's in?
>>> I think it would work, but I'm not sure if it would affect other cases.
>>> I was also conscious that simplify_rtx might not be a cheap function to call
>>> so frequently (or is it? I didn't profile it), so I tried to avoid calling
>>> it unless I need for the transformation in question here.
>> I mean move the whole "if (BINARY_P ..." block to after the existing
>> simplify calls, to just before the "First see if we can apply" comment,
>> and not do a new simplify_rtx call at all. Does that work?
>
> Yes, and here's the patch.
> It just moves the simplification block.
> The effect on codegen in SPEC2006 on aarch64 looks sane in the same
> way as the original patch I posted (i.e. many redundant zero_extends eliminated)
> and together with patch 2/2 this helps in the -abs testcase.
>
> I'm bootstrapping this on aarch64, arm and x86.
> Any other testing would be appreciated.
>
> Is this version ok if testing comes clean?
This combined with the other patch looks much better than the original target specific hack. And it goes to show that doing it in a non-target specific way can improve other cases you did not see before.
Thanks,
Andrew
>
> Thanks,
> Kyrill
>
> 2015-07-17 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
>
> * combine.c (combine_simplify_rtx): Move simplification step
> before various transformations/substitutions.
>
>
> <combine-2.patch>