We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2f758b7 commit 5fb7819Copy full SHA for 5fb7819
llvm/lib/Transforms/Vectorize/VectorCombine.cpp
@@ -1436,9 +1436,9 @@ bool VectorCombine::foldPermuteOfBinops(Instruction &I) {
1436
1437
unsigned NumSrcElts = BinOpTy->getNumElements();
1438
1439
- // Don't accept shuffles that reference the second (undef/poison) operand in
1440
- // div/rem..
1441
- if (BinOp->isIntDivRem() &&
+ // Don't accept shuffles that reference the second operand in
+ // div/rem or if its an undef arg.
+ if ((BinOp->isIntDivRem() || !isa<PoisonValue>(I.getOperand(1))) &&
1442
any_of(OuterMask, [NumSrcElts](int M) { return M >= (int)NumSrcElts; }))
1443
return false;
1444
0 commit comments