[PATCH] D134429: [DebugInfo][LICM] Drop DebugLoc from IntrinsicInst when hoisting

David Blaikie via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 27 10:23:52 PDT 2022


dblaikie accepted this revision.
dblaikie added a comment.
This revision is now accepted and ready to land.

In D134429#3818016 <https://reviews.llvm.org/D134429#3818016>, @jmmartinez wrote:

> In D134429#3816054 <https://reviews.llvm.org/D134429#3816054>, @dblaikie wrote:
>
>> In D134429#3815561 <https://reviews.llvm.org/D134429#3815561>, @jmmartinez wrote:
>>
>>> In D134429#3815441 <https://reviews.llvm.org/D134429#3815441>, @dblaikie wrote:
>>>
>>>> What's the motivation for the change - reduced debug info size by having fewer zero locations?
>>>
>>> The idea is to reduce the amount zero locations since they can be confusing for the users.
>>
>> At least GDB mostly ignores line zero, I think - so what sort of user confusion are you encountering/trying to address? Good to know what the use cases are, etc.
>
> The issue was raised, in two separate occasions, from people developing static-analysis tools that maps the assembly back to the source code (for example, to map register spills back to source-code).

Setting no location doesn't really make the instructions reliable though - they'll be arbitrary, based on whatever instructions happen to come before them. While it's useful to ignore location 0 to provide that flow-on location behavior for an interactive debugger (rather than stepping back and forth to "I don't know where I am" to "I'm on line 5", etc) so maybe this is suggesting that those users would like data that isn't available & still won't be reliably available with this change & might cause such tools to go from "we don't have an answer" to "now we sometimes have the wrong answer and we don't know which cases are reliable and which aren't" - those tools could implement "pretend line 0 has a flow-on location" and be able to show that to the user as "this is a best guess/might be wrong" and other places that don't have line zero might be more reliable. (I mean, not a lot more reliable, we're probably using no-location in a bunch of other places and the line table's probably too expensive to encode every no-location as line 0)

But, yeah, this is consistent with the existing code here and elsewhere that uses no location, I guess. Just some concerns about what it means that someone's finding this to be a problem ^.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D134429/new/

https://reviews.llvm.org/D134429



More information about the llvm-commits mailing list