[llvm] [InstCombine] Combine and->cmp->sel->or-disjoint into and->mul (PR #135274)

via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 17 12:57:27 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 h,cpp -- llvm/include/llvm/Analysis/CmpInstAnalysis.h llvm/lib/Analysis/CmpInstAnalysis.cpp llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
``````````

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
index 63637865f..c931ce435 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3678,8 +3678,9 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
         if (RHSDecompose->Pred == ICmpInst::ICMP_NE)
           std::swap(Op1Eq, Op1Ne);
 
-        if (Op0Ne->isStrictlyPositive() && Op1Ne->isStrictlyPositive() && Op0Eq->isZero() &&
-            Op1Eq->isZero() && Op0Ne->urem(LHSDecompose->Mask).isZero() &&
+        if (Op0Ne->isStrictlyPositive() && Op1Ne->isStrictlyPositive() &&
+            Op0Eq->isZero() && Op1Eq->isZero() &&
+            Op0Ne->urem(LHSDecompose->Mask).isZero() &&
             Op1Ne->urem(RHSDecompose->Mask).isZero() &&
             Op0Ne->udiv(LHSDecompose->Mask) ==
                 Op1Ne->udiv(RHSDecompose->Mask)) {

``````````

</details>


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


More information about the llvm-commits mailing list