[llvm] [ValueTracking] Check both operands for being 0 and then the other for isKnownNonZero (PR #147330)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 7 09:37:51 PDT 2025
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff HEAD~1 HEAD --extensions cpp -- llvm/lib/Analysis/ValueTracking.cpp
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Analysis/ValueTracking.cpp b/llvm/lib/Analysis/ValueTracking.cpp
index c45fe3a75..792befe5b 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -2882,9 +2882,9 @@ static bool isNonZeroSub(const APInt &DemandedElts, const SimplifyQuery &Q,
// TODO: Move these into isKnownNonEqual().
if (match(X, m_Zero()) && isKnownNonZero(Y, DemandedElts, Q, Depth))
- return true;
+ return true;
if (match(Y, m_Zero()) && isKnownNonZero(X, DemandedElts, Q, Depth))
- return true;
+ return true;
return ::isKnownNonEqual(X, Y, DemandedElts, Q, Depth);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/147330
More information about the llvm-commits
mailing list