1 //===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU ----*- C++ -*-=//
3 // The LLVM Compiler Infrastructure
5 // This file was developed by a team from the Computer Systems Research
6 // Department at The Aerospace Corporation.
8 // See README.txt for details.
10 //===----------------------------------------------------------------------===//
12 // This file declares the CellSPU-specific subclass of TargetMachine.
14 //===----------------------------------------------------------------------===//
16 #ifndef SPU_TARGETMACHINE_H
17 #define SPU_TARGETMACHINE_H
19 #include "SPUSubtarget.h"
20 #include "SPUInstrInfo.h"
21 #include "SPUISelLowering.h"
22 #include "SPUFrameInfo.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetData.h"
29 class TargetFrameInfo;
33 class SPUTargetMachine : public LLVMTargetMachine {
34 SPUSubtarget Subtarget;
35 const TargetData DataLayout;
36 SPUInstrInfo InstrInfo;
37 SPUFrameInfo FrameInfo;
38 SPUTargetLowering TLInfo;
39 InstrItineraryData InstrItins;
42 virtual const TargetAsmInfo *createTargetAsmInfo() const;
45 SPUTargetMachine(const Module &M, const std::string &FS);
47 /// Return the subtarget implementation object
48 virtual const SPUSubtarget *getSubtargetImpl() const {
51 virtual const SPUInstrInfo *getInstrInfo() const {
54 virtual const TargetFrameInfo *getFrameInfo() const {
58 \note Cell SPU does not support JIT today. It could support JIT at some
61 virtual TargetJITInfo *getJITInfo() {
65 //! Module match function
67 Module matching function called by TargetMachineRegistry().
69 static unsigned getModuleMatchQuality(const Module &M);
71 virtual SPUTargetLowering *getTargetLowering() const {
72 return const_cast<SPUTargetLowering*>(&TLInfo);
75 virtual const MRegisterInfo *getRegisterInfo() const {
76 return &InstrInfo.getRegisterInfo();
79 virtual const TargetData *getTargetData() const {
83 virtual const InstrItineraryData getInstrItineraryData() const {
87 // Pass Pipeline Configuration
88 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
89 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
93 } // end namespace llvm