[llvm] [DebugInfo][RemoveDIs] Instrument loop-rotate for DPValues (PR #72997)

Jeremy Morse via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 23 04:38:36 PST 2023


================
@@ -551,7 +606,17 @@ bool LoopRotate::rotateLoop(Loop *L, bool SimplifiedLatch) {
       if (L->hasLoopInvariantOperands(Inst) && !Inst->mayReadFromMemory() &&
           !Inst->mayWriteToMemory() && !Inst->isTerminator() &&
           !isa<DbgInfoIntrinsic>(Inst) && !isa<AllocaInst>(Inst)) {
+
+        if (LoopEntryBranch->getParent()->IsNewDbgInfoFormat) {
+          auto DbgValueRange =
+              LoopEntryBranch->cloneDebugInfoFrom(Inst, NextDbgInst);
----------------
jmorse wrote:

Even more extra commentary added in the latest commit, hopefully that illustrates a bit better? Not that it helps, but this is certainly the dumbest part of all RemoveDIs -- it's also unavoidable given that we're separating the iterator/cursor of Real Instructions (TM) from the positions of debug-info. Hopefully in the future we'll refactor this into a utility that takes care of it.

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


More information about the llvm-commits mailing list