[llvm] [PromoteMemToReg] Insert store undef when removing lifetime markers (PR #191909)

Orlando Cazalet-Hyams via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 23 03:20:26 PDT 2026


================
@@ -31,6 +31,9 @@
 ; CHECK-NEXT: %To.sroa.4 = alloca { i32, i32, i32 }, align 8, !DIAssignID ![[ID_3:[0-9]+]]
 ; CHECK-NEXT: #dbg_assign({{.+}} undef, ![[TO]], !DIExpression(DW_OP_LLVM_fragment, 128, 96), ![[ID_3]], ptr %To.sroa.4, !DIExpression(),
 
+;; lifetime.start makes the middle (promoted) slice undef.
+; CHECK: #dbg_value(i32 undef, ![[TO]], !DIExpression(DW_OP_LLVM_fragment, 96, 32),
----------------
OCHyams wrote:

This fragment was already implicitly undef because it had not yet been defined. Above there are variable location descriptions for bits `[0, 96)` and `[128, 244)`

It shouldn't harm debug info correctness as it's just redundant information, but we've had issues in the past with a lot of redundant debug info causing significant additional compile time and memory consumption

Is it possible to avoid emitting these extra debug markers, or would that add a lot of complexity?

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


More information about the llvm-commits mailing list