LLVM  13.0.0git
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;
72 
73 private:
74  Triple TargetTriple;
75  SystemZInstrInfo InstrInfo;
76  SystemZTargetLowering TLInfo;
78  SystemZFrameLowering FrameLowering;
79 
80  SystemZSubtarget &initializeSubtargetDependencies(StringRef CPU,
81  StringRef FS);
82 public:
83  SystemZSubtarget(const Triple &TT, const std::string &CPU,
84  const std::string &FS, const TargetMachine &TM);
85 
86  const TargetFrameLowering *getFrameLowering() const override {
87  return &FrameLowering;
88  }
89  const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
90  const SystemZRegisterInfo *getRegisterInfo() const override {
91  return &InstrInfo.getRegisterInfo();
92  }
93  const SystemZTargetLowering *getTargetLowering() const override {
94  return &TLInfo;
95  }
96  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
97  return &TSInfo;
98  }
99 
100  // True if the subtarget should run MachineScheduler after aggressive
101  // coalescing. This currently replaces the SelectionDAG scheduler with the
102  // "source" order scheduler.
103  bool enableMachineScheduler() const override { return true; }
104 
105  // This is important for reducing register pressure in vector code.
106  bool useAA() const override { return true; }
107 
108  // Always enable the early if-conversion pass.
109  bool enableEarlyIfConversion() const override { return true; }
110 
111  // Enable tracking of subregister liveness in register allocator.
112  bool enableSubRegLiveness() const override;
113 
114  // Automatically generated by tblgen.
116 
117  // Return true if the target has the distinct-operands facility.
118  bool hasDistinctOps() const { return HasDistinctOps; }
119 
120  // Return true if the target has the load/store-on-condition facility.
121  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
122 
123  // Return true if the target has the load/store-on-condition facility 2.
124  bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
125 
126  // Return true if the target has the high-word facility.
127  bool hasHighWord() const { return HasHighWord; }
128 
129  // Return true if the target has the floating-point extension facility.
130  bool hasFPExtension() const { return HasFPExtension; }
131 
132  // Return true if the target has the population-count facility.
133  bool hasPopulationCount() const { return HasPopulationCount; }
134 
135  // Return true if the target has the message-security-assist
136  // extension facility 3.
138 
139  // Return true if the target has the message-security-assist
140  // extension facility 4.
142 
143  // Return true if the target has the reset-reference-bits-multiple facility.
146  }
147 
148  // Return true if the target has the fast-serialization facility.
150 
151  // Return true if the target has interlocked-access facility 1.
153 
154  // Return true if the target has the miscellaneous-extensions facility.
157  }
158 
159  // Return true if the target has the execution-hint facility.
160  bool hasExecutionHint() const { return HasExecutionHint; }
161 
162  // Return true if the target has the load-and-trap facility.
163  bool hasLoadAndTrap() const { return HasLoadAndTrap; }
164 
165  // Return true if the target has the transactional-execution facility.
167 
168  // Return true if the target has the processor-assist facility.
169  bool hasProcessorAssist() const { return HasProcessorAssist; }
170 
171  // Return true if the target has the DFP zoned-conversion facility.
173 
174  // Return true if the target has the enhanced-DAT facility 2.
175  bool hasEnhancedDAT2() const { return HasEnhancedDAT2; }
176 
177  // Return true if the target has the load-and-zero-rightmost-byte facility.
180  }
181 
182  // Return true if the target has the message-security-assist
183  // extension facility 5.
185 
186  // Return true if the target has the DFP packed-conversion facility.
188 
189  // Return true if the target has the vector facility.
190  bool hasVector() const { return HasVector; }
191 
192  // Return true if the target has the miscellaneous-extensions facility 2.
195  }
196 
197  // Return true if the target has the guarded-storage facility.
198  bool hasGuardedStorage() const { return HasGuardedStorage; }
199 
200  // Return true if the target has the message-security-assist
201  // extension facility 7.
203 
204  // Return true if the target has the message-security-assist
205  // extension facility 8.
207 
208  // Return true if the target has the vector-enhancements facility 1.
210 
211  // Return true if the target has the vector-packed-decimal facility.
213 
214  // Return true if the target has the insert-reference-bits-multiple facility.
217  }
218 
219  // Return true if the target has the miscellaneous-extensions facility 3.
222  }
223 
224  // Return true if the target has the message-security-assist
225  // extension facility 9.
227 
228  // Return true if the target has the vector-enhancements facility 2.
230 
231  // Return true if the target has the vector-packed-decimal
232  // enhancement facility.
235  }
236 
237  // Return true if the target has the enhanced-sort facility.
238  bool hasEnhancedSort() const { return HasEnhancedSort; }
239 
240  // Return true if the target has the deflate-conversion facility.
242 
243  // Return true if soft float should be used.
244  bool hasSoftFloat() const { return HasSoftFloat; }
245 
246  // Return true if GV can be accessed using LARL for reloc model RM
247  // and code model CM.
248  bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const;
249 
250  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
251 
252  // Returns TRUE if we are generating GOFF object code
253  bool isTargetGOFF() const { return TargetTriple.isOSBinFormatGOFF(); }
254 
255  // Returns TRUE if we are using XPLINK64 linkage convention
256  bool isTargetXPLINK64() const { return (isTargetGOFF() && isTargetzOS()); }
257 
258  // Returns TRUE if we are generating code for a s390x machine running zOS
259  bool isTargetzOS() const { return TargetTriple.isOSzOS(); }
260 };
261 } // end namespace llvm
262 
263 #endif
llvm::SystemZSubtarget::hasMessageSecurityAssist8
bool hasMessageSecurityAssist8() const
Definition: SystemZSubtarget.h:206
llvm::SystemZSubtarget::isPC32DBLSymbol
bool isPC32DBLSymbol(const GlobalValue *GV, CodeModel::Model CM) const
Definition: SystemZSubtarget.cpp:83
llvm::SystemZSubtarget::hasMiscellaneousExtensions
bool hasMiscellaneousExtensions() const
Definition: SystemZSubtarget.h:155
llvm::SystemZSubtarget::getTargetLowering
const SystemZTargetLowering * getTargetLowering() const override
Definition: SystemZSubtarget.h:93
llvm::SystemZSubtarget::getSelectionDAGInfo
const SelectionDAGTargetInfo * getSelectionDAGInfo() const override
Definition: SystemZSubtarget.h:96
llvm::SystemZSubtarget::hasVectorPackedDecimalEnhancement
bool hasVectorPackedDecimalEnhancement() const
Definition: SystemZSubtarget.h:233
llvm::SystemZSubtarget::hasLoadStoreOnCond2
bool hasLoadStoreOnCond2() const
Definition: SystemZSubtarget.h:124
llvm
This class represents lattice values for constants.
Definition: AllocatorList.h:23
llvm::SystemZSubtarget::hasMessageSecurityAssist7
bool hasMessageSecurityAssist7() const
Definition: SystemZSubtarget.h:202
llvm::SystemZISD::TM
@ TM
Definition: SystemZISelLowering.h:65
llvm::SystemZSubtarget::ParseSubtargetFeatures
void ParseSubtargetFeatures(StringRef CPU, StringRef TuneCPU, StringRef FS)
llvm::SystemZSubtarget::HasMiscellaneousExtensions2
bool HasMiscellaneousExtensions2
Definition: SystemZSubtarget.h:58
llvm::TargetFrameLowering
Information about stack frame layout on the target.
Definition: TargetFrameLowering.h:42
llvm::SystemZSubtarget::hasInsertReferenceBitsMultiple
bool hasInsertReferenceBitsMultiple() const
Definition: SystemZSubtarget.h:215
llvm::SystemZSubtarget::HasDFPPackedConversion
bool HasDFPPackedConversion
Definition: SystemZSubtarget.h:57
llvm::SystemZSubtarget::hasVector
bool hasVector() const
Definition: SystemZSubtarget.h:190
llvm::SystemZSubtarget::hasTransactionalExecution
bool hasTransactionalExecution() const
Definition: SystemZSubtarget.h:166
llvm::SystemZTargetLowering
Definition: SystemZISelLowering.h:392
llvm::SystemZSubtarget::enableEarlyIfConversion
bool enableEarlyIfConversion() const override
Definition: SystemZSubtarget.h:109
llvm::SystemZSubtarget::hasLoadAndTrap
bool hasLoadAndTrap() const
Definition: SystemZSubtarget.h:163
llvm::Triple
Triple - Helper class for working with autoconf configuration names.
Definition: Triple.h:45
llvm::SystemZSubtarget::HasVectorEnhancements1
bool HasVectorEnhancements1
Definition: SystemZSubtarget.h:62
llvm::SystemZSubtarget::HasTransactionalExecution
bool HasTransactionalExecution
Definition: SystemZSubtarget.h:49
SystemZSelectionDAGInfo.h
llvm::SystemZInstrInfo
Definition: SystemZInstrInfo.h:174
llvm::SystemZSubtarget::HasMessageSecurityAssist8
bool HasMessageSecurityAssist8
Definition: SystemZSubtarget.h:61
llvm::SystemZSubtarget::isTargetXPLINK64
bool isTargetXPLINK64() const
Definition: SystemZSubtarget.h:256
llvm::SystemZSubtarget::HasFPExtension
bool HasFPExtension
Definition: SystemZSubtarget.h:39
llvm::X86AS::FS
@ FS
Definition: X86.h:182
llvm::SystemZSubtarget::HasLoadStoreOnCond
bool HasLoadStoreOnCond
Definition: SystemZSubtarget.h:37
llvm::SystemZSubtarget::HasEnhancedSort
bool HasEnhancedSort
Definition: SystemZSubtarget.h:69
llvm::SystemZSubtarget::hasVectorPackedDecimal
bool hasVectorPackedDecimal() const
Definition: SystemZSubtarget.h:212
llvm::SystemZSubtarget::HasGuardedStorage
bool HasGuardedStorage
Definition: SystemZSubtarget.h:59
llvm::SystemZSubtarget::hasMessageSecurityAssist4
bool hasMessageSecurityAssist4() const
Definition: SystemZSubtarget.h:141
llvm::SystemZSubtarget::HasMessageSecurityAssist5
bool HasMessageSecurityAssist5
Definition: SystemZSubtarget.h:56
llvm::Triple::isOSBinFormatELF
bool isOSBinFormatELF() const
Tests whether the OS uses the ELF binary format.
Definition: Triple.h:630
llvm::SystemZSubtarget::HasFastSerialization
bool HasFastSerialization
Definition: SystemZSubtarget.h:44
llvm::SystemZSubtarget::hasMiscellaneousExtensions3
bool hasMiscellaneousExtensions3() const
Definition: SystemZSubtarget.h:220
llvm::SystemZSubtarget::isTargetzOS
bool isTargetzOS() const
Definition: SystemZSubtarget.h:259
llvm::SystemZSubtarget::hasEnhancedSort
bool hasEnhancedSort() const
Definition: SystemZSubtarget.h:238
SystemZInstrInfo.h
llvm::SystemZSubtarget::hasFPExtension
bool hasFPExtension() const
Definition: SystemZSubtarget.h:130
llvm::SystemZSubtarget::HasLoadAndTrap
bool HasLoadAndTrap
Definition: SystemZSubtarget.h:48
llvm::SystemZSubtarget::getRegisterInfo
const SystemZRegisterInfo * getRegisterInfo() const override
Definition: SystemZSubtarget.h:90
llvm::SystemZSubtarget::hasSoftFloat
bool hasSoftFloat() const
Definition: SystemZSubtarget.h:244
llvm::SystemZSubtarget::HasPopulationCount
bool HasPopulationCount
Definition: SystemZSubtarget.h:40
llvm::SelectionDAGTargetInfo
Targets can subclass this to parameterize the SelectionDAG lowering and instruction selection process...
Definition: SelectionDAGTargetInfo.h:31
llvm::SystemZSubtarget::hasMessageSecurityAssist9
bool hasMessageSecurityAssist9() const
Definition: SystemZSubtarget.h:226
llvm::SystemZSubtarget::HasHighWord
bool HasHighWord
Definition: SystemZSubtarget.h:38
llvm::SystemZSubtarget::hasLoadAndZeroRightmostByte
bool hasLoadAndZeroRightmostByte() const
Definition: SystemZSubtarget.h:178
llvm::Triple::isOSzOS
bool isOSzOS() const
Definition: Triple.h:479
llvm::SystemZSubtarget::HasVectorEnhancements2
bool HasVectorEnhancements2
Definition: SystemZSubtarget.h:67
llvm::Triple::isOSBinFormatGOFF
bool isOSBinFormatGOFF() const
Tests whether the OS uses the GOFF binary format.
Definition: Triple.h:640
llvm::SystemZSubtarget::hasProcessorAssist
bool hasProcessorAssist() const
Definition: SystemZSubtarget.h:169
llvm::SystemZSubtarget::isTargetELF
bool isTargetELF() const
Definition: SystemZSubtarget.h:250
llvm::SystemZSubtarget::hasVectorEnhancements2
bool hasVectorEnhancements2() const
Definition: SystemZSubtarget.h:229
llvm::SystemZSubtarget::hasResetReferenceBitsMultiple
bool hasResetReferenceBitsMultiple() const
Definition: SystemZSubtarget.h:144
llvm::CodeModel::Model
Model
Definition: CodeGen.h:28
llvm::SystemZSubtarget::HasMessageSecurityAssist7
bool HasMessageSecurityAssist7
Definition: SystemZSubtarget.h:60
llvm::GlobalValue
Definition: GlobalValue.h:44
llvm::SystemZSubtarget::hasInterlockedAccess1
bool hasInterlockedAccess1() const
Definition: SystemZSubtarget.h:152
llvm::SystemZSubtarget::HasMessageSecurityAssist4
bool HasMessageSecurityAssist4
Definition: SystemZSubtarget.h:42
llvm::SystemZSubtarget::HasVector
bool HasVector
Definition: SystemZSubtarget.h:53
SystemZGenSubtargetInfo
llvm::SystemZSubtarget::HasMiscellaneousExtensions
bool HasMiscellaneousExtensions
Definition: SystemZSubtarget.h:46
llvm::SystemZSubtarget::hasDFPPackedConversion
bool hasDFPPackedConversion() const
Definition: SystemZSubtarget.h:187
llvm::TargetMachine
Primary interface to the complete machine description for the target machine.
Definition: TargetMachine.h:77
llvm::SystemZSubtarget::hasEnhancedDAT2
bool hasEnhancedDAT2() const
Definition: SystemZSubtarget.h:175
llvm::SystemZSubtarget::isTargetGOFF
bool isTargetGOFF() const
Definition: SystemZSubtarget.h:253
llvm::SystemZSubtarget::hasVectorEnhancements1
bool hasVectorEnhancements1() const
Definition: SystemZSubtarget.h:209
llvm::SystemZSubtarget::hasDeflateConversion
bool hasDeflateConversion() const
Definition: SystemZSubtarget.h:241
llvm::SystemZSubtarget::HasEnhancedDAT2
bool HasEnhancedDAT2
Definition: SystemZSubtarget.h:52
llvm::SystemZSubtarget
Definition: SystemZSubtarget.h:33
llvm::SystemZSubtarget::HasDFPZonedConversion
bool HasDFPZonedConversion
Definition: SystemZSubtarget.h:51
llvm::SystemZSubtarget::HasLoadStoreOnCond2
bool HasLoadStoreOnCond2
Definition: SystemZSubtarget.h:54
llvm::SystemZSubtarget::HasMessageSecurityAssist3
bool HasMessageSecurityAssist3
Definition: SystemZSubtarget.h:41
Triple.h
llvm::SystemZSubtarget::hasFastSerialization
bool hasFastSerialization() const
Definition: SystemZSubtarget.h:149
DataLayout.h
llvm::SystemZSubtarget::hasMessageSecurityAssist3
bool hasMessageSecurityAssist3() const
Definition: SystemZSubtarget.h:137
llvm::StringRef
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:57
llvm::SystemZSubtarget::HasExecutionHint
bool HasExecutionHint
Definition: SystemZSubtarget.h:47
TargetSubtargetInfo.h
llvm::SystemZSubtarget::HasInterlockedAccess1
bool HasInterlockedAccess1
Definition: SystemZSubtarget.h:45
llvm::SystemZSubtarget::hasDFPZonedConversion
bool hasDFPZonedConversion() const
Definition: SystemZSubtarget.h:172
llvm::SystemZSubtarget::HasDeflateConversion
bool HasDeflateConversion
Definition: SystemZSubtarget.h:70
llvm::SystemZSubtarget::HasDistinctOps
bool HasDistinctOps
Definition: SystemZSubtarget.h:36
llvm::SystemZSubtarget::enableSubRegLiveness
bool enableSubRegLiveness() const override
Definition: SystemZSubtarget.cpp:79
llvm::SystemZSubtarget::hasLoadStoreOnCond
bool hasLoadStoreOnCond() const
Definition: SystemZSubtarget.h:121
llvm::SystemZSubtarget::hasDistinctOps
bool hasDistinctOps() const
Definition: SystemZSubtarget.h:118
llvm::SystemZSubtarget::hasPopulationCount
bool hasPopulationCount() const
Definition: SystemZSubtarget.h:133
llvm::SystemZInstrInfo::getRegisterInfo
const SystemZRegisterInfo & getRegisterInfo() const
Definition: SystemZInstrInfo.h:291
llvm::SystemZSubtarget::hasMiscellaneousExtensions2
bool hasMiscellaneousExtensions2() const
Definition: SystemZSubtarget.h:193
llvm::SystemZSubtarget::hasGuardedStorage
bool hasGuardedStorage() const
Definition: SystemZSubtarget.h:198
llvm::SystemZSubtarget::HasMessageSecurityAssist9
bool HasMessageSecurityAssist9
Definition: SystemZSubtarget.h:66
llvm::SystemZSubtarget::getInstrInfo
const SystemZInstrInfo * getInstrInfo() const override
Definition: SystemZSubtarget.h:89
llvm::SystemZSubtarget::HasProcessorAssist
bool HasProcessorAssist
Definition: SystemZSubtarget.h:50
llvm::SystemZSubtarget::HasMiscellaneousExtensions3
bool HasMiscellaneousExtensions3
Definition: SystemZSubtarget.h:65
llvm::SystemZSubtarget::enableMachineScheduler
bool enableMachineScheduler() const override
Definition: SystemZSubtarget.h:103
SystemZFrameLowering.h
SystemZISelLowering.h
llvm::SystemZFrameLowering
Definition: SystemZFrameLowering.h:21
llvm::SystemZSubtarget::hasHighWord
bool hasHighWord() const
Definition: SystemZSubtarget.h:127
llvm::SystemZSubtarget::HasSoftFloat
bool HasSoftFloat
Definition: SystemZSubtarget.h:71
llvm::SystemZSubtarget::hasMessageSecurityAssist5
bool hasMessageSecurityAssist5() const
Definition: SystemZSubtarget.h:184
SystemZRegisterInfo.h
llvm::SystemZSubtarget::HasResetReferenceBitsMultiple
bool HasResetReferenceBitsMultiple
Definition: SystemZSubtarget.h:43
llvm::SystemZRegisterInfo
Definition: SystemZRegisterInfo.h:42
llvm::SystemZSelectionDAGInfo
Definition: SystemZSelectionDAGInfo.h:22
llvm::SystemZSubtarget::HasInsertReferenceBitsMultiple
bool HasInsertReferenceBitsMultiple
Definition: SystemZSubtarget.h:64
llvm::SystemZSubtarget::hasExecutionHint
bool hasExecutionHint() const
Definition: SystemZSubtarget.h:160
llvm::SystemZSubtarget::useAA
bool useAA() const override
Definition: SystemZSubtarget.h:106
llvm::SystemZSubtarget::HasVectorPackedDecimal
bool HasVectorPackedDecimal
Definition: SystemZSubtarget.h:63
llvm::SystemZSubtarget::HasVectorPackedDecimalEnhancement
bool HasVectorPackedDecimalEnhancement
Definition: SystemZSubtarget.h:68
llvm::SystemZSubtarget::getFrameLowering
const TargetFrameLowering * getFrameLowering() const override
Definition: SystemZSubtarget.h:86
llvm::SystemZSubtarget::SystemZSubtarget
SystemZSubtarget(const Triple &TT, const std::string &CPU, const std::string &FS, const TargetMachine &TM)
Definition: SystemZSubtarget.cpp:53
llvm::SystemZSubtarget::HasLoadAndZeroRightmostByte
bool HasLoadAndZeroRightmostByte
Definition: SystemZSubtarget.h:55