Skip to content

Commit

Permalink
[ValueTracking] Combine variable declaration with its only assignment…
Browse files Browse the repository at this point in the history
…. NFC (llvm#89526)
  • Loading branch information
topperc authored Apr 21, 2024
1 parent d674f45 commit 48324f0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/Analysis/ValueTracking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2682,7 +2682,6 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
if (cast<PossiblyExactOperator>(I)->isExact())
return isKnownNonZero(I->getOperand(0), DemandedElts, Q, Depth);

std::optional<bool> XUgeY;
KnownBits XKnown =
computeKnownBits(I->getOperand(0), DemandedElts, Depth, Q);
// If X is fully unknown we won't be able to figure anything out so don't
Expand All @@ -2698,7 +2697,7 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
YKnown = YKnown.abs(/*IntMinIsPoison*/ false);
}
// If X u>= Y then div is non zero (0/0 is UB).
XUgeY = KnownBits::uge(XKnown, YKnown);
std::optional<bool> XUgeY = KnownBits::uge(XKnown, YKnown);
// If X is total unknown or X u< Y we won't be able to prove non-zero
// with compute known bits so just return early.
return XUgeY && *XUgeY;
Expand Down

0 comments on commit 48324f0

Please sign in to comment.