[PATCH] D51612: [DebugInfo] Handle stack slot offsets for spilled sub-registers in LDV

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 4 08:50:20 PDT 2018


aprantl added a comment.

The best place to do the simplification / constant-folding in the DIExpresssion is in DwarfExpression.cpp, just before it gets emitted.



================
Comment at: lib/CodeGen/LiveDebugVariables.cpp:1222
+    Expr =
+        DIExpression::prepend(Expr, DIExpression::NoDeref, SpillOffset, Deref);
     IsIndirect = true;
----------------
The DW_OP_deref is not already part of the expression if `Loc.wasIndirect()`?


================
Comment at: test/CodeGen/PowerPC/live-debug-vars-subreg-offset.ll:43
+  call void @llvm.dbg.value(metadata i32 %call, metadata !13, metadata !DIExpression()), !dbg !15
+  tail call void asm sideeffect "", "~{r0},~{r1},~{r2},~{r3},~{r4},~{r5},~{r6},~{r7},~{r8},~{r9},~{r10},~{r11},~{r12},~{r13},~{r14},~{r15},~{r16},~{r17},~{r18},~{r19},~{r20},~{r21},~{r22},~{r23},~{r24},~{r25},~{r26},~{r27},~{r28},~{r29},~{r30},~{r31}"() #2, !dbg !16, !srcloc !17
+  br label %for.cond, !dbg !18
----------------
Nice testcase! You can reduce it even further by setting all of the !dbg locations to the same location.


Repository:
  rL LLVM

https://reviews.llvm.org/D51612





More information about the llvm-commits mailing list