diff options
| author | Dan Gohman <gohman@apple.com> | 2008-08-28 23:21:34 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2008-08-28 23:21:34 +0000 |
| commit | 99b218218c0ca3ebfdd568ddfeafa07842e9d69d (patch) | |
| tree | e4205b702341cd8904cf8e126f7027a4aef2b5c5 /lib | |
| parent | 327ef031ed038c55ddccb34fb922dd9c9fd735a6 (diff) | |
Add a target callback for FastISel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55512 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 9 | ||||
| -rw-r--r-- | lib/Target/X86/X86FastISel.cpp | 20 |
2 files changed, 27 insertions, 2 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f2246cac2c..9b982f4fb4 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -5757,10 +5757,15 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { Begin = F->SelectInstructions(Begin, End, FuncInfo->ValueMap, FuncInfo->MBBMap, BB); + // If the "fast" selector selected the entire block, we're done. if (Begin == End) - // The "fast" selector selected the entire block, so we're done. break; + // Next, try calling the target to attempt to handle the instruction. + if (F->TargetSelectInstruction(Begin, FuncInfo->ValueMap, + FuncInfo->MBBMap, BB)) + continue; + // Handle certain instructions as single-LLVM-Instruction blocks. if (isa<CallInst>(Begin) || isa<LoadInst>(Begin) || isa<StoreInst>(Begin)) { @@ -5783,7 +5788,7 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { // The "fast" selector couldn't handle something and bailed. // For the purpose of debugging, just abort. #ifndef NDEBUG - Begin->dump(); + Begin->dump(); #endif assert(0 && "FastISel didn't select the entire block"); } diff --git a/lib/Target/X86/X86FastISel.cpp b/lib/Target/X86/X86FastISel.cpp index f049a4d363..96bdb50fd6 100644 --- a/lib/Target/X86/X86FastISel.cpp +++ b/lib/Target/X86/X86FastISel.cpp @@ -19,3 +19,23 @@ #include "X86FastISel.h" #include "X86TargetMachine.h" #include "X86GenFastISel.inc" + +namespace llvm { + +namespace X86 { + +bool +FastISel::TargetSelectInstruction(Instruction *I, + DenseMap<const Value *, unsigned> &ValueMap, + DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap, + MachineBasicBlock *MBB) { + switch (I->getOpcode()) { + default: break; + } + + return false; +} + +} + +} |
