[PATCH] D38088: Fix out-of-order stepping behavior in programs with hoisted constants.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 25 17:06:06 PDT 2017


On Fri, Sep 22, 2017 at 12:22 PM Robinson, Paul <paul.robinson at sony.com>
wrote:

> (re-adding llvm-commits)
>
> If this is motivated by SPGO issues - should it be using
> mergeDebugLocations, then (& thus only changing the location if they come
> from different basic blocks)?
>
>
>
> Well, you could consider it a merge of all the uses, but then it should
> also be merged with the insertion point, which is chosen to dominate the
> uses.
>

Doesn't need to be merged with the insertion point, I don't think? Does
this merge across basic blocks? or just raise the uses of a constant to the
beginning of a single basic block?

If it does work across basic block, then yeah, merging the location may be
insufficient (since the location could be the same but still be merging
across basic blocks... - not sure what the best way to detect/handle that
is)


>   Intuitively it seemed unlikely this would ever produce a real debug
> location.  (Also, in a sense this is an artificially generated instruction
> and from that perspective having no source location is also appropriate.)
>
> Do you want us to pursue the extra bookkeeping?  I'm having a hard time
> imagining this coming up in the wild (i.e., not convinced it's worth the
> effort, but you're a lot better at that than I am).
>

I'd guess at a macro that uses the same constant a few times (in which case
they'll have the same location) or maybe a single line statement (with
column info disabled) using the constant a few times/in a few places.

I'd think it'd be worth checking how this works for some simple cases with
a single basic block, etc. Maybe seeing how often that such a merge would
fire on a real codebase maybe, etc.

- Dave


> --paulr
>
>
>
> https://reviews.llvm.org/D38088
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170926/110636e7/attachment.html>


More information about the llvm-commits mailing list