summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-08-06 21:16:16 +0000
committerReid Kleckner <rnk@google.com>2018-08-06 21:16:16 +0000
commit15e91c32354deebef7e8c74fa25022bfa1dbe193 (patch)
tree5160f3e181471341a16089fcf3d6397552b8066e /llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
parent81c7dc93d29327d8ac47ff495f2c17888e00b335 (diff)
downloadbcm5719-llvm-15e91c32354deebef7e8c74fa25022bfa1dbe193.tar.gz
bcm5719-llvm-15e91c32354deebef7e8c74fa25022bfa1dbe193.zip
[X86] Fix assertion in subreg extraction
This assert fires when attempting to extract a subregister from the global PIC base register. This virtual register SD node is not in the VRBaseMap, so we shouldn't call getVR to look it up there. If this is a RegisterSDNode, we should be able to use the virtual register directly. Fixes PR38385 llvm-svn: 339056
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
index d6171f3177d..238ea878510 100644
--- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
@@ -524,7 +524,7 @@ void InstrEmitter::EmitSubregNode(SDNode *Node,
Reg = R->getReg();
DefMI = nullptr;
} else {
- Reg = getVR(Node->getOperand(0), VRBaseMap);
+ Reg = R ? R->getReg() : getVR(Node->getOperand(0), VRBaseMap);
DefMI = MRI->getVRegDef(Reg);
}
OpenPOWER on IntegriCloud