From 27fb3dcbc738451856f641c70c94ed44a6b44ffd Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Tue, 26 Aug 2008 18:03:31 +0000 Subject: Make TargetInstrInfo::copyRegToReg return a bool indicating whether the copy requested was inserted or not. This allows bitcast in fast isel to properly handle the case where an appropriate reg-to-reg copy is not available. llvm-svn: 55375 --- llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (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 fbceb2fc95a..387929e751a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -250,9 +250,6 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, !TLI.isTypeLegal(SrcVT) || !TLI.isTypeLegal(DstVT)) // Unhandled type. Halt "fast" selection and bail. return I; - if (!TLI.isConvertLegal(SrcVT, DstVT)) - // Illegal conversion. Halt "fast" selection and bail. - return I; // Otherwise, insert a register-to-register copy. TargetRegisterClass* SrcClass = TLI.getRegClassFor(SrcVT); @@ -264,9 +261,12 @@ FastISel::SelectInstructions(BasicBlock::iterator Begin, // Unhandled operand. Halt "fast" selection and bail. return false; - TII.copyRegToReg(*MBB, MBB->end(), ResultReg, Op0, DstClass, SrcClass); - ValueMap[I] = ResultReg; + bool InsertedCopy = TII.copyRegToReg(*MBB, MBB->end(), ResultReg, + Op0, DstClass, SrcClass); + if (!InsertedCopy) + return I; + ValueMap[I] = ResultReg; break; } else // TODO: Casting a non-integral constant? -- cgit v1.2.3