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 "HexagonFrameLowering.h"
18 #include "HexagonISelLowering.h"
19 #include "HexagonInstrInfo.h"
20 #include "HexagonSelectionDAGInfo.h"
21 #include "HexagonSubtarget.h"
22 #include "llvm/DataLayout.h"
23 #include "llvm/Target/TargetMachine.h"
24 #include "llvm/Target/TargetTransformImpl.h"
30 class HexagonTargetMachine : public LLVMTargetMachine {
31 const DataLayout DL; // Calculates type size & alignment.
32 HexagonSubtarget Subtarget;
33 HexagonInstrInfo InstrInfo;
34 HexagonTargetLowering TLInfo;
35 HexagonSelectionDAGInfo TSInfo;
36 HexagonFrameLowering FrameLowering;
37 const InstrItineraryData* InstrItins;
38 ScalarTargetTransformImpl STTI;
39 VectorTargetTransformImpl VTTI;
42 HexagonTargetMachine(const Target &T, StringRef TT,StringRef CPU,
43 StringRef FS, const TargetOptions &Options,
44 Reloc::Model RM, CodeModel::Model CM,
45 CodeGenOpt::Level OL);
47 virtual const HexagonInstrInfo *getInstrInfo() const {
50 virtual const HexagonSubtarget *getSubtargetImpl() const {
53 virtual const HexagonRegisterInfo *getRegisterInfo() const {
54 return &InstrInfo.getRegisterInfo();
57 virtual const InstrItineraryData* getInstrItineraryData() const {
62 virtual const HexagonTargetLowering* getTargetLowering() const {
66 virtual const HexagonFrameLowering* getFrameLowering() const {
67 return &FrameLowering;
70 virtual const HexagonSelectionDAGInfo* getSelectionDAGInfo() const {
74 virtual const ScalarTargetTransformInfo *getScalarTargetTransformInfo()const {
78 virtual const VectorTargetTransformInfo *getVectorTargetTransformInfo()const {
82 virtual const DataLayout *getDataLayout() const { return &DL; }
83 static unsigned getModuleMatchQuality(const Module &M);
85 // Pass Pipeline Configuration.
86 virtual bool addPassesForOptimizations(PassManagerBase &PM);
87 virtual TargetPassConfig *createPassConfig(PassManagerBase &PM);
90 extern bool flag_aligned_memcpy;
92 } // end namespace llvm