-
Notifications
You must be signed in to change notification settings - Fork 15.2k
[ValueTracking] Improve code using dropSameSign (NFC) #147367
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
@llvm/pr-subscribers-llvm-analysis Author: Ramkumar Ramachandra (artagnon) ChangesFull diff: https://github.com/llvm/llvm-project/pull/147367.diff 1 Files Affected:
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 09745ed6eac6a..b8dc8a21b43f0 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -9287,9 +9287,9 @@ isImpliedCondCommonOperandWithCR(CmpPredicate LPred, const ConstantRange &LCR,
return Res;
if (LPred.hasSameSign() ^ RPred.hasSameSign()) {
LPred = LPred.hasSameSign() ? ICmpInst::getFlippedSignednessPredicate(LPred)
- : static_cast<CmpInst::Predicate>(LPred);
+ : LPred.dropSameSign();
RPred = RPred.hasSameSign() ? ICmpInst::getFlippedSignednessPredicate(RPred)
- : static_cast<CmpInst::Predicate>(RPred);
+ : RPred.dropSameSign();
return CRImpliesPred(ConstantRange::makeAllowedICmpRegion(LPred, LCR),
RPred);
}
|
dtcxzyw
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LG
|
LLVM Buildbot has detected a new failure on builder Full details are available at: https://lab.llvm.org/buildbot/#/builders/18/builds/18661 Here is the relevant piece of the build log for the reference |
No description provided.