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

Shan Huang via llvm-commits llvm-commits at lists.llvm.org
Sat May 11 09:06:55 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 preserving-debugloc-store
----------------
Apochens wrote:

Oh, I made a mistake here :(. I forgot to make the test name consistent after I renamed the attached test (I changed the name from "preserving-" to "update-", because there is a drop for the `Initial`). I'll fix it.

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


More information about the llvm-commits mailing list