This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: a patch for PR68695
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Kyrill Tkachov <kyrylo dot tkachov at foss dot arm dot com>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Vladimir Makarov <vmakarov at redhat dot com>, Christophe Lyon <christophe dot lyon at linaro dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Tue, 5 Apr 2016 17:35:11 -0500
- Subject: Re: a patch for PR68695
- Authentication-results: sourceware.org; auth=none
- References: <56FAAD47 dot 8090300 at redhat dot com> <CAKdteOahR87wrjssCmrTuUZD+776xUWN207xRj2VOmDER04xAA at mail dot gmail dot com> <56FED981 dot 1020609 at redhat dot com> <20160401204332 dot GH3017 at tucnak dot redhat dot com> <57038A0A dot 4030008 at foss dot arm dot com>
On Tue, Apr 05, 2016 at 10:48:58AM +0100, Kyrill Tkachov wrote:
> So for the test gcc.dg/pr10474.c on arm with -marm -O3 before this patch we
> perform shrink-wrapping:
> cmp r0, #0
> bxeq lr
> push {r4, lr}
> mov r4, r0
> ...
>
> And after the patch we don't:
> push {r4, lr}
> subs r4, r0, #0
> popeq {r4, pc}
> ...
>
> The assembly after the "..." is identical.
>
> So the resulting code is indeed shorter, though there is an
> extra stack push and pop on the early return path.
> A similar effect appears on gcc.dg/ira-shrinkwrap-prep-2.c.
The "new" code is better if there is no shrink-wrapping. We can probably
teach prepare_shrink_wrap to do the extra register move if that will allow
us to wrap more.
> Though if so, it looks like a shrink-wrapping deficiency exposed by
> this patch, rather than caused by it.
Yes, and mostly a testcase problem even.
> Jakub, do you happen to have the before and after codegen for these tests
> on ppc64? I wonder if the effect is more clearcut there.
RTL before shrink-wrapping would be useful, too.
Segher