[llvm] [DebugInfo][LoopLoadElim] Fix missing debug location updates (PR #91839)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Mon May 13 01:47:40 PDT 2024


================
@@ -448,6 +448,10 @@ class LoadEliminationForLoop {
         new LoadInst(Cand.Load->getType(), InitialPtr, "load_initial",
                      /* isVolatile */ false, Cand.Load->getAlign(),
                      PH->getTerminator()->getIterator());
+    // We don't give any debug location to Initial, because it is inserted
+    // into the loop's preheader. A debug location inside the loop will cause
+    // a misleading stepping when debugging. The test update-debugloc-store
+    // -forwarded.ll checks this.
----------------
OCHyams wrote:

nit: the test file name uses underscores and the comment uses hyphens.

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


More information about the llvm-commits mailing list