LLVM  3.7.0
HexagonSubtarget.h
Go to the documentation of this file.
1 //===-- HexagonSubtarget.h - Define Subtarget for the Hexagon ---*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // This file declares the Hexagon specific subclass of TargetSubtarget.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H
15 #define LLVM_LIB_TARGET_HEXAGON_HEXAGONSUBTARGET_H
16 
17 #include "HexagonFrameLowering.h"
18 #include "HexagonISelLowering.h"
19 #include "HexagonInstrInfo.h"
21 #include "llvm/IR/DataLayout.h"
24 #include <string>
25 
26 #define GET_SUBTARGETINFO_HEADER
27 #include "HexagonGenSubtargetInfo.inc"
28 
29 #define Hexagon_SMALL_DATA_THRESHOLD 8
30 #define Hexagon_SLOTS 4
31 
32 namespace llvm {
33 
35  virtual void anchor();
36 
37  bool UseMemOps;
38  bool ModeIEEERndNear;
39 
40 public:
42  V4, V5
43  };
44 
46 private:
47  std::string CPUString;
48  HexagonInstrInfo InstrInfo;
49  HexagonTargetLowering TLInfo;
51  HexagonFrameLowering FrameLowering;
52  InstrItineraryData InstrItins;
53 
54 public:
56  const TargetMachine &TM);
57 
58  /// getInstrItins - Return the instruction itineraries based on subtarget
59  /// selection.
60  const InstrItineraryData *getInstrItineraryData() const override {
61  return &InstrItins;
62  }
63  const HexagonInstrInfo *getInstrInfo() const override { return &InstrInfo; }
64  const HexagonRegisterInfo *getRegisterInfo() const override {
65  return &InstrInfo.getRegisterInfo();
66  }
67  const HexagonTargetLowering *getTargetLowering() const override {
68  return &TLInfo;
69  }
70  const HexagonFrameLowering *getFrameLowering() const override {
71  return &FrameLowering;
72  }
73  const HexagonSelectionDAGInfo *getSelectionDAGInfo() const override {
74  return &TSInfo;
75  }
76 
78  StringRef FS);
79 
80  /// ParseSubtargetFeatures - Parses features string setting specified
81  /// subtarget options. Definition of function is auto generated by tblgen.
83 
84  bool useMemOps() const { return UseMemOps; }
85  bool hasV5TOps() const { return getHexagonArchVersion() >= V5; }
86  bool hasV5TOpsOnly() const { return getHexagonArchVersion() == V5; }
87  bool modeIEEERndNear() const { return ModeIEEERndNear; }
88  bool enableMachineScheduler() const override;
89  // Always use the TargetLowering default scheduler.
90  // FIXME: This will use the vliw scheduler which is probably just hurting
91  // compiler time and will be removed eventually anyway.
92  bool enableMachineSchedDefaultSched() const override { return false; }
93 
94  const std::string &getCPUString () const { return CPUString; }
95 
96  // Threshold for small data section
97  unsigned getSmallDataThreshold() const {
99  }
101  return HexagonArchVersion;
102  }
103 };
104 
105 } // end namespace llvm
106 
107 #endif
const HexagonArchEnum & getHexagonArchVersion() const
const HexagonFrameLowering * getFrameLowering() const override
const InstrItineraryData * getInstrItineraryData() const override
getInstrItins - Return the instruction itineraries based on subtarget selection.
unsigned getSmallDataThreshold() const
HexagonSubtarget & initializeSubtargetDependencies(StringRef CPU, StringRef FS)
const HexagonRegisterInfo * getRegisterInfo() const override
const HexagonRegisterInfo & getRegisterInfo() const
getRegisterInfo - TargetInstrInfo is a superset of MRegister info.
const HexagonTargetLowering * getTargetLowering() const override
HexagonSubtarget(const Triple &TT, StringRef CPU, StringRef FS, const TargetMachine &TM)
Itinerary data supplied by a subtarget to be used by a target.
HexagonArchEnum HexagonArchVersion
#define Hexagon_SMALL_DATA_THRESHOLD
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
bool enableMachineScheduler() const override
const std::string & getCPUString() const
bool enableMachineSchedDefaultSched() const override
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
ParseSubtargetFeatures - Parses features string setting specified subtarget options.
bool modeIEEERndNear() const
const HexagonInstrInfo * getInstrInfo() const override
const HexagonSelectionDAGInfo * getSelectionDAGInfo() const override
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:40
bool hasV5TOpsOnly() const