[PATCH] D67225: [DebugInfo][X86] Describe call site values for zero-valued imms

David Stenberg via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 5 07:30:19 PDT 2019


dstenb created this revision.
dstenb added reviewers: aprantl, vsk, djtodoro, NikolaPrica.
dstenb added a project: debug-info.
Herald added subscribers: llvm-commits, hiraditya.
Herald added a project: LLVM.

Add zero-materializing XORs to X86's describeLoadedValue() hook in order
to produce call site values.

As the parameter value is materialized by an instruction, the
describeLoadedValue() hook can't return a pointer to an operand of the
instruction, which is the case for the other described instructions.
Instead, the X86InstrInfo holds a const machine operand which the hook
returns a pointer to. I have updated the comment for the hook in
TargetInstrInfo to indicate what kind of life-time the pointee should
have. This is a case where the code would be slightly cleaner if the
hook returned a machine operand object rather than a pointer.

I have had to change the defs logic in collectCallSiteParameters() a bit
to be able to describe the XORs. The XORs implicitly define $eflags,
which would cause them to never be considered, due to a guard condition
that I->getNumDefs() is one. I have changed that condition so that we
now only consider instructions where a forwarded register overlaps with
the instruction's single explicit define. We still need to collect the implicit
defines of other forwarded registers to remove them from the work list.
I'm not sure how to move towards supporting instructions with multiple
explicit defines, cases where forwarded register are implicitly defined,
and/or cases where an instruction produces values for multiple forwarded
registers. Perhaps the describeLoadedValue() hook should take a register
argument, and we then leave it up to the hook to describe the loaded
value in that register? I have not yet encountered a situation where
that would be necessary though.


Repository:
  rL LLVM

https://reviews.llvm.org/D67225

Files:
  llvm/include/llvm/CodeGen/TargetInstrInfo.h
  llvm/lib/CodeGen/AsmPrinter/DwarfDebug.cpp
  llvm/lib/Target/X86/X86InstrInfo.cpp
  llvm/lib/Target/X86/X86InstrInfo.h
  llvm/test/DebugInfo/X86/dbgcall-site-zero-valued-imms.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67225.218916.patch
Type: text/x-patch
Size: 7935 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190905/ffea3897/attachment.bin>


More information about the llvm-commits mailing list