LLVM  9.0.0svn
SystemZSubtarget.h
Go to the documentation of this file.
1 //===-- SystemZSubtarget.h - SystemZ subtarget information -----*- C++ -*--===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 //
9 // This file declares the SystemZ specific subclass of TargetSubtargetInfo.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
14 #define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZSUBTARGET_H
15 
16 #include "SystemZFrameLowering.h"
17 #include "SystemZISelLowering.h"
18 #include "SystemZInstrInfo.h"
19 #include "SystemZRegisterInfo.h"
21 #include "llvm/ADT/Triple.h"
23 #include "llvm/IR/DataLayout.h"
24 #include <string>
25 
26 #define GET_SUBTARGETINFO_HEADER
27 #include "SystemZGenSubtargetInfo.inc"
28 
29 namespace llvm {
30 class GlobalValue;
31 class StringRef;
32 
34  virtual void anchor();
35 protected:
53  bool HasVector;
71 
72 private:
73  Triple TargetTriple;
74  SystemZInstrInfo InstrInfo;
75  SystemZTargetLowering TLInfo;
77  SystemZFrameLowering FrameLowering;
78 
79  SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
80  StringRef FS);
81 public:
82  SystemZSubtarget(const Triple &TT, const std::string &CPU,
83  const std::string &FS, const TargetMachine &TM);
84 
85  const TargetFrameLowering *getFrameLowering() const override {
86  return &FrameLowering;
87  }
88  const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
89  const SystemZRegisterInfo *getRegisterInfo() const override {
90  return &InstrInfo.getRegisterInfo();
91  }
92  const SystemZTargetLowering *getTargetLowering() const override {
93  return &TLInfo;
94  }
95  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
96  return &TSInfo;
97  }
98 
99  // True if the subtarget should run MachineScheduler after aggressive
100  // coalescing. This currently replaces the SelectionDAG scheduler with the
101  // "source" order scheduler.
102  bool enableMachineScheduler() const override { return true; }
103 
104  // This is important for reducing register pressure in vector code.
105  bool useAA() const override { return true; }
106 
107  // Always enable the early if-conversion pass.
108  bool enableEarlyIfConversion() const override { return true; }
109 
110  // Enable tracking of subregister liveness in register allocator.
111  bool enableSubRegLiveness() const override;
112 
113  // Automatically generated by tblgen.
115 
116  // Return true if the target has the distinct-operands facility.
117  bool hasDistinctOps() const { return HasDistinctOps; }
118 
119  // Return true if the target has the load/store-on-condition facility.
120  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
121 
122  // Return true if the target has the load/store-on-condition facility 2.
123  bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
124 
125  // Return true if the target has the high-word facility.
126  bool hasHighWord() const { return HasHighWord; }
127 
128  // Return true if the target has the floating-point extension facility.
129  bool hasFPExtension() const { return HasFPExtension; }
130 
131  // Return true if the target has the population-count facility.
132  bool hasPopulationCount() const { return HasPopulationCount; }
133 
134  // Return true if the target has the message-security-assist
135  // extension facility 3.
137 
138  // Return true if the target has the message-security-assist
139  // extension facility 4.
141 
142  // Return true if the target has the reset-reference-bits-multiple facility.
145  }
146 
147  // Return true if the target has the fast-serialization facility.
149 
150  // Return true if the target has interlocked-access facility 1.
152 
153  // Return true if the target has the miscellaneous-extensions facility.
156  }
157 
158  // Return true if the target has the execution-hint facility.
159  bool hasExecutionHint() const { return HasExecutionHint; }
160 
161  // Return true if the target has the load-and-trap facility.
162  bool hasLoadAndTrap() const { return HasLoadAndTrap; }
163 
164  // Return true if the target has the transactional-execution facility.
166 
167  // Return true if the target has the processor-assist facility.
168  bool hasProcessorAssist() const { return HasProcessorAssist; }
169 
170  // Return true if the target has the DFP zoned-conversion facility.
172 
173  // Return true if the target has the enhanced-DAT facility 2.
174  bool hasEnhancedDAT2() const { return HasEnhancedDAT2; }
175 
176  // Return true if the target has the load-and-zero-rightmost-byte facility.
179  }
180 
181  // Return true if the target has the message-security-assist
182  // extension facility 5.
184 
185  // Return true if the target has the DFP packed-conversion facility.
187 
188  // Return true if the target has the vector facility.
189  bool hasVector() const { return HasVector; }
190 
191  // Return true if the target has the miscellaneous-extensions facility 2.
194  }
195 
196  // Return true if the target has the guarded-storage facility.
197  bool hasGuardedStorage() const { return HasGuardedStorage; }
198 
199  // Return true if the target has the message-security-assist
200  // extension facility 7.
202 
203  // Return true if the target has the message-security-assist
204  // extension facility 8.
206 
207  // Return true if the target has the vector-enhancements facility 1.
209 
210  // Return true if the target has the vector-packed-decimal facility.
212 
213  // Return true if the target has the insert-reference-bits-multiple facility.
216  }
217 
218  // Return true if the target has the miscellaneous-extensions facility 3.
221  }
222 
223  // Return true if the target has the message-security-assist
224  // extension facility 9.
226 
227  // Return true if the target has the vector-enhancements facility 2.
229 
230  // Return true if the target has the vector-packed-decimal
231  // enhancement facility.
234  }
235 
236  // Return true if the target has the enhanced-sort facility.
237  bool hasEnhancedSort() const { return HasEnhancedSort; }
238 
239  // Return true if the target has the deflate-conversion facility.
241 
242  // Return true if GV can be accessed using LARL for reloc model RM
243  // and code model CM.
244  bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
245 
246  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
247 };
248 } // end namespace llvm
249 
250 #endif
const SystemZRegisterInfo & getRegisterInfo() const
This class represents lattice values for constants.
Definition: AllocatorList.h:23
bool hasResetReferenceBitsMultiple() const
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:623
bool hasFastSerialization() const
bool hasDeflateConversion() const
bool hasLoadStoreOnCond() const
void ParseSubtargetFeatures(StringRef CPU, StringRef FS)
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
bool useAA() const override
bool hasGuardedStorage() const
bool hasMiscellaneousExtensions2() const
bool hasMessageSecurityAssist9() const
bool hasMiscellaneousExtensions() const
bool hasInterlockedAccess1() const
bool enableMachineScheduler() const override
bool hasMiscellaneousExtensions3() const
bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const
bool enableSubRegLiveness() const override
bool hasMessageSecurityAssist7() const
bool enableEarlyIfConversion() const override
bool hasDFPPackedConversion() const
bool hasVectorPackedDecimalEnhancement() const
bool hasVectorEnhancements2() const
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
bool hasVectorEnhancements1() const
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:43
const SystemZInstrInfo * getInstrInfo() const override
bool hasVectorPackedDecimal() const
const SystemZTargetLowering * getTargetLowering() const override
const TargetFrameLowering * getFrameLowering() const override
Information about stack frame layout on the target.
bool hasMessageSecurityAssist4() const
bool hasDFPZonedConversion() const
bool hasMessageSecurityAssist8() const
bool hasProcessorAssist() const
bool hasTransactionalExecution() const
bool hasInsertReferenceBitsMultiple() const
bool hasMessageSecurityAssist3() const
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:65
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
bool hasLoadAndZeroRightmostByte() const
bool hasMessageSecurityAssist5() const
bool hasLoadStoreOnCond2() const
bool hasPopulationCount() const
const SystemZRegisterInfo * getRegisterInfo() const override
SystemZSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)