[llvm] r310985 - Merge debug info when hoist then-else code to if.

Robinson, Paul via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 28 11:12:59 PDT 2017


Beyond that we get to the zero location - but in what scope?
 The scope of where it's hoisted into; in this case, the scope of the branch instruction.  Which could be a parent of the common parent of the hoisted instruction, but so what.  The scope of a line-0 location is not especially relevant,
Seems pretty important to me in terms of whether or not it's part of an inlined function (that's modeled with the same scope infrastructure), for example. (& also in terms of splitting ranges - which is mostly just about the size of the debug info - range fragments add more overhead, etc)

The branch instruction could be from a caller into two inlined calls, etc.

and using the scope of where the instruction lands seems least disruptive.
The optimizer is rewriting the code.  The instruction has line 0, so there's already no proper source attribution; whatever scope you use won't reflect the original source anyhow.  Using the scope of the branch instruction will minimize range splitting, and will tell the truth about the code as generated.
I won't complain (any further) if you decide to use the lowest common scope but I think that extra work provides no value.
--paulr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170828/db886f1a/attachment.html>


More information about the llvm-commits mailing list