Dan Gohman | 1adf1b0 | 2008-08-19 21:45:35 +0000 | [diff] [blame] | 1 | //===-- X86FastISel.cpp - X86 FastISel implementation ---------------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // This file defines the X86-specific support for the FastISel class. Much |
| 11 | // of the target-specific code is generated by tablegen in the file |
| 12 | // X86GenFastISel.inc, which is #included here. |
| 13 | // |
| 14 | //===----------------------------------------------------------------------===// |
| 15 | |
| 16 | #include "X86.h" |
Dan Gohman | 1adf1b0 | 2008-08-19 21:45:35 +0000 | [diff] [blame] | 17 | #include "X86ISelLowering.h" |
Evan Cheng | 88e3041 | 2008-09-03 01:04:47 +0000 | [diff] [blame^] | 18 | #include "X86RegisterInfo.h" |
| 19 | #include "X86Subtarget.h" |
Dan Gohman | 22bb311 | 2008-08-22 00:20:26 +0000 | [diff] [blame] | 20 | #include "X86TargetMachine.h" |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 21 | #include "llvm/CodeGen/FastISel.h" |
Owen Anderson | 667d8f7 | 2008-08-29 17:45:56 +0000 | [diff] [blame] | 22 | #include "llvm/CodeGen/MachineRegisterInfo.h" |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 23 | |
| 24 | using namespace llvm; |
| 25 | |
| 26 | class X86FastISel : public FastISel { |
| 27 | /// Subtarget - Keep a pointer to the X86Subtarget around so that we can |
| 28 | /// make the right decision when generating code for different targets. |
| 29 | const X86Subtarget *Subtarget; |
| 30 | |
| 31 | public: |
Evan Cheng | 88e3041 | 2008-09-03 01:04:47 +0000 | [diff] [blame^] | 32 | explicit X86FastISel(MachineFunction &mf) : FastISel(mf) { |
| 33 | Subtarget = &TM.getSubtarget<X86Subtarget>(); |
| 34 | } |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 35 | |
| 36 | virtual bool |
| 37 | TargetSelectInstruction(Instruction *I, |
| 38 | DenseMap<const Value *, unsigned> &ValueMap, |
| 39 | DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap, |
| 40 | MachineBasicBlock *MBB); |
| 41 | |
Dan Gohman | 1adf1b0 | 2008-08-19 21:45:35 +0000 | [diff] [blame] | 42 | #include "X86GenFastISel.inc" |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 43 | }; |
Dan Gohman | 99b2182 | 2008-08-28 23:21:34 +0000 | [diff] [blame] | 44 | |
| 45 | bool |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 46 | X86FastISel::TargetSelectInstruction(Instruction *I, |
Dan Gohman | 99b2182 | 2008-08-28 23:21:34 +0000 | [diff] [blame] | 47 | DenseMap<const Value *, unsigned> &ValueMap, |
| 48 | DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap, |
| 49 | MachineBasicBlock *MBB) { |
| 50 | switch (I->getOpcode()) { |
| 51 | default: break; |
| 52 | } |
| 53 | |
| 54 | return false; |
| 55 | } |
| 56 | |
Evan Cheng | c3f44b0 | 2008-09-03 00:03:49 +0000 | [diff] [blame] | 57 | namespace llvm { |
| 58 | llvm::FastISel *X86::createFastISel(MachineFunction &mf) { |
| 59 | return new X86FastISel(mf); |
| 60 | } |
Dan Gohman | 99b2182 | 2008-08-28 23:21:34 +0000 | [diff] [blame] | 61 | } |