[PATCH] D129636: Fix a LSR debug invariance issue

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 4 05:42:13 PDT 2022


fhahn added a comment.

In D129636#3698967 <https://reviews.llvm.org/D129636#3698967>, @chrisjackson wrote:

> In D129636#3696750 <https://reviews.llvm.org/D129636#3696750>, @fhahn wrote:
>
>> I think I am missing some context here, but this looks a bit suspicious. I am not sure if exposing and checking whether a SCEV exists is the right way to go.
>>
>> IIUC the main issue seems to be that we try to create SCEVs for all dbg intrinsics? Would it be possible to instead only get SCEV expressions for values we really need (that/s the induction variable I assume, for which there already should be SCEV expression)?
>
> It is necessary to obtain SCEVs for all the values used in dbg.value within the loop, as LSR may optimise out these values and these are salvaged by generating a DWARF expression from the SCEV expression. For further explanation see:
> D105207 <https://reviews.llvm.org/D105207> and the EuroLLVM2022 talk on the method here :SCEV-Based debuginfo salvaging in Loop Strength Reduction <https://llvm.org/devmtg/2022-05/>.

Right, but wouldn't it be sufficient to collect all expressions LSR optimizes? For those, it will already have created SCEV expressions for. This might be more difficult,  but I am wondering if it would be feasible at least in theory.


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

https://reviews.llvm.org/D129636



More information about the llvm-commits mailing list