[llvm] [DebugInfo][RemoveDIs] Instrument loop-deletion for DPValues (PR #73042)

via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 21 13:35:22 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 23c84fb362849865990c0e160158b19f54742147 8470224c78ba92a197097a00c2166b3c6850acdb -- llvm/lib/Transforms/Utils/LoopUtils.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/Utils/LoopUtils.cpp b/llvm/lib/Transforms/Utils/LoopUtils.cpp
index bf1e37a97c..2d0e9f6f41 100644
--- a/llvm/lib/Transforms/Utils/LoopUtils.cpp
+++ b/llvm/lib/Transforms/Utils/LoopUtils.cpp
@@ -632,14 +632,16 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
 
         // RemoveDIs: do the same as below for DPValues.
         if (Block->IsNewDbgInfoFormat) {
-          for (DPValue &DPV : llvm::make_early_inc_range(I.getDbgValueRange())) {
-            auto Key =
-                DeadDebugSet.find(DebugVariable(DPV.getVariable(), DPV.getExpression(), nullptr));
+          for (DPValue &DPV :
+               llvm::make_early_inc_range(I.getDbgValueRange())) {
+            auto Key = DeadDebugSet.find(
+                DebugVariable(DPV.getVariable(), DPV.getExpression(), nullptr));
             if (Key != DeadDebugSet.end())
               continue;
             // Unlinks the DPV from it's container, for later insertion.
             DPV.removeFromParent();
-            DeadDebugSet.insert(DebugVariable(DPV.getVariable(), DPV.getExpression(), nullptr));
+            DeadDebugSet.insert(
+                DebugVariable(DPV.getVariable(), DPV.getExpression(), nullptr));
             DeadDPValues.push_back(&DPV);
           }
         }
@@ -662,7 +664,8 @@ void llvm::deleteDeadLoop(Loop *L, DominatorTree *DT, ScalarEvolution *SE,
     // Move dbg.values out the loop so that earlier location ranges are still
     // terminated and loop invariant assignments are preserved.
     DIBuilder DIB(*ExitBlock->getModule());
-    BasicBlock::iterator InsertDbgValueBefore = ExitBlock->getFirstInsertionPt();
+    BasicBlock::iterator InsertDbgValueBefore =
+        ExitBlock->getFirstInsertionPt();
     assert(InsertDbgValueBefore != ExitBlock->end() &&
            "There should be a non-PHI instruction in exit block, else these "
            "instructions will have no parent.");

``````````

</details>


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


More information about the llvm-commits mailing list