aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/SelectionDAG/FastISel.cpp
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2008-08-19 20:43:22 +0000
committerDan Gohman <gohman@apple.com>2008-08-19 20:43:22 +0000
commit32155acb8af11fbe21553ef4056c555dcc4a0b99 (patch)
tree86a7bbd403feb9bb9d6112b75a6a1b7d719e8f47 /lib/CodeGen/SelectionDAG/FastISel.cpp
parent379cad44ecc91be24b2b147081d2089024cbaceb (diff)
Handle the case where target-specific fastisel code doesn't have
a desired opcode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55005 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/FastISel.cpp')
-rw-r--r--lib/CodeGen/SelectionDAG/FastISel.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp
index f4d453966b..62fac06ceb 100644
--- a/lib/CodeGen/SelectionDAG/FastISel.cpp
+++ b/lib/CodeGen/SelectionDAG/FastISel.cpp
@@ -33,6 +33,11 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, BasicBlock::iterator En
return I;
}
unsigned ResultReg = FastEmit_rr(VT.getSimpleVT(), ISD::ADD, Op0, Op1);
+ if (ResultReg == 0) {
+ // Target-specific code wasn't able to find a machine opcode for
+ // the given ISD opcode and type. Halt "fast" selection and bail.
+ return I;
+ }
ValueMap[I] = ResultReg;
break;
}