Skip to content
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

[ValueTracking] Change recursive eval order for isKnownNonZero(umin); NFC #83607

Closed
wants to merge 1 commit into from

Conversation

goldsteinn
Copy link
Contributor

Doing arg1 is generally preferable as its more likely to be a constant
which will evaluate quickly.

…`; NFC

Doing arg1 is generally preferable as its more likely to be a constant
which will evaluate quickly.
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 1, 2024

@llvm/pr-subscribers-llvm-analysis

Author: None (goldsteinn)

Changes

Doing arg1 is generally preferable as its more likely to be a constant
which will evaluate quickly.


Full diff: https://github.com/llvm/llvm-project/pull/83607.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 e591ac504e9f05..12dc39f3743fcc 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2742,8 +2742,8 @@ static bool isKnownNonZeroFromOperator(const Operator *I,
       }
         [[fallthrough]];
       case Intrinsic::umin:
-        return isKnownNonZero(II->getArgOperand(0), DemandedElts, Depth, Q) &&
-               isKnownNonZero(II->getArgOperand(1), DemandedElts, Depth, Q);
+        return isKnownNonZero(II->getArgOperand(1), DemandedElts, Depth, Q) &&
+               isKnownNonZero(II->getArgOperand(0), DemandedElts, Depth, Q);
       case Intrinsic::cttz:
         return computeKnownBits(II->getArgOperand(0), DemandedElts, Depth, Q)
             .Zero[0];

@goldsteinn goldsteinn closed this Mar 1, 2024
@goldsteinn
Copy link
Contributor Author

Realized umin(0) will just simplify to zero...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants