[PATCH] D55299: [LoopDeletion] Update debug values after loop deletion.

Davide Italiano via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 4 15:34:43 PST 2018


davide marked 3 inline comments as done.
davide added inline comments.


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:376
+    DIB.insertDbgValueIntrinsic(
+        UndefValue::get(DVI->getType()), DVI->getVariable(),
+        DVI->getExpression(), DVI->getDebugLoc(), ExitBlock->getFirstNonPHI());
----------------
Here I wasn't sure whether substituting with `void undef` was correct (or if it mattered at all).


================
Comment at: llvm/lib/Transforms/Utils/LoopUtils.cpp:388-392
     // its entry from the loop's block list.  We do that in the next section.
     for (Loop::block_iterator LpI = L->block_begin(), LpE = L->block_end();
          LpI != LpE; ++LpI)
       (*LpI)->eraseFromParent();
 
----------------
Aside, I saw we only remove the loop if we have LoopInfo available. Shouldn't we do that unconditionally?


================
Comment at: llvm/test/Transforms/LoopDeletion/diundef.ll:64
+!16 = !DILocalVariable(name: "i", scope: !12, file: !3, line: 3, type: !6)
+!17 = !DILocation(line: 3, column: 7, scope: !12)
+!18 = !DILocation(line: 4, column: 8, scope: !19)
----------------
aprantl wrote:
> we can probably simplify the metadata by removing the column info
I'll do the other twos, but this makes me a little nervous. It also doesn't really simplify that much, so I don't think it's really worth diverging.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55299/new/

https://reviews.llvm.org/D55299





More information about the llvm-commits mailing list