[PATCH] D60716: [DwarfDebug] Dump call site debug info into DWARF

Djordje Todorovic via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 12 05:04:14 PDT 2019


djtodoro added a comment.

@dstenb Thanks a lot, that seems useful!

> The size of MachineOperand is 32 bytes on x86-64, and the class only contains POD fields, so I guess it should be fairly cheap to copy such objects, or initialize them with compile-time known values? Though, perhaps that would still cause a noticeable increase in compilation time.



> I think it would be interesting to benchmark that at least

Yes, I agree that we should definitely experiment with that.

> Here is an x86-64 reproducer.
> 
> extern void callee(int);
> void caller() { callee(0); }
> 
> When compiled using -O2 -g -Xclang -femit-debug-entry-values it gives the following instruction to try to describe the parameter with:
> 
> $edi = XOR32rr undef $edi(tied-def 0), undef $edi, implicit-def dead $eflags

Thanks for the test case, I also came up with some "real world" cases with situation like this.

>> Can we describe such situation through the DIExpression instead?
> 
> Oh, maybe! Do you have some suggestions for how that could be done?

I think we could make a `DIExpression` with the `DW_OP_const* , 0` (within `ParamLoadedValue`) and then handle it properly in `collectCallSiteParameters()`. WDYT?
In addition, do you think that we could treat that situation like an improvement and create a separate thread for that (so we can re-land this with the latest fix)?


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60716/new/

https://reviews.llvm.org/D60716





More information about the llvm-commits mailing list