This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR 61225
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Jeff Law <law at redhat dot com>
- Cc: Zhenqiang Chen <zhenqiang dot chen at arm dot com>, Steven Bosscher <stevenb dot gcc at gmail dot com>, gcc-patches at gcc dot gnu dot org, Jakub Jelinek <jakub at redhat dot com>
- Date: Sat, 6 Dec 2014 23:02:33 -0600
- Subject: Re: [PATCH] Fix PR 61225
- Authentication-results: sourceware.org; auth=none
- References: <CABu31nP5TqCU3iB-3jBTU93bORrCAmohq5nzcVBdjx2cqabrzA at mail dot gmail dot com> <CACgzC7D40=bxqag59GYQuXtze_ZAquo3PhpLmh0EGxZte5Mw4A at mail dot gmail dot com> <53C73EBD dot 9070909 at redhat dot com> <CACgzC7CJnoaOsFMDjXDZ0CLiECWPbejxDHg2GOk_AUtjrzC80w at mail dot gmail dot com> <547CE75B dot 6090709 at redhat dot com> <000001d00f9e$64f43600$2edca200$ at arm dot com> <20141204204956 dot GA11759 at gate dot crashing dot org> <20141204205756 dot GB11759 at gate dot crashing dot org> <54823351 dot 8060702 at redhat dot com> <20141206000911 dot GA12559 at gate dot crashing dot org>
On Fri, Dec 05, 2014 at 06:09:11PM -0600, Segher Boessenkool wrote:
> On Fri, Dec 05, 2014 at 03:36:01PM -0700, Jeff Law wrote:
> > Zhenqiang, can you look at what happens if you provide a pattern for
> > 6+7+8 (probably via a define_and_split)?
>
> I tried this out yesterday. There are a few options (a bridge pattern
> for 6+7+8, or one for 7+8). I went with 6+7+8.
>
> So the code combine is asked to optimise is
>
> 6 A = M
> 7 T = A + B
> 8 M = T
> 9 C = cmp T, 0
... and combine will never combine a write to memory (8 here) into a
later insn (see can_combine_p). So this won't ever fly.
I see no reasonably simple way combine can be convinced to do this.
There are various possible schemes to pull insn 9 to before 8, but when
does this help and when does it hurt? It all depends on the target :-(
Segher