File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1639,8 +1639,12 @@ bool VectorCombine::foldPermuteOfBinops(Instruction &I) {
1639
1639
}
1640
1640
1641
1641
unsigned NumOpElts = Op0Ty->getNumElements ();
1642
- bool IsIdentity0 = ShuffleVectorInst::isIdentityMask (NewMask0, NumOpElts);
1643
- bool IsIdentity1 = ShuffleVectorInst::isIdentityMask (NewMask1, NumOpElts);
1642
+ bool IsIdentity0 =
1643
+ all_of (NewMask0, [NumOpElts](int M) { return M < (int )NumOpElts; }) &&
1644
+ ShuffleVectorInst::isIdentityMask (NewMask0, NumOpElts);
1645
+ bool IsIdentity1 =
1646
+ all_of (NewMask1, [NumOpElts](int M) { return M < (int )NumOpElts; }) &&
1647
+ ShuffleVectorInst::isIdentityMask (NewMask1, NumOpElts);
1644
1648
1645
1649
// Try to merge shuffles across the binop if the new shuffles are not costly.
1646
1650
InstructionCost OldCost =
You can’t perform that action at this time.
0 commit comments