[llvm] [llvm] [InstCombine] fold "icmp eq (X + (V - 1)) & -V, X" to "icmp eq 0, (and X, V - 1)" (PR #152851)
via llvm-commits
llvm-commits at lists.llvm.org
Sat Aug 9 12:17:13 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,h -- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp llvm/lib/Transforms/InstCombine/InstCombineInternal.h
``````````
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 6adfbcd11..569c4dd51 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -1360,7 +1360,8 @@ Instruction *InstCombinerImpl::foldNextMultiply(ICmpInst &Cmp) {
if (!match(Neg, m_Sub(m_Zero(), m_Value(Value))))
return nullptr;
- // mask = add %val, -1. No commutative here, since it's canonical representation for sub %val, -1
+ // mask = add %val, -1. No commutative here, since it's canonical
+ // representation for sub %val, -1
if (!match(Mask, m_Add(m_Value(Value), m_AllOnes()))) {
if (match(Num, m_Add(m_Value(Value), m_AllOnes()))) {
std::swap(Mask, Num);
``````````
</details>
https://github.com/llvm/llvm-project/pull/152851
More information about the llvm-commits
mailing list