LLVM  4.0.0
SystemZSubtarget.h
Go to the documentation of this file.
1 //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- 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 SystemZ specific subclass of TargetSubtargetInfo.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
15 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
16 
17 #include "SystemZFrameLowering.h"
18 #include "SystemZISelLowering.h"
19 #include "SystemZInstrInfo.h"
20 #include "SystemZRegisterInfo.h"
22 #include "llvm/IR/DataLayout.h"
23 #include "llvm/ADT/Triple.h"
25 #include <string>
26 
27 #define GET_SUBTARGETINFO_HEADER
28 #include "SystemZGenSubtargetInfo.inc"
29 
30 namespace llvm {
31 class GlobalValue;
32 class StringRef;
33 
35  virtual void anchor();
36 protected:
49  bool HasVector;
52 
53 private:
54  Triple TargetTriple;
55  SystemZInstrInfo InstrInfo;
56  SystemZTargetLowering TLInfo;
58  SystemZFrameLowering FrameLowering;
59 
60  SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
61  StringRef FS);
62 public:
63  SystemZSubtarget(const Triple &TT, const std::string &CPU,
64  const std::string &FS, const TargetMachine &TM);
65 
66  const TargetFrameLowering *getFrameLowering() const override {
67  return &FrameLowering;
68  }
69  const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
70  const SystemZRegisterInfo *getRegisterInfo() const override {
71  return &InstrInfo.getRegisterInfo();
72  }
73  const SystemZTargetLowering *getTargetLowering() const override {
74  return &TLInfo;
75  }
76  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
77  return &TSInfo;
78  }
79 
80  // This is important for reducing register pressure in vector code.
81  bool useAA() const override { return true; }
82 
83  // Always enable the early if-conversion pass.
84  bool enableEarlyIfConversion() const override { return true; }
85 
86  // Automatically generated by tblgen.
88 
89  // Return true if the target has the distinct-operands facility.
90  bool hasDistinctOps() const { return HasDistinctOps; }
91 
92  // Return true if the target has the load/store-on-condition facility.
93  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
94 
95  // Return true if the target has the load/store-on-condition facility 2.
96  bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
97 
98  // Return true if the target has the high-word facility.
99  bool hasHighWord() const { return HasHighWord; }
100 
101  // Return true if the target has the floating-point extension facility.
102  bool hasFPExtension() const { return HasFPExtension; }
103 
104  // Return true if the target has the population-count facility.
105  bool hasPopulationCount() const { return HasPopulationCount; }
106 
107  // Return true if the target has the fast-serialization facility.
109 
110  // Return true if the target has interlocked-access facility 1.
112 
113  // Return true if the target has the miscellaneous-extensions facility.
116  }
117 
118  // Return true if the target has the execution-hint facility.
119  bool hasExecutionHint() const { return HasExecutionHint; }
120 
121  // Return true if the target has the load-and-trap facility.
122  bool hasLoadAndTrap() const { return HasLoadAndTrap; }
123 
124  // Return true if the target has the transactional-execution facility.
126 
127  // Return true if the target has the processor-assist facility.
128  bool hasProcessorAssist() const { return HasProcessorAssist; }
129 
130  // Return true if the target has the load-and-zero-rightmost-byte facility.
133  }
134 
135  // Return true if the target has the vector facility.
136  bool hasVector() const { return HasVector; }
137 
138  // Return true if GV can be accessed using LARL for reloc model RM
139  // and code model CM.
140  bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
141 
142  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
143 };
144 } // end namespace llvm
145 
146 #endif
bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const
bool hasInterlockedAccess1() const
bool hasFastSerialization() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
const SystemZRegisterInfo & getRegisterInfo() const
bool hasLoadStoreOnCond() const
bool useAA() const override
bool hasLoadStoreOnCond2() const
bool enableEarlyIfConversion() const override
bool hasExecutionHint() const
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
bool hasLoadAndZeroRightmostByte() const
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:44
const SystemZInstrInfo * getInstrInfo() const override
bool hasPopulationCount() const
const SystemZTargetLowering * getTargetLowering() const override
const TargetFrameLowering * getFrameLowering() const override
Information about stack frame layout on the target.
bool hasMiscellaneousExtensions() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:565
bool hasLoadAndTrap() const
bool hasDistinctOps() const
bool hasProcessorAssist() const
Primary interface to the complete machine description for the target machine.
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:47
bool hasFPExtension() const
bool hasTransactionalExecution() const
const SystemZRegisterInfo * getRegisterInfo() const override
SystemZSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)