aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-20 00:35:17 +0000
committerDan Gohman <gohman@apple.com>2008-08-20 00:35:17 +0000
commita7f2dff98e68ed8b2ac32f953768c04f26b52bea (patch)
tree1c89bad2b1cfa3a94e9ca52276fb276447df41ad /lib/CodeGen/SelectionDAG/FastISel.cpp
parent80b7bc865a995bb9cc7e2e20751aedfbfab683c7 (diff)
Fix FastISel to recognize unhandled operands, such as constants
that aren't available as virtual registers (for now). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55026 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index 996cea0155..e56747a89c 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -25,6 +25,10 @@ bool FastISel::SelectBinaryOp(Instruction *I, ISD::NodeType ISDOpcode,
DenseMap<const Value*, unsigned> &ValueMap) {
unsigned Op0 = ValueMap[I->getOperand(0)];
unsigned Op1 = ValueMap[I->getOperand(1)];
+ if (Op0 == 0 || Op1 == 0)
+ // Unhandled operand. Halt "fast" selection and bail.
+ return false;
+
MVT VT = MVT::getMVT(I->getType(), /*HandleUnknown=*/true);
if (VT == MVT::Other || !VT.isSimple())
// Unhandled type. Halt "fast" selection and bail.