1 //===-- SPUTargetMachine.h - Define TargetMachine for Cell SPU --*- C++ -*-===//
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 declares the CellSPU-specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef SPU_TARGETMACHINE_H
15 #define SPU_TARGETMACHINE_H
17 #include "SPUSubtarget.h"
18 #include "SPUInstrInfo.h"
19 #include "SPUISelLowering.h"
20 #include "SPUSelectionDAGInfo.h"
21 #include "SPUFrameLowering.h"
22 #include "llvm/Target/TargetMachine.h"
23 #include "llvm/Target/TargetTransformImpl.h"
24 #include "llvm/DataLayout.h"
30 class SPUTargetMachine : public LLVMTargetMachine {
31 SPUSubtarget Subtarget;
33 SPUInstrInfo InstrInfo;
34 SPUFrameLowering FrameLowering;
35 SPUTargetLowering TLInfo;
36 SPUSelectionDAGInfo TSInfo;
37 InstrItineraryData InstrItins;
38 ScalarTargetTransformImpl STTI;
39 VectorTargetTransformImpl VTTI;
41 SPUTargetMachine(const Target &T, StringRef TT,
42 StringRef CPU, StringRef FS, const TargetOptions &Options,
43 Reloc::Model RM, CodeModel::Model CM,
44 CodeGenOpt::Level OL);
46 /// Return the subtarget implementation object
47 virtual const SPUSubtarget *getSubtargetImpl() const {
50 virtual const SPUInstrInfo *getInstrInfo() const {
53 virtual const SPUFrameLowering *getFrameLowering() const {
54 return &FrameLowering;
57 \note Cell SPU does not support JIT today. It could support JIT at some
60 virtual TargetJITInfo *getJITInfo() {
64 virtual const SPUTargetLowering *getTargetLowering() const {
68 virtual const SPUSelectionDAGInfo* getSelectionDAGInfo() const {
72 virtual const SPURegisterInfo *getRegisterInfo() const {
73 return &InstrInfo.getRegisterInfo();
76 virtual const DataLayout *getDataLayout() const {
80 virtual const InstrItineraryData *getInstrItineraryData() const {
83 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
86 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
90 // Pass Pipeline Configuration
91 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
94 } // end namespace llvm