summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Program.cpp
diff options
context:
space:
mode:
authorBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2018-04-30 14:37:39 +0000
committerBjorn Pettersson <bjorn.a.pettersson@ericsson.com>2018-04-30 14:37:39 +0000
commitabafca619b50b9e05055122813c079f152f8f102 (patch)
tree125aacd8b400c13128bfbdef7dd0272a534be68d /llvm/lib/Support/Program.cpp
parent116c0424da83d29903b1bd76a01e1c7230a1f74f (diff)
downloadbcm5719-llvm-abafca619b50b9e05055122813c079f152f8f102.tar.gz
bcm5719-llvm-abafca619b50b9e05055122813c079f152f8f102.zip
[SelectionDAG] Improve selection of DBG_VALUE using a PHI node result
Summary: When building the selection DAG at ISel all PHI nodes are selected and lowered to Machine Instruction PHI nodes before we start to create any SDNodes. So there are no SDNodes for values produced by the PHI nodes. In the past when selecting a dbg.value intrinsic that uses the value produced by a PHI node we have been handling such dbg.value intrinsics as "dangling debug info". I.e. we have not created a SDDbgValue node directly, because there is no existing SDNode for the PHI result, instead we deferred the creationg of a SDDbgValue until we found the first use of the PHI result. The old solution had a couple of flaws. The position of the selected DBG_VALUE instruction would end up quite late in a basic block, and for example not directly after the PHI node as in the LLVM IR input. And in case there were no use at all in the basic block the dbg.value could be dropped completely. This patch introduces a new VREG kind of SDDbgValue nodes. It is similar to a SDNODE kind of node, but it refers directly to a virtual register and not a SDNode. When we do selection for a dbg.value that is using the result of a PHI node we can do a lookup of the virtual register directly (as it already is determined for the PHI node) and create a SDDbgValue node immediately instead of delaying the selection until we find a use. This should fix a problem with losing debug info at ISel as seen in PR37234 (https://bugs.llvm.org/show_bug.cgi?id=37234). It does not resolve PR37234 completely, because the debug info is dropped later on in the BranchFolder (see D46184). Reviewers: #debug-info, aprantl Reviewed By: #debug-info, aprantl Subscribers: rnk, gbedwell, aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D46129 llvm-svn: 331182
Diffstat (limited to 'llvm/lib/Support/Program.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud