summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorJeremy Morse <jeremy.morse.llvm@gmail.com>2019-01-16 17:25:27 +0000
committerJeremy Morse <jeremy.morse.llvm@gmail.com>2019-01-16 17:25:27 +0000
commit7dcea5ae3b34b7f105def72837ea22e61dacd663 (patch)
treec2ed4d93a07769427980a9ce7b5fd3e1a1458dbf /llvm/lib/CodeGen
parent2fabcfa1d4037cad405dcc0729e0860b043813c8 (diff)
downloadbcm5719-llvm-7dcea5ae3b34b7f105def72837ea22e61dacd663.tar.gz
bcm5719-llvm-7dcea5ae3b34b7f105def72837ea22e61dacd663.zip
[DebugInfo] Allow creation of DBG_VALUEs in blocks where the operand is not used
dbg.value intrinsics can appear in blocks where their operand is not used, meaning the operand never receives an SDNode, and thus no DBG_VALUE will be created. Get around this by looking to see whether the operand has already been allocated a virtual register. This allows dbg.values of Phi node and Values that are used across basic blocks to successfully be translated into DBG_VALUEs. Differential Revision: https://reviews.llvm.org/D56678 llvm-svn: 351358
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 871ab9b2988..e887af4ca58 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -5344,14 +5344,15 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
return nullptr;
}
- // PHI nodes have already been selected, so we should know which VReg that
- // is assigns to already.
- if (isa<PHINode>(V)) {
+ // The value is not used in this block yet (or it would have an SDNode).
+ // We still want the value to appear for the user if possible -- if it has
+ // an associated VReg, we can refer to that instead.
+ if (!isa<Argument>(V)) {
auto VMI = FuncInfo.ValueMap.find(V);
if (VMI != FuncInfo.ValueMap.end()) {
unsigned Reg = VMI->second;
- // The PHI node may be split up into several MI PHI nodes (in
- // FunctionLoweringInfo::set).
+ // If this is a PHI node, it may be split up into several MI PHI nodes
+ // (in FunctionLoweringInfo::set).
RegsForValue RFV(V->getContext(), TLI, DAG.getDataLayout(), Reg,
V->getType(), None);
if (RFV.occupiesMultipleRegs()) {
OpenPOWER on IntegriCloud