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

via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 1 11:05:02 PST 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-llvm-analysis

Author: None (goldsteinn)

<details>
<summary>Changes</summary>

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
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];

``````````

</details>


https://github.com/llvm/llvm-project/pull/83607


More information about the llvm-commits mailing list