On Fri, Nov 14, 2014 at 08:35:48PM +0100, Bernd Schmidt wrote:
> On 11/14/2014 08:19 PM, Segher Boessenkool wrote:
> >+  /* If I2 is a PARALLEL of two SETs of REGs (and perhaps some CLOBBERs),
> >+     make those two SETs separate I1 and I2 insns, and make an I0 that is
> >+     the original I1.  */
> >+  if (i0 == 0
> >+      && GET_CODE (PATTERN (i2)) == PARALLEL
> >+      && XVECLEN (PATTERN (i2), 0) >= 2
> >+      && GET_CODE (XVECEXP (PATTERN (i2), 0, 0)) == SET
> >+      && GET_CODE (XVECEXP (PATTERN (i2), 0, 1)) == SET
> >+      && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)))
> >+      && REG_P (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)))
> >+      && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 0)), 
> >i2, i3)
> >+      && !reg_used_between_p (SET_DEST (XVECEXP (PATTERN (i2), 0, 1)), 
> >i2, i3)
> 
> Don't we have other code in combine checking the reg_used_between case?

It doesn't make any sense at all.  What I wanted to check is whether
splitting the parallel creates a conflict, but I woefully failed at that.
Will fix.

> >+      && (XVECLEN (PATTERN (i2), 0) == 2
> >+      || GET_CODE (XVECEXP (PATTERN (i2), 0, 2)) == CLOBBER))
> 
> This probably wants to test for XVECLEN == 3 for the second case. Can 
> then drop the earlier test.

It needs to test there are exactly two SETs, any amount of clobbers, and
nothing else.

> I think you also need to check that !reg_overlap_mentioned_p between the 
> two dests and the other set's sources.

Only the dest of the new I1 with the sources of the new I2, but yes.


Segher

Reply via email to