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

Manman Ren mren at apple.com
Tue Feb 12 21:53:52 PST 2013


On Feb 12, 2013, at 6:37 PM, Eric Christopher wrote:

> 
> 
> On Tue, Feb 12, 2013 at 5:14 PM, Manman Ren <mren at apple.com> wrote:
> Author: mren
> Date: Tue Feb 12 19:14:49 2013
> New Revision: 175023
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=175023&view=rev
> Log:
> Debug Info: LiveDebugVarible can remove DBG_VALUEs, make sure we emit them back.
> 
> RegisterCoalescer used to depend on LiveDebugVariable. LDV removes DBG_VALUEs
> without emitting them at the end.
> 
> 
> This isn't quite what's going on, it's mostly that we kept adding all the information and then never bothered to emit it.
LDV can remove DBG_VALUEs, I thought we need to make sure emitDebugValues of LDV is called before releasing LDV.
>  
> We fix this by removing LDV from RegisterCoalescer. Also add an assertion to
> make sure we call emitDebugValues if DBG_VALUEs are removed at
> runOnMachineFunction.
> 
> rdar://problem/13183203
> Reviewed by Andy & Jakob
> 
> 
> 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. Also, it shouldn't depend upon whether or not we're enabling misched or not, a simple testcase should be an unused parameter and dce.
> 
> +define void @Proc8(i32* nocapture %Array1Par, [51 x i32]* nocapture %Array2Par, i32 %IntParI1, i32 %IntParI2) nounwind optsize ssp uwtable {
> 
> You also shouldn't need ssp/uwtable on this.
Will do.
>  
>  class LiveDebugVariables : public MachineFunctionPass {
>    void *pImpl;
> +  /// Whether emitDebugValues is called.
> +  bool EmitDone;
> +  /// Whether the machine function is modified during the pass.
> +  bool ModifiedMF;
> 
>  Any reason why these aren't going into the pass impl?
They can be put in the pass impl. Is there an advantage of one vs. the other?
> 
> 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 so, Manman, can you delete the now dead code?
I will double check and remove the dead code if it is okay to do so.

Manman
> 
> Thanks!
> 
> -eric

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


More information about the llvm-commits mailing list