1 //===-- MBlazeTargetMachine.h - Define TargetMachine for MBlaze -*- 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 MBlaze specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef MBLAZE_TARGETMACHINE_H
15 #define MBLAZE_TARGETMACHINE_H
17 #include "MBlazeFrameLowering.h"
18 #include "MBlazeISelLowering.h"
19 #include "MBlazeInstrInfo.h"
20 #include "MBlazeIntrinsicInfo.h"
21 #include "MBlazeSelectionDAGInfo.h"
22 #include "MBlazeSubtarget.h"
23 #include "llvm/IR/DataLayout.h"
24 #include "llvm/MC/MCStreamer.h"
25 #include "llvm/Target/TargetFrameLowering.h"
26 #include "llvm/Target/TargetMachine.h"
27 #include "llvm/Target/TargetTransformImpl.h"
30 class formatted_raw_ostream;
32 class MBlazeTargetMachine : public LLVMTargetMachine {
33 MBlazeSubtarget Subtarget;
34 const DataLayout DL; // Calculates type size & alignment
35 MBlazeInstrInfo InstrInfo;
36 MBlazeFrameLowering FrameLowering;
37 MBlazeTargetLowering TLInfo;
38 MBlazeSelectionDAGInfo TSInfo;
39 MBlazeIntrinsicInfo IntrinsicInfo;
40 InstrItineraryData InstrItins;
41 ScalarTargetTransformImpl STTI;
42 VectorTargetTransformImpl VTTI;
45 MBlazeTargetMachine(const Target &T, StringRef TT,
46 StringRef CPU, StringRef FS,
47 const TargetOptions &Options,
48 Reloc::Model RM, CodeModel::Model CM,
49 CodeGenOpt::Level OL);
51 virtual const MBlazeInstrInfo *getInstrInfo() const
52 { return &InstrInfo; }
54 virtual const InstrItineraryData *getInstrItineraryData() const
55 { return &InstrItins; }
57 virtual const TargetFrameLowering *getFrameLowering() const
58 { return &FrameLowering; }
60 virtual const MBlazeSubtarget *getSubtargetImpl() const
61 { return &Subtarget; }
63 virtual const DataLayout *getDataLayout() const
66 virtual const MBlazeRegisterInfo *getRegisterInfo() const
67 { return &InstrInfo.getRegisterInfo(); }
69 virtual const MBlazeTargetLowering *getTargetLowering() const
72 virtual const MBlazeSelectionDAGInfo* getSelectionDAGInfo() const
75 const TargetIntrinsicInfo *getIntrinsicInfo() const
76 { return &IntrinsicInfo; }
78 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const
80 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const
83 // Pass Pipeline Configuration
84 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
86 } // End llvm namespace