[llvm] Reapply "[LICM] Fold associative binary ops to promote code hoisting (#81608)" (PR #100377)

via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 24 06:53:34 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 559be8e2b55afbf6736fed646542fb25793f0f7e 44823a10554d4d3e68735133d4b63ad00c443173 --extensions cpp -- llvm/lib/Transforms/Scalar/LICM.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index fe29fc36e2..34cb0708b8 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -2822,8 +2822,8 @@ static bool hoistBOAssociation(Instruction &I, Loop &L,
 
     auto *Inv = BinaryOperator::Create(Opcode, C1, C2, "invariant.op",
                                        Preheader->getTerminator());
-    auto *NewBO = BinaryOperator::Create(Opcode, LV, Inv,
-                                         BO->getName() + ".reass", BO);
+    auto *NewBO =
+        BinaryOperator::Create(Opcode, LV, Inv, BO->getName() + ".reass", BO);
 
     // Copy NUW for ADDs if both instructions have it.
     // https://alive2.llvm.org/ce/z/K9W3rk

``````````

</details>


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


More information about the llvm-commits mailing list