[llvm-commits] [PATCH] Preserve DebugInfo during LICM

Chris Lattner clattner at apple.com
Sun Oct 11 11:58:04 PDT 2009


On Oct 8, 2009, at 2:23 AM, Török Edwin wrote:
> Hi,

Hi Edwin, sorry for the delay, I was hoping Devang would look at this.

> LICM currently sinks, and deletes debug stoppoints as dead  
> instructions.

That is bad :).

> The attached patch disables sink/hoist of debuginfo (simplifycfg  
> should
> already knows to ignore debuginfo when checking if it can merge  
> blocks),
> and also updates the debug info when sinking/hoisting instructions (by
> copying the stoppoints as needed).

Your change to not hoist debug intrinsics makes a lot of sense, please  
commit. I don't think the UpdateDbgInfoForMotion part is needed  
though.  Devang is moving line # info to be metadata on instructions,  
which will obsolete it.

> I think that we'd need another TEST.dbgquality that tests whether each
> basicblock has at least one stoppoint (if original did),
> and also outputs how many instructions have a stoppoint in same BB,  
> how
> many have a stoppoint
> foundable by findStopPointInst, and how many don't have at all. The  
> test
> would pass if each BB has at least one stoppoint,

I'm not sure what the right approach is here.  When stoppoints move to  
being on the instructions, we won't really need this.  However, there  
will be other forms of "poor debug info", for example, when we  
implemented this:
http://nondot.org/sabre/LLVMNotes/DebugInfoVariableInfo.txt

optimizers will stomp on values used by @llvm.dbg.value, silently  
pessimizing the debug info.  It would be nice to have a way to find  
the "bad" cases of these and fix them.

Thanks for working on this!

-Chris

> and output an overall quality for each test, and for the entire  
> testsuite.
> What do you think?
>
> Best regards,
> --Edwin
> <licm-dbginfo.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list