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 and is distributed under the
7 // University of Illinois Open Source License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
11 // This file declares the CellSPU-specific subclass of TargetMachine.
13 //===----------------------------------------------------------------------===//
15 #ifndef SPU_TARGETMACHINE_H
16 #define SPU_TARGETMACHINE_H
18 #include "SPUSubtarget.h"
19 #include "SPUInstrInfo.h"
20 #include "SPUISelLowering.h"
21 #include "SPUFrameInfo.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetData.h"
28 class TargetFrameInfo;
32 class SPUTargetMachine : public LLVMTargetMachine {
33 SPUSubtarget Subtarget;
34 const TargetData DataLayout;
35 SPUInstrInfo InstrInfo;
36 SPUFrameInfo FrameInfo;
37 SPUTargetLowering TLInfo;
38 InstrItineraryData InstrItins;
41 virtual const TargetAsmInfo *createTargetAsmInfo() const;
44 SPUTargetMachine(const Module &M, const std::string &FS);
46 /// Return the subtarget implementation object
47 virtual const SPUSubtarget *getSubtargetImpl() const {
50 virtual const SPUInstrInfo *getInstrInfo() const {
53 virtual const TargetFrameInfo *getFrameInfo() const {
57 \note Cell SPU does not support JIT today. It could support JIT at some
60 virtual TargetJITInfo *getJITInfo() {
64 //! Module match function
66 Module matching function called by TargetMachineRegistry().
68 static unsigned getModuleMatchQuality(const Module &M);
70 virtual SPUTargetLowering *getTargetLowering() const {
71 return const_cast<SPUTargetLowering*>(&TLInfo);
74 virtual const MRegisterInfo *getRegisterInfo() const {
75 return &InstrInfo.getRegisterInfo();
78 virtual const TargetData *getTargetData() const {
82 virtual const InstrItineraryData getInstrItineraryData() const {
86 // Pass Pipeline Configuration
87 virtual bool addInstSelector(FunctionPassManager &PM, bool Fast);
88 virtual bool addAssemblyEmitter(FunctionPassManager &PM, bool Fast,
92 } // end namespace llvm