1 //=-- HexagonTargetMachine.h - Define TargetMachine for Hexagon ---*- 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 Hexagon specific subclass of TargetMachine.
12 //===----------------------------------------------------------------------===//
14 #ifndef HexagonTARGETMACHINE_H
15 #define HexagonTARGETMACHINE_H
17 #include "llvm/Target/TargetMachine.h"
18 #include "llvm/Target/TargetData.h"
19 #include "HexagonInstrInfo.h"
20 #include "HexagonSubtarget.h"
21 #include "HexagonISelLowering.h"
22 #include "HexagonSelectionDAGInfo.h"
23 #include "HexagonFrameLowering.h"
29 class HexagonTargetMachine : public LLVMTargetMachine {
30 const TargetData DataLayout; // Calculates type size & alignment.
31 HexagonSubtarget Subtarget;
32 HexagonInstrInfo InstrInfo;
33 HexagonTargetLowering TLInfo;
34 HexagonSelectionDAGInfo TSInfo;
35 HexagonFrameLowering FrameLowering;
36 const InstrItineraryData* InstrItins;
39 HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
40 StringRef FS, TargetOptions Options, Reloc::Model RM,
41 CodeModel::Model CM, CodeGenOpt::Level OL);
43 virtual const HexagonInstrInfo *getInstrInfo() const {
46 virtual const HexagonSubtarget *getSubtargetImpl() const {
49 virtual const HexagonRegisterInfo *getRegisterInfo() const {
50 return &InstrInfo.getRegisterInfo();
53 virtual const InstrItineraryData* getInstrItineraryData() const {
58 virtual const HexagonTargetLowering* getTargetLowering() const {
62 virtual const HexagonFrameLowering* getFrameLowering() const {
63 return &FrameLowering;
66 virtual const HexagonSelectionDAGInfo* getSelectionDAGInfo() const {
70 virtual const TargetData *getTargetData() const { return &DataLayout; }
71 static unsigned getModuleMatchQuality(const Module &M);
73 // Pass Pipeline Configuration.
74 virtual bool addPassesForOptimizations(PassManagerBase &PM);
75 virtual bool addInstSelector(PassManagerBase &PM);
76 virtual bool addPreEmitPass(PassManagerBase &PM);
77 virtual bool addPreRegAlloc(llvm::PassManagerBase &PM);
78 virtual bool addPostRegAlloc(PassManagerBase &PM);
79 virtual bool addPreSched2(PassManagerBase &PM);
82 extern bool flag_aligned_memcpy;
84 } // end namespace llvm