[llvm] [InstCombine] Fold Xor with or disjoint (PR #105992)

via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 30 10:44:32 PDT 2024


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 206b5aff44a95754f6dd7a5696efa024e983ac59 b2ecae045a3d93a24e6aa27f439cf458d8fbf2a8 --extensions 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 83955d6a3c..2cb72bc41d 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
@@ -4709,7 +4709,8 @@ Instruction *InstCombinerImpl::visitXor(BinaryOperator &I) {
 
   // (A | B) ^ C -> (A ^ C) ^ B
   // C ^ (A | B) -> B ^ (A ^ C)
-  if (match(&I, m_c_Xor(m_OneUse(m_c_DisjointOr(m_Value(X), m_Value(Y))), m_Value(M)))) {
+  if (match(&I, m_c_Xor(m_OneUse(m_c_DisjointOr(m_Value(X), m_Value(Y))),
+                        m_Value(M)))) {
     Value *XorAC = Builder.CreateXor(X, M);
     return BinaryOperator::CreateXor(XorAC, Y);
   }

``````````

</details>


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


More information about the llvm-commits mailing list