From f298c319189920880c33fedc14b374b1e30231b3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Wed, 20 Aug 2008 00:35:17 +0000 Subject: [PATCH] Fix FastISel to recognize unhandled operands, such as constants that aren't available as virtual registers (for now). llvm-svn: 55026 --- lib/CodeGen/SelectionDAG/FastISel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index 996cea0155c..e56747a89c1 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 &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.