[PATCH] D31010: Fix PR32288
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 15 17:06:08 PDT 2017
aprantl marked 2 inline comments as done.
aprantl added inline comments.
================
Comment at: lib/CodeGen/AsmPrinter/DwarfExpression.cpp:290-291
+ // Emit any outstanding DW_OP_piece operations to mask out subregisters.
+ if (SubRegisterSizeInBits == 0)
+ return;
+ // Don't emit a DW_OP_piece for a subregister at offset 0.
----------------
dblaikie wrote:
> Is this ever true? What does that mean? (I guess it means there's no sub register at work? But that'd be handled by the below case too, right?)
>
> Is this to improve legibility, then?
Yes, that's the default for when nobody called setSubRegisterPiece() or reset it.
================
Comment at: test/DebugInfo/X86/PR26148.ll:22
;
-; CHECK: 0x00000025: Beginning address offset: 0x0000000000000004
+; CHECK: Beginning address offset: 0x0000000000000004
; CHECK: Ending address offset: 0x0000000000000004
----------------
dblaikie wrote:
> That's a bit confusing/interesting. (wonder what the rest of that location description now contains)
There's another 32-bit variable above it that now has a shorter expression.
================
Comment at: test/DebugInfo/X86/dw_op_minus_direct.ll:11-12
; CHECK: Ending address offset: 0x0000000000000004
-; CHECK: Location description: 50 10 01 1c 93 04
-; rax, constu 0x00000001, minus, piece 0x00000004
+; CHECK: Location description: 50 10 01 1c
+; rax, constu 0x00000001, minus
source_filename = "minus.c"
----------------
dblaikie wrote:
> This one's interesting - because the register's not at the top level.
>
> I would've expected the piece(4) would go against rax first, before the "- 1" & /could/ be relevant (a consumer might not know whether a register used in a complex location expression is the size of the destination value or not, etc)? But I guess it's probably OK?
That's an interesting edge-case, because the minus could underflow the upper part of rax and thus pollute the eax with garbage. We'd need to mask it out before the DW_OP_minus if we want this to be perfect.
https://reviews.llvm.org/D31010
More information about the llvm-commits
mailing list