diff options
| author | Dan Gohman <gohman@apple.com> | 2009-12-05 01:27:58 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2009-12-05 01:27:58 +0000 |
| commit | 18f94469dc7a77612fb46319e660ad6283543c5a (patch) | |
| tree | e3cf5b1a24b39763ae449a4e7261aaee096b2ef7 /llvm/lib/CodeGen | |
| parent | 6c08ce77064f529a6e91dddd50a20b58f044679d (diff) | |
| download | bcm5719-llvm-18f94469dc7a77612fb46319e660ad6283543c5a.tar.gz bcm5719-llvm-18f94469dc7a77612fb46319e660ad6283543c5a.zip | |
Make TargetSelectInstruction protected and called from FastISel.cpp
instead of SelectionDAGISel.cpp.
llvm-svn: 90636
Diffstat (limited to 'llvm/lib/CodeGen')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FastISel.cpp | 10 | ||||
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 6 |
2 files changed, 9 insertions, 7 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp index c6c14016d28..4ead9c9d8c4 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FastISel.cpp @@ -532,7 +532,15 @@ bool FastISel::SelectBitCast(User *I) { bool FastISel::SelectInstruction(Instruction *I) { - return SelectOperator(I, I->getOpcode()); + // First, try doing target-independent selection. + if (SelectOperator(I, I->getOpcode())) + return true; + + // Next, try calling the target to attempt to handle the instruction. + if (TargetSelectInstruction(I)) + return true; + + return false; } /// FastEmitBranch - Emit an unconditional branch to the given block, diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 4a67b57cc2e..ca285c14e0a 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -792,12 +792,6 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, continue; } - // Next, try calling the target to attempt to handle the instruction. - if (FastIS->TargetSelectInstruction(BI)) { - ResetDebugLoc(SDB, FastIS); - continue; - } - // Clear out the debug location so that it doesn't carry over to // unrelated instructions. ResetDebugLoc(SDB, FastIS); |

