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

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 5 01:22:03 PDT 2018


dstenb added a comment.

In https://reviews.llvm.org/D51612#1223266, @aprantl wrote:

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


Okay! I'll look into putting together a separate patch for that.



================
Comment at: lib/CodeGen/LiveDebugVariables.cpp:1222
+    Expr =
+        DIExpression::prepend(Expr, DIExpression::NoDeref, SpillOffset, Deref);
     IsIndirect = true;
----------------
aprantl wrote:
> The DW_OP_deref is not already part of the expression if `Loc.wasIndirect()`?
As far as I have understood it, the locations that are covered by "WasIndirect" are the indirect (reg+offset) DBG_VALUEs, which if they are not spilled are as the indirect DW_OP_*breg* operations, so they will not have a DW_OP_deref beforehand.


================
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
----------------
aprantl wrote:
> Nice testcase! You can reduce it even further by setting all of the !dbg locations to the same location.
Good idea!


Repository:
  rL LLVM

https://reviews.llvm.org/D51612





More information about the llvm-commits mailing list