[PATCH] Rewrite calculateDbgValueHistory to make it (hopefully) more transparent.

Alexey Samsonov samsonov at google.com
Fri May 2 15:29:55 PDT 2014


Hi dblaikie,

This change preserves the original algorithm of generating history
for user variables, but makes it more clear.

High-level description of algorithm:
Scan all the machine basic blocks and machine instructions in the order
they are emitted to the object file. Do the following:
1) If we see a DBG_VALUE instruction, add it to the history of the
corresponding user variable. Keep track of all user variables, whose
locations are described by a register.
2) If we see a regular instruction, look at all the registers it clobbers,
and terminate the location range for all variables described by these registers.
3) At the end of the basic block, terminate location ranges for all
user variables described by some register.

(3) is too restrictive, and may result in a poor debug info.
For example, the variable location can be described by %rsp, or any other
register which is never clobbered in a function. I think that handling
this special case may improve situation for many real-life programs and
plan to address this in future commits.

http://reviews.llvm.org/D3597

Files:
  lib/CodeGen/AsmPrinter/DbgValueHistoryCalculator.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3597.9046.patch
Type: text/x-patch
Size: 9066 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140502/7953ae66/attachment.bin>


More information about the llvm-commits mailing list