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

Chris Ye via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 4 04:25:10 PST 2019


yechunliang added a comment.

I try to move DBG_VALUE after COPY, but have some doubts:

1. Is there the case that DBG_VALUE be exist after LABELs use %1 definition? if there is, we need to move all DBG_VALUEs, if not, we just need to move DBG_VALUE which located after PHIs.
2. After refactoring by using AfterPHIsIt instead of LastPHIIt, there is the case that the basic block only have two PHIs, AfterPHIslt will be null and pass to LowerPHINode(), not sure if passing argument(null) to a function is safety or not?

If using AfterPHIslt has no potential problem, we could use this for insert point. And we'd better first lower PHIs and then move DBG_VALUE on front of AfterPHIslt. 
For example: if we have

  PHI (1)
  PHI (2)
  DBG_VALUE (1)
  DBG_VALUE (2)
  EH_LABEL (1)
  DBG_VALUE (3)
  (AfterPHIsIt)

First Lower PHIs on front of AfterPHIsIt

  DBG_VALUE (1)
  DBG_VALUE (2)
  EH_LABEL (1)
  DBG_VALUE (3)
  COPY 1
  COPY 2
  (AfterPHIsIt)

Then move DEBUG_VALUE on front of AfterPHIsIt

  EH_LABEL (1)
  DBG_VALUE (3)
  COPY 1
  COPY 2
  DBG_VALUE (1)
  DBG_VALUE (2)
  (AfterPHIsIt)

if DBG_VALUE (3) will use %1, we need also move it together.

  EH_LABEL (1)
  COPY 1
  COPY 2
  DBG_VALUE (1)
  DBG_VALUE (2)
  DBG_VALUE (3)
  (AfterPHIsIt)


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

https://reviews.llvm.org/D70597





More information about the llvm-commits mailing list