1 //===-- X86FastISel.cpp - X86 FastISel implementation ---------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
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.
14 //===----------------------------------------------------------------------===//
17 #include "X86ISelLowering.h"
18 #include "X86RegisterInfo.h"
19 #include "X86Subtarget.h"
20 #include "X86TargetMachine.h"
21 #include "llvm/CodeGen/FastISel.h"
22 #include "llvm/CodeGen/MachineRegisterInfo.h"
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;
32 explicit X86FastISel(MachineFunction &mf) : FastISel(mf) {
33 Subtarget = &TM.getSubtarget<X86Subtarget>();
37 TargetSelectInstruction(Instruction *I,
38 DenseMap<const Value *, unsigned> &ValueMap,
39 DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap,
40 MachineBasicBlock *MBB);
42 #include "X86GenFastISel.inc"
46 X86FastISel::TargetSelectInstruction(Instruction *I,
47 DenseMap<const Value *, unsigned> &ValueMap,
48 DenseMap<const BasicBlock *, MachineBasicBlock *> &MBBMap,
49 MachineBasicBlock *MBB) {
50 switch (I->getOpcode()) {
58 llvm::FastISel *X86::createFastISel(MachineFunction &mf) {
59 return new X86FastISel(mf);