[llvm] [DebugInfo][SimpleLoopUnswitch] Fix missing debug location updates (PR #97662)
Orlando Cazalet-Hyams via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 8 04:31:59 PDT 2024
================
@@ -0,0 +1,75 @@
+; RUN: opt -passes='simple-loop-unswitch<nontrivial>' -S < %s | FileCheck %s
+
+define i32 @basic(i32 %N, i1 %cond, i32 %select_input) !dbg !5 {
+; CHECK-LABEL: define i32 @basic(
+
+; Check that SimpleLoopUnswitch's unswitchNontrivialInvariants() drops the
+; debug location of the hoisted terminator and doesn't give any debug location
+; to the new freeze, since it's inserted in a hoist block.
+; Also check that in unswitchNontrivialInvariants(), the new br instruction
+; inherits the debug location of the old terminator in the same block.
+
+; CHECK: entry:
+; CHECK-NEXT: [[COND_FR:%.*]] = freeze i1 [[COND:%.*]]{{$}}
+; CHECK-NEXT: br i1 [[COND_FR]], label %[[ENTRY_SPLIT_US:.*]], label %[[ENTRY_SPLIT:.*]]{{$}}
+; CHECK: for.body.us:
+; CHECK-NEXT: br label %0, !dbg [[DBG13:![0-9]+]]
----------------
OCHyams wrote:
I'm not 100% what's the correct thing to do for this one - if I'm reading it right this source location is from the `select`. What's the thinking behind you change for this one?
https://github.com/llvm/llvm-project/pull/97662
More information about the llvm-commits
mailing list