If Mask[0] is 0, then we're never going to match a slidedown. If
we get through the for loop, then it's an identity mask which should
have already been optimized out. Otherwise it's some non-contiguous
mask that will fail out of the lop. Might as well not bother entering
the loop.
VT.getVectorNumElements() != V2.getConstantOperandVal(1))
return SDValue();
- // Do not handle -1 here. -1 can be handled by isElementRotate.
- if (Mask[0] == -1)
+ // First index must be known and non-zero. It will be used as the slidedown
+ // amount.
+ if (Mask[0] <= 0)
return SDValue();
// Mask is also continuous.