[llvm] [MachineLICM] Allow hoisting loads from invariant address (PR #70796)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 31 06:01:48 PDT 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 ab1c97b6510c4ce4643469191080a16b4007244d 149ff643ec6703c0d844a76863b7c7006aa8f204 -- llvm/lib/CodeGen/MachineLICM.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/CodeGen/MachineLICM.cpp b/llvm/lib/CodeGen/MachineLICM.cpp
index f1af74328f00..9283e1f93165 100644
--- a/llvm/lib/CodeGen/MachineLICM.cpp
+++ b/llvm/lib/CodeGen/MachineLICM.cpp
@@ -794,7 +794,8 @@ void MachineLICMBase::HoistOutOfLoop(MachineDomTreeNode *HeaderN,
 
     for (auto *MBB : CurLoop->blocks()) {
       for (auto &MI : *MBB) {
-        if (MI.mayStore() || MI.isCall() || (MI.mayLoad() && MI.hasOrderedMemoryRef())) {
+        if (MI.mayStore() || MI.isCall() ||
+            (MI.mayLoad() && MI.hasOrderedMemoryRef())) {
           for (MachineLoop *L = MLI->getLoopFor(MI.getParent()); L != CurLoop;
                L = L->getParentLoop())
             AllowedToHoistLoads[L] = false;
@@ -819,7 +820,8 @@ void MachineLICMBase::HoistOutOfLoop(MachineDomTreeNode *HeaderN,
       for (auto *MBB : L->blocks()) {
         for (auto &MI : *MBB) {
           // Taken from MachineInstr::isSafeToMove
-          if (MI.mayStore() || MI.isCall() || (MI.mayLoad() && MI.hasOrderedMemoryRef()))
+          if (MI.mayStore() || MI.isCall() ||
+              (MI.mayLoad() && MI.hasOrderedMemoryRef()))
             return false;
         }
       }

``````````

</details>


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


More information about the llvm-commits mailing list