Skip to content

Commit 7072760

Browse files
committed
Update InstCombineMulDivRem.cpp
1 parent 028a2b4 commit 7072760

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
280280
/*isExact=*/true);
281281

282282
auto *NewAdd = BinaryOperator::CreateAdd(NewOp, BinOp);
283-
if (HasNSW && (OpBO->getOpcode() == Instruction::LShr ||
283+
if (HasNSW && (HasNUW || OpBO->getOpcode() == Instruction::LShr ||
284284
ShiftC->getZExtValue() < BitWidth - 1))
285285
NewAdd->setHasNoSignedWrap(true);
286286

0 commit comments

Comments
 (0)