[llvm] [InstCombine] Simplifiy `(-x * y * -x)` into `(x * y * x)` (PR #72953)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 02:13:14 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 dcab84fd5e0dcd9f5210dc024c2a2081cfb2e87e 748e5a3952750b8391458ea0ebd817dc24023e1a -- llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
index c36c73716d..6a36083b89 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineMulDivRem.cpp
@@ -363,8 +363,8 @@ Instruction *InstCombinerImpl::visitMul(BinaryOperator &I) {
       Mul->setHasNoSignedWrap(HasNSW);
       return Mul;
     }
-    return BinaryOperator::CreateMul(X,Builder.CreateMul(X, Y));
-    }
+    return BinaryOperator::CreateMul(X, Builder.CreateMul(X, Y));
+  }
   // (X / Y) *  Y = X - (X % Y)
   // (X / Y) * -Y = (X % Y) - X
   {

``````````

</details>


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


More information about the llvm-commits mailing list