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) {
16391639 }
16401640
16411641 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);
16441648
16451649 // Try to merge shuffles across the binop if the new shuffles are not costly.
16461650 InstructionCost OldCost =
You can’t perform that action at this time.
0 commit comments