Coverage Report

Created: 2019-07-24 05:18

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/llvm/lib/Target/SystemZ/SystemZSubtarget.h
Line
Count
Source (jump to first uncovered line)
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"
20
#include "SystemZSelectionDAGInfo.h"
21
#include "llvm/ADT/Triple.h"
22
#include "llvm/CodeGen/TargetSubtargetInfo.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
33
class SystemZSubtarget : public SystemZGenSubtargetInfo {
34
  virtual void anchor();
35
protected:
36
  bool HasDistinctOps;
37
  bool HasLoadStoreOnCond;
38
  bool HasHighWord;
39
  bool HasFPExtension;
40
  bool HasPopulationCount;
41
  bool HasMessageSecurityAssist3;
42
  bool HasMessageSecurityAssist4;
43
  bool HasResetReferenceBitsMultiple;
44
  bool HasFastSerialization;
45
  bool HasInterlockedAccess1;
46
  bool HasMiscellaneousExtensions;
47
  bool HasExecutionHint;
48
  bool HasLoadAndTrap;
49
  bool HasTransactionalExecution;
50
  bool HasProcessorAssist;
51
  bool HasDFPZonedConversion;
52
  bool HasEnhancedDAT2;
53
  bool HasVector;
54
  bool HasLoadStoreOnCond2;
55
  bool HasLoadAndZeroRightmostByte;
56
  bool HasMessageSecurityAssist5;
57
  bool HasDFPPackedConversion;
58
  bool HasMiscellaneousExtensions2;
59
  bool HasGuardedStorage;
60
  bool HasMessageSecurityAssist7;
61
  bool HasMessageSecurityAssist8;
62
  bool HasVectorEnhancements1;
63
  bool HasVectorPackedDecimal;
64
  bool HasInsertReferenceBitsMultiple;
65
  bool HasMiscellaneousExtensions3;
66
  bool HasMessageSecurityAssist9;
67
  bool HasVectorEnhancements2;
68
  bool HasVectorPackedDecimalEnhancement;
69
  bool HasEnhancedSort;
70
  bool HasDeflateConversion;
71
72
private:
73
  Triple TargetTriple;
74
  SystemZInstrInfo InstrInfo;
75
  SystemZTargetLowering TLInfo;
76
  SystemZSelectionDAGInfo TSInfo;
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
211k
  const TargetFrameLowering *getFrameLowering() const override {
86
211k
    return &FrameLowering;
87
211k
  }
88
628k
  const SystemZInstrInfo *getInstrInfo() const override { return &InstrInfo; }
89
1.54M
  const SystemZRegisterInfo *getRegisterInfo() const override {
90
1.54M
    return &InstrInfo.getRegisterInfo();
91
1.54M
  }
92
420k
  const SystemZTargetLowering *getTargetLowering() const override {
93
420k
    return &TLInfo;
94
420k
  }
95
8.12k
  const SelectionDAGTargetInfo *getSelectionDAGInfo() const override {
96
8.12k
    return &TSInfo;
97
8.12k
  }
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
25.6k
  bool enableMachineScheduler() const override { return true; }
103
104
  // This is important for reducing register pressure in vector code.
105
15.3k
  bool useAA() const override { return true; }
106
107
  // Always enable the early if-conversion pass.
108
8.09k
  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.
114
  void ParseSubtargetFeatures(StringRef CPU, StringRef FS);
115
116
  // Return true if the target has the distinct-operands facility.
117
2.42k
  bool hasDistinctOps() const { return HasDistinctOps; }
118
119
  // Return true if the target has the load/store-on-condition facility.
120
1.06k
  bool hasLoadStoreOnCond() const { return HasLoadStoreOnCond; }
121
122
  // Return true if the target has the load/store-on-condition facility 2.
123
11.5k
  bool hasLoadStoreOnCond2() const { return HasLoadStoreOnCond2; }
124
125
  // Return true if the target has the high-word facility.
126
6.38k
  bool hasHighWord() const { return HasHighWord; }
127
128
  // Return true if the target has the floating-point extension facility.
129
9.98k
  bool hasFPExtension() const { return HasFPExtension; }
130
131
  // Return true if the target has the population-count facility.
132
2.20k
  bool hasPopulationCount() const { return HasPopulationCount; }
133
134
  // Return true if the target has the message-security-assist
135
  // extension facility 3.
136
0
  bool hasMessageSecurityAssist3() const { return HasMessageSecurityAssist3; }
137
138
  // Return true if the target has the message-security-assist
139
  // extension facility 4.
140
0
  bool hasMessageSecurityAssist4() const { return HasMessageSecurityAssist4; }
141
142
  // Return true if the target has the reset-reference-bits-multiple facility.
143
0
  bool hasResetReferenceBitsMultiple() const {
144
0
    return HasResetReferenceBitsMultiple;
145
0
  }
146
147
  // Return true if the target has the fast-serialization facility.
148
9
  bool hasFastSerialization() const { return HasFastSerialization; }
149
150
  // Return true if the target has interlocked-access facility 1.
151
208
  bool hasInterlockedAccess1() const { return HasInterlockedAccess1; }
152
153
  // Return true if the target has the miscellaneous-extensions facility.
154
940
  bool hasMiscellaneousExtensions() const {
155
940
    return HasMiscellaneousExtensions;
156
940
  }
157
158
  // Return true if the target has the execution-hint facility.
159
0
  bool hasExecutionHint() const { return HasExecutionHint; }
160
161
  // Return true if the target has the load-and-trap facility.
162
141
  bool hasLoadAndTrap() const { return HasLoadAndTrap; }
163
164
  // Return true if the target has the transactional-execution facility.
165
26
  bool hasTransactionalExecution() const { return HasTransactionalExecution; }
166
167
  // Return true if the target has the processor-assist facility.
168
1
  bool hasProcessorAssist() const { return HasProcessorAssist; }
169
170
  // Return true if the target has the DFP zoned-conversion facility.
171
0
  bool hasDFPZonedConversion() const { return HasDFPZonedConversion; }
172
173
  // Return true if the target has the enhanced-DAT facility 2.
174
0
  bool hasEnhancedDAT2() const { return HasEnhancedDAT2; }
175
176
  // Return true if the target has the load-and-zero-rightmost-byte facility.
177
30
  bool hasLoadAndZeroRightmostByte() const {
178
30
    return HasLoadAndZeroRightmostByte;
179
30
  }
180
181
  // Return true if the target has the message-security-assist
182
  // extension facility 5.
183
0
  bool hasMessageSecurityAssist5() const { return HasMessageSecurityAssist5; }
184
185
  // Return true if the target has the DFP packed-conversion facility.
186
0
  bool hasDFPPackedConversion() const { return HasDFPPackedConversion; }
187
188
  // Return true if the target has the vector facility.
189
63.6k
  bool hasVector() const { return HasVector; }
190
191
  // Return true if the target has the miscellaneous-extensions facility 2.
192
241
  bool hasMiscellaneousExtensions2() const {
193
241
    return HasMiscellaneousExtensions2;
194
241
  }
195
196
  // Return true if the target has the guarded-storage facility.
197
0
  bool hasGuardedStorage() const { return HasGuardedStorage; }
198
199
  // Return true if the target has the message-security-assist
200
  // extension facility 7.
201
0
  bool hasMessageSecurityAssist7() const { return HasMessageSecurityAssist7; }
202
203
  // Return true if the target has the message-security-assist
204
  // extension facility 8.
205
0
  bool hasMessageSecurityAssist8() const { return HasMessageSecurityAssist8; }
206
207
  // Return true if the target has the vector-enhancements facility 1.
208
9.37k
  bool hasVectorEnhancements1() const { return HasVectorEnhancements1; }
209
210
  // Return true if the target has the vector-packed-decimal facility.
211
20
  bool hasVectorPackedDecimal() const { return HasVectorPackedDecimal; }
212
213
  // Return true if the target has the insert-reference-bits-multiple facility.
214
0
  bool hasInsertReferenceBitsMultiple() const {
215
0
    return HasInsertReferenceBitsMultiple;
216
0
  }
217
218
  // Return true if the target has the miscellaneous-extensions facility 3.
219
1.95k
  bool hasMiscellaneousExtensions3() const {
220
1.95k
    return HasMiscellaneousExtensions3;
221
1.95k
  }
222
223
  // Return true if the target has the message-security-assist
224
  // extension facility 9.
225
0
  bool hasMessageSecurityAssist9() const { return HasMessageSecurityAssist9; }
226
227
  // Return true if the target has the vector-enhancements facility 2.
228
3.11k
  bool hasVectorEnhancements2() const { return HasVectorEnhancements2; }
229
230
  // Return true if the target has the vector-packed-decimal
231
  // enhancement facility.
232
0
  bool hasVectorPackedDecimalEnhancement() const {
233
0
    return HasVectorPackedDecimalEnhancement;
234
0
  }
235
236
  // Return true if the target has the enhanced-sort facility.
237
0
  bool hasEnhancedSort() const { return HasEnhancedSort; }
238
239
  // Return true if the target has the deflate-conversion facility.
240
0
  bool hasDeflateConversion() const { return HasDeflateConversion; }
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
0
  bool isTargetELF() const { return TargetTriple.isOSBinFormatELF(); }
247
};
248
} // end namespace llvm
249
250
#endif