Skip to content

Commit eb8c2e1

Browse files
committed
Update comment
1 parent 493071c commit eb8c2e1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

llvm/lib/Transforms/InstCombine/InstructionCombining.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2257,9 +2257,8 @@ Instruction *InstCombinerImpl::foldVectorBinop(BinaryOperator &Inst) {
22572257
}
22582258
if (MayChange) {
22592259
Constant *NewC = ConstantVector::get(NewVecC);
2260-
// It may not be safe to execute a binop on a vector with poison elements
2261-
// because the entire instruction can be folded to undef or create poison
2262-
// that did not exist in the original code.
2260+
// Lanes of NewC not used by the shuffle will be poison which will cause
2261+
// UB for div/rem. Mask them with a safe constant.
22632262
if (Inst.isIntDivRem())
22642263
NewC = getSafeVectorConstantForBinop(Opcode, NewC, ConstOp1);
22652264

0 commit comments

Comments
 (0)