[llvm] [DebugInfo][SimpleLoopUnswitch] Fix missing debug location updates for new terminators (PR #98789)

Stephen Tozer via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 15 06:58:02 PDT 2024


================
@@ -666,10 +667,12 @@ static bool unswitchTrivialBranch(Loop &L, BranchInst &BI, DominatorTree &DT,
   // Finish updating dominator tree and memory ssa for full unswitch.
   if (FullUnswitch) {
     if (MSSAU) {
-      // Remove the cloned branch instruction.
-      ParentBB->getTerminator()->eraseFromParent();
-      // Create unconditional branch now.
-      BranchInst::Create(ContinueBB, ParentBB);
+      Instruction *Term = ParentBB->getTerminator();
+      // Remove the cloned branch instruction and
+      // create unconditional branch now.
----------------
SLTozer wrote:

```suggestion
      // Remove the cloned branch instruction and create an unconditional branch
      // now.
```
Tiny nit.

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


More information about the llvm-commits mailing list