From c55fdcc9358d99bbc66bc6394a8490a7188fd74d Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 19 Aug 2008 20:43:22 +0000 Subject: Handle the case where target-specific fastisel code doesn't have a desired opcode. llvm-svn: 55005 --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'llvm/lib/CodeGen/SelectionDAG/FastISel.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index f4d453966b8..62fac06ceb8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/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; } -- cgit v1.2.3