[PATCH] D66663: [DebugInfo] LiveDebugValues should always revisit backedges if it skips them

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 26 07:25:46 PDT 2019


jmorse added a comment.

In D66663#1643786 <https://reviews.llvm.org/D66663#1643786>, @aprantl wrote:

> > Location of !103 changes in the loop block to constant-zero, which should later invalidate the in-location for the loop through the backedge, like it does in the "foo" function,
>
> When the set out OutLocs changes (and in this case it changes from [crumpets=⊥] to [crumpets=0]) all successor blocks (in this case also the block itself because of the back edge) should be added to worklist automatically. Why isn't this happening?
>
> > However, the out-locations of the loop block are not changed as the result of propagation, therefore the loop block is never re-visited.
>
> That I don't understand yet. They change from "no info" -> "some info". What am I missing?


Ah, this comes down to the initialisation that OutLocs experiences, performed here [0] before cross-block propagation starts. Because OutLocs is initialised with [crumpets=0] rather than ⊥, reprocessing the loop block after joining appears to change nothing, hence there's no further iteration.

Exactly why the initialisation happens isn't clear to me (it appears to be as old as LiveDebugValues). It causes other problems too (the entry block is never revisited in propagation, causing entry register/stack transfers to not be recorded) but that's for some other time.

I'll try reimplementing this patch by removing the initialisation phase and see what happens; I think (80%) there will still be some special casing needed though. If in the example the variable location was instead clobbered/undef'd in the loop block, the OutLocs for the loop would have effectively changed from uninitialised to false and the loop head would need revisiting, but this wouldn't actually present as a difference in the OutLocs vector-of-valid-locations.

[0] https://github.com/llvm/llvm-project/blob/0ae549814693eb201d7e7a0a77856e55a98e19ee/llvm/lib/CodeGen/LiveDebugValues.cpp#L1257


Repository:
  rL LLVM

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

https://reviews.llvm.org/D66663





More information about the llvm-commits mailing list