Skip to content

Commit 50ab52b

Browse files
artagnongithub-actions[bot]
authored andcommitted
Automerge: [ValueTracking] Improve code using dropSameSign (NFC) (#147367)
2 parents 616da88 + 1693ac3 commit 50ab52b

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)