Skip to content

Conversation

@artagnon
Copy link
Contributor

@artagnon artagnon commented Feb 7, 2025

No description provided.

@artagnon artagnon requested a review from dtcxzyw February 7, 2025 11:49
@artagnon artagnon requested a review from nikic as a code owner February 7, 2025 11:49
@llvmbot llvmbot added the llvm:analysis Includes value tracking, cost tables and constant folding label Feb 7, 2025
@llvmbot
Copy link
Member

llvmbot commented Feb 7, 2025

@llvm/pr-subscribers-llvm-analysis

Author: Ramkumar Ramachandra (artagnon)

Changes

Full diff: https://github.com/llvm/llvm-project/pull/126234.diff

1 Files Affected:

  • (modified) llvm/lib/Analysis/ValueTracking.cpp (+2-2)
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index 6eba6c0f08c3f40..94d5b877b7d43ec 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -8599,7 +8599,7 @@ bool llvm::isKnownInversion(const Value *X, const Value *Y) {
     return false;
 
   // They must both have samesign flag or not.
-  if (cast<ICmpInst>(X)->hasSameSign() != cast<ICmpInst>(Y)->hasSameSign())
+  if (Pred1.hasSameSign() != Pred2.hasSameSign())
     return false;
 
   if (B == C)
@@ -8611,7 +8611,7 @@ bool llvm::isKnownInversion(const Value *X, const Value *Y) {
     return false;
 
   // Sign bits of two RHSCs should match.
-  if (cast<ICmpInst>(X)->hasSameSign() &&
+  if (Pred1.hasSameSign() &&
       RHSC1->isNonNegative() != RHSC2->isNonNegative())
     return false;
 

@github-actions
Copy link

github-actions bot commented Feb 7, 2025

✅ With the latest revision this PR passed the C/C++ code formatter.

@artagnon artagnon merged commit 7f21c77 into llvm:main Feb 7, 2025
6 of 8 checks passed
@artagnon artagnon deleted the vt-inversion-nfc branch February 7, 2025 13:28
Icohedron pushed a commit to Icohedron/llvm-project that referenced this pull request Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

llvm:analysis Includes value tracking, cost tables and constant folding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants