[llvm] [InstCombine] Missing optimization: fold mul (select a, b), (select b, a) to mul a, b (PR #74953)

via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 10 14:34:05 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 b2cc4b994e5fb85053b1acedec5ea0d1d42e5ec4 0df07c95613a884480f26d4cbed7f9e7492e04ae -- llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp llvm/lib/Transforms/InstCombine/InstCombineInternal.h llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
index 7e475e437b..104c736022 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
@@ -4229,8 +4229,8 @@ InstCombinerImpl::foldCommutativeIntrinsicOverSelects(IntrinsicInst &II) {
   Value *A, *B, *C;
   bool LHSIsSelect =
       match(II.getOperand(0), m_Select(m_Value(A), m_Value(B), m_Value(C)));
-  bool RHSIsSymmetricalSelect =
-      match(II.getOperand(1), m_Select(m_Specific(A), m_Specific(C), m_Specific(B)));
+  bool RHSIsSymmetricalSelect = match(
+      II.getOperand(1), m_Select(m_Specific(A), m_Specific(C), m_Specific(B)));
 
   if (LHSIsSelect && RHSIsSymmetricalSelect) {
     replaceOperand(II, 0, B);

``````````

</details>


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


More information about the llvm-commits mailing list