diff options
author | Owen Anderson <resistor@mac.com> | 2008-08-26 18:03:31 +0000 |
---|---|---|
committer | Owen Anderson <resistor@mac.com> | 2008-08-26 18:03:31 +0000 |
commit | 9fa72d9078dbead41d24462d0588135804999171 (patch) | |
tree | 694da4480cf7a13b73a4526ac7769da901b501e7 /lib/CodeGen | |
parent | e4a7877733555c9924ab0ec77f69fae5efd54e7a (diff) | |
download | external_llvm-9fa72d9078dbead41d24462d0588135804999171.zip external_llvm-9fa72d9078dbead41d24462d0588135804999171.tar.gz external_llvm-9fa72d9078dbead41d24462d0588135804999171.tar.bz2 |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55375 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r-- | lib/CodeGen/SelectionDAG/FastISel.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/FastISel.cpp b/lib/CodeGen/SelectionDAG/FastISel.cpp index fbceb2f..387929e 100644 --- a/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/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? |