Skip to content

Commit 1693ac3

Browse files
authored
[ValueTracking] Improve code using dropSameSign (NFC) (#147367)
1 parent 31786ee commit 1693ac3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

llvm/lib/Analysis/ValueTracking.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9287,9 +9287,9 @@ isImpliedCondCommonOperandWithCR(CmpPredicate LPred, const ConstantRange &LCR,
92879287
return Res;
92889288
if (LPred.hasSameSign() ^ RPred.hasSameSign()) {
92899289
LPred = LPred.hasSameSign() ? ICmpInst::getFlippedSignednessPredicate(LPred)
9290-
: static_cast<CmpInst::Predicate>(LPred);
9290+
: LPred.dropSameSign();
92919291
RPred = RPred.hasSameSign() ? ICmpInst::getFlippedSignednessPredicate(RPred)
9292-
: static_cast<CmpInst::Predicate>(RPred);
9292+
: RPred.dropSameSign();
92939293
return CRImpliesPred(ConstantRange::makeAllowedICmpRegion(LPred, LCR),
92949294
RPred);
92959295
}

0 commit comments

Comments
 (0)