[PATCH] D64595: [Debuginfo][SROA] Need to handle dbg.value in SROA pass.
Adrian Prantl via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Aug 20 08:33:19 PDT 2019
aprantl added a comment.
In D64595#1637264 <https://reviews.llvm.org/D64595#1637264>, @jmorse wrote:
> Adrian wrote:
>
> > Stepping back a bit: Is the result of SROA multiple smaller allocas?
> >
> > If SROA is only creating new allocas, then describing them with dbg.declares should do no harm, since a later call to LowerDbgDeclare would truncate their range by inserting new dbg.values at every load. But if SROA is inserting the load, we do need to make sure that the loaded value is tracked by a dbg.value (potentially in addition to tracking the alloca with a dbg.declare). So I guess my question is, where are loads for the SROAed allocas generated?
>
> My understanding of SROA is that no new loads are generated, instead existing ones using GEPs and bitcasts are rewritten to use the smaller allocas. Any dbg.declare get fragmented into the smaller allocas in the usual way, then mem2reg / LowerDbgDeclare promotes in the usual way. In some circumstances the same load might get duplicated to enable promotion, such as:
Side note: Should we make sure that when a load via a GEP/cast-chain is generated there is a dbg.value with a DW_OP_fragment emitted as well (possibly in LowerDbgDeclare)?
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D64595/new/
https://reviews.llvm.org/D64595
More information about the llvm-commits
mailing list