[PATCH] D42551: [Debug] Add dbg.value intrinsics for PHIs created during LCSSA.

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 15:30:37 PST 2018


vsk added a comment.

In https://reviews.llvm.org/D42551#988523, @davide wrote:

> In https://reviews.llvm.org/D42551#988512, @vsk wrote:
>
> > In https://reviews.llvm.org/D42551#988510, @aprantl wrote:
> >
> > > I don't think this is correct. What if the first nonphi instruction is the terminator?
> >
> >
> > Oh I see. What about just inserting the dbg.value before the terminator? That should work for landingpad etc.
>
>
> I think the correct fix is that of skipping phis and `landingpads` (& maybe something else that requires to be the first instruction in a block?, don't remember, check langref or the verifier) and then insert the dbg value.


BasicBlock::getFirstInsertionPt() seems to do it. Wdyt? http://llvm.org/doxygen/BasicBlock_8cpp_source.html#l00200


Repository:
  rL LLVM

https://reviews.llvm.org/D42551





More information about the llvm-commits mailing list