[PATCH] D70597: [PHIEliminate] skip dbg instruction when LowerPHINode

Jeremy Morse via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 12 06:04:10 PST 2020


jmorse added a comment.

Hi, sorry for the long delay,

> Checked with extracted.ll, on the block [19]: the dbg.value did not skip "llvm.lifetime" and "%21 add" move after Label by SkipPHIsAndLabels() while ScheduleDAGSDNodes.
>  And later PASS (after ScheduleDAGSDNodes) removed "call llvm.lifetime.start" and "%21 add", and then left DBG_VALUEs between PHI and LABELs, and make errors.

Ouch, I definitely hadn't thought about other meta instructions. I guess there must be several passes that might move such instructions, and in the solution we followed they would all need to be aware of placing DBG_VALUEs between labels and PHIs, which would be a lot of work.

> Looks like we need to move DBG_VALUEs after LABELs on the beginning of PHIElimination.

Yeah, sounds like that's the safest option. Your proposed code looks good, although I suspect the "Inst" iterator could be invalidated / point somewhere else after the call to splice, which might mean you need to copy it before the splice. If you could update that into this patch and give it a test run, it should be good to commit.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70597





More information about the llvm-commits mailing list