[PATCH] D150707: [DebugInfo] Handle undefined values for DBG_PHIs in InstrRef-LiveDebugValues

Stephen Tozer via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 02:54:15 PDT 2023


StephenTozer added a comment.

In D150707#4349347 <https://reviews.llvm.org/D150707#4349347>, @jmorse wrote:

> Would you agree?

I think that this change might just be the right thing to do: If the DBG_PHI does not refer to an invalid location, such as a dead stack slot, then the PHI-elimination step should always identify a non-empty value for that location: either the PHI for that location, or some non-empty value if we eliminated that PHI. The only exception to this as far as I can tell is if the block containing the DBG_PHI is unreachable, in which case all incoming values will be the empty value. Hence this code assumes that if we observe an empty value for a DBG_PHI with a valid location, it must be because this block is unreachable.

In //that// case, leaving the DBG_PHI value unchanged should mean it continues to refer to the live-in value for that location, which I think is correct - we have no way of knowing what the live-in value will be if the block is reached by an indirect jump, so leaving the DBG_PHI referring to the live-in value seems like the sensible approach to me; WDYT?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D150707



More information about the llvm-commits mailing list