On Fri, Dec 05, 2014 at 03:36:01PM -0700, Jeff Law wrote:
> >So combine tries to combine 6+7+8; the RTL it comes up with is a parallel
> >of the memory decrement (without cc clobber, but that is fine), and setting
> >r88 to the mem minus one.  There is no such pattern in the target, and
> >combine cannot break the parallel into two sets (because the first modifies
> >the mem used by the second), so 6+7+8 doesn't combine.
> >
> >Adding a bridge pattern in the target would work; or you can enhance 
> >combine
> >so it can break up this parallel correctly.
> I think myself or someone suggested a bridge pattern in the past, but I 
> can't find it, perhaps it was one of the other threads WRT limitations 
> of the combiner.
> 
> 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 the bridge pattern I added is

M = M + B  ::  T = M + B

(I made it to split to  M = M + B ; T = M  which is probably not optimal,
but irrelevant for the rest here).

So combine happily combines 6+7+8 to the bridge pattern.  But then it
forgets to make a link from 9.  I suppose it just doesn't know how to
make a link to a parallel (it wouldn't ever be useful before my recent
patches).

Investigating...


Segher

Reply via email to