[llvm] [InstCombine] isKnownNonNegative should recognize `b - a` after `a <= b` (PR #145105)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 20 14:24:28 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 2025079f0..be9843503 100644
--- a/llvm/lib/Analysis/ValueTracking.cpp
+++ b/llvm/lib/Analysis/ValueTracking.cpp
@@ -283,7 +283,8 @@ bool llvm::isKnownNonNegative(const Value *V, const SimplifyQuery &SQ,
Value *X, *Y;
if (match(V, m_NSWSub(m_Value(X), m_Value(Y))))
- if (std::optional<bool> result = isImpliedByDomCondition(ICmpInst::ICMP_SLE, Y, X, SQ.CxtI, SQ.DL))
+ if (std::optional<bool> result =
+ isImpliedByDomCondition(ICmpInst::ICMP_SLE, Y, X, SQ.CxtI, SQ.DL))
return *result;
return false;
``````````
</details>
https://github.com/llvm/llvm-project/pull/145105
More information about the llvm-commits
mailing list