[llvm] r175023 - Debug Info: LiveDebugVarible can remove DBG_VALUEs, make sure we emit them back.

Eric Christopher echristo at gmail.com
Tue Feb 12 19:01:57 PST 2013


On Tue, Feb 12, 2013 at 6:48 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

>
>
> On Feb 12, 2013, at 6:37 PM, Eric Christopher <echristo at gmail.com> wrote:
>
> For function parameters this is still somewhat of a hack. The correct way
> to fix this is to change the representation we use for function arguments
> to use the incoming value and track that for location information - it
> would obviate the need to scan through the function collecting function
> parameters as if they were local variables.
>
>
> The problem is that in C, arguments are variables, so we can't simply
> track the incoming value. The variable could be reassigned.
>
>
I actually mean the llvm value which we basically copy into an alloca on
entry into the function in the front end. We should be able to track any
movement of that yes?


> Unless DWARF can track the incoming argument value separately from the
> current variable value?
>
>
My idea is that we could track what location it is separately via abi and
encode that and then any changes, but I was mostly thinking of not copying
the incoming value into an alloca in the front end and rather having the
dbg.value reference the function argument rather than the alloca. I'm not
sure what changes we'd need to make in allocation to track this though
offhand, my guess is some. The dbg.value on entry should have the function
argument via the prologue (or we just add them as part of the prologue)
which will have the ABI location and then any changes later would be marked
by a dbg.value as well if we spilled or killed the argument value (in the
case of unused arguments), but we'd be correct at the end of the prologue.

Sound plausible?


> Jakob: It looks like we don't need the value renaming machinery any more,
> i.e.
>
> void LiveDebugVariables::renameRegister(unsigned OldReg, unsigned NewReg,
> unsigned SubIdx)
>
> since I'm guessing the register allocator keeps the virtual register map
> up to date that we use later when we actually run the pass?
>
>
> If the code is really dead, it's fine to delete it. RA uses other LDV
> functions when spilling and splitting live ranges.
>

Seems so, I couldn't find a use of it anywhere, but you're in that code a
lot more than I am :)

-eric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130212/9135c013/attachment.html>


More information about the llvm-commits mailing list