Skip to content

Commit 68cb10e

Browse files
committed
Address feedback
1 parent 6233654 commit 68cb10e

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -363,11 +363,10 @@ static void computeKnownBitsAddSub(bool Add, const Value *Op0, const Value *Op1,
363363
computeKnownBits(Op0, DemandedElts, Known2, Q, Depth + 1);
364364
KnownOut = KnownBits::computeForAddSub(Add, NSW, NUW, Known2, KnownOut);
365365

366-
if (!Add && NSW)
367-
if (std::optional<bool> result =
368-
isImpliedByDomCondition(ICmpInst::ICMP_SLE, Op1, Op0, Q.CxtI, Q.DL);
369-
*result)
370-
KnownOut.makeNonNegative();
366+
if (!Add && NSW &&
367+
isImpliedByDomCondition(ICmpInst::ICMP_SLE, Op1, Op0, Q.CxtI, Q.DL)
368+
.value_or(false))
369+
KnownOut.makeNonNegative();
371370
}
372371

373372
static void computeKnownBitsMul(const Value *Op0, const Value *Op1, bool NSW,

0 commit comments

Comments
 (0)