[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:04:36 PST 2024
https://github.com/goldsteinn created https://github.com/llvm/llvm-project/pull/83607
Doing arg1 is generally preferable as its more likely to be a constant
which will evaluate quickly.
>From 0be8e09cd52b192640a1f99236ea4e164140abad Mon Sep 17 00:00:00 2001
From: Noah Goldstein <goldstein.w.n at gmail.com>
Date: Fri, 1 Mar 2024 13:02:58 -0600
Subject: [PATCH] [ValueTracking] Change recursive eval order for
`isKnownNonZero(umin)`; NFC
Doing arg1 is generally preferable as its more likely to be a constant
which will evaluate quickly.
---
llvm/lib/Analysis/ValueTracking.cpp | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
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];
More information about the llvm-commits
mailing list