[llvm] [InstCombine] Handle commuted cases of the fold `((B|C)&A)|B -> B|(A&C)` (PR #76565)

via llvm-commits llvm-commits at lists.llvm.org
Fri Dec 29 05:52:02 PST 2023


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 b6daac023a72235108bddc17a5245a9371cd6147 026f221761edec4070b3ac26dac9497ee3591309 -- 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 1168cca12f..c03f50d758 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -3516,7 +3516,7 @@ Instruction *InstCombinerImpl::visitOr(BinaryOperator &I) {
   if (match(Op0, m_c_And(m_c_Or(m_Specific(Op1), m_Value(C)), m_Value(A))))
     return BinaryOperator::CreateOr(Op1, Builder.CreateAnd(A, C));
 
-  // B | ((B | C) & A) -> B | (A & C) 
+  // B | ((B | C) & A) -> B | (A & C)
   if (match(Op1, m_c_And(m_c_Or(m_Specific(Op0), m_Value(C)), m_Value(A))))
     return BinaryOperator::CreateOr(Op0, Builder.CreateAnd(A, C));
 

``````````

</details>


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


More information about the llvm-commits mailing list