Coverage Report

Created: 2019-03-24 22:13

/Users/buildslave/jenkins/workspace/clang-stage2-coverage-R/clang-build/lib/Target/BPF/BPFGenSubtargetInfo.inc
Line
Count
Source (jump to first uncovered line)
1
/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2
|*                                                                            *|
3
|* Subtarget Enumeration Source Fragment                                      *|
4
|*                                                                            *|
5
|* Automatically generated file, do not edit!                                 *|
6
|*                                                                            *|
7
\*===----------------------------------------------------------------------===*/
8
9
10
#ifdef GET_SUBTARGETINFO_ENUM
11
#undef GET_SUBTARGETINFO_ENUM
12
13
namespace llvm {
14
namespace BPF {
15
enum {
16
  ALU32 = 0,
17
  DummyFeature = 1,
18
  DwarfRIS = 2,
19
};
20
} // end namespace BPF
21
} // end namespace llvm
22
23
#endif // GET_SUBTARGETINFO_ENUM
24
25
26
#ifdef GET_SUBTARGETINFO_MC_DESC
27
#undef GET_SUBTARGETINFO_MC_DESC
28
29
namespace llvm {
30
// Sorted (by key) array of values for CPU features.
31
extern const llvm::SubtargetFeatureKV BPFFeatureKV[] = {
32
  { "alu32", "Enable ALU32 instructions", BPF::ALU32, { { { 0x0ULL, 0x0ULL, 0x0ULL, } } } },
33
  { "dummy", "unused feature", BPF::DummyFeature, { { { 0x0ULL, 0x0ULL, 0x0ULL, } } } },
34
  { "dwarfris", "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections", BPF::DwarfRIS, { { { 0x0ULL, 0x0ULL, 0x0ULL, } } } },
35
};
36
37
#ifdef DBGFIELD
38
#error "<target>GenSubtargetInfo.inc requires a DBGFIELD macro"
39
#endif
40
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
41
#define DBGFIELD(x) x,
42
#else
43
#define DBGFIELD(x)
44
#endif
45
46
// ===============================================================
47
// Data tables for the new per-operand machine model.
48
49
// {ProcResourceIdx, Cycles}
50
extern const llvm::MCWriteProcResEntry BPFWriteProcResTable[] = {
51
  { 0,  0}, // Invalid
52
}; // BPFWriteProcResTable
53
54
// {Cycles, WriteResourceID}
55
extern const llvm::MCWriteLatencyEntry BPFWriteLatencyTable[] = {
56
  { 0,  0}, // Invalid
57
}; // BPFWriteLatencyTable
58
59
// {UseIdx, WriteResourceID, Cycles}
60
extern const llvm::MCReadAdvanceEntry BPFReadAdvanceTable[] = {
61
  {0,  0,  0}, // Invalid
62
}; // BPFReadAdvanceTable
63
64
#undef DBGFIELD
65
66
static const llvm::MCSchedModel NoSchedModel = {
67
  MCSchedModel::DefaultIssueWidth,
68
  MCSchedModel::DefaultMicroOpBufferSize,
69
  MCSchedModel::DefaultLoopMicroOpBufferSize,
70
  MCSchedModel::DefaultLoadLatency,
71
  MCSchedModel::DefaultHighLatency,
72
  MCSchedModel::DefaultMispredictPenalty,
73
  false, // PostRAScheduler
74
  false, // CompleteModel
75
  0, // Processor ID
76
  nullptr, nullptr, 0, 0, // No instruction-level machine model.
77
  nullptr, // No Itinerary
78
  nullptr // No extra processor descriptor
79
};
80
81
// Sorted (by key) array of values for CPU subtype.
82
extern const llvm::SubtargetSubTypeKV BPFSubTypeKV[] = {
83
 { "generic", { { { 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel },
84
 { "probe", { { { 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel },
85
 { "v1", { { { 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel },
86
 { "v2", { { { 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel },
87
 { "v3", { { { 0x0ULL, 0x0ULL, 0x0ULL, } } }, &NoSchedModel },
88
};
89
90
namespace BPF_MC {
91
unsigned resolveVariantSchedClassImpl(unsigned SchedClass,
92
0
    const MCInst *MI, unsigned CPUID) {
93
0
  // Don't know how to resolve this scheduling class.
94
0
  return 0;
95
0
}
96
} // end of namespace BPF_MC
97
98
struct BPFGenMCSubtargetInfo : public MCSubtargetInfo {
99
  BPFGenMCSubtargetInfo(const Triple &TT, 
100
    StringRef CPU, StringRef FS, ArrayRef<SubtargetFeatureKV> PF,
101
    ArrayRef<SubtargetSubTypeKV> PD,
102
    const MCWriteProcResEntry *WPR,
103
    const MCWriteLatencyEntry *WL,
104
    const MCReadAdvanceEntry *RA, const InstrStage *IS,
105
    const unsigned *OC, const unsigned *FP) :
106
      MCSubtargetInfo(TT, CPU, FS, PF, PD,
107
199
                      WPR, WL, RA, IS, OC, FP) { }
108
109
  unsigned resolveVariantSchedClass(unsigned SchedClass,
110
0
      const MCInst *MI, unsigned CPUID) const override {
111
0
    return BPF_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID); 
112
0
  }
113
};
114
115
199
static inline MCSubtargetInfo *createBPFMCSubtargetInfoImpl(const Triple &TT, StringRef CPU, StringRef FS) {
116
199
  return new BPFGenMCSubtargetInfo(TT, CPU, FS, BPFFeatureKV, BPFSubTypeKV, 
117
199
                      BPFWriteProcResTable, BPFWriteLatencyTable, BPFReadAdvanceTable, 
118
199
                      nullptr, nullptr, nullptr);
119
199
}
120
121
} // end namespace llvm
122
123
#endif // GET_SUBTARGETINFO_MC_DESC
124
125
126
#ifdef GET_SUBTARGETINFO_TARGET_DESC
127
#undef GET_SUBTARGETINFO_TARGET_DESC
128
129
#include "llvm/Support/Debug.h"
130
#include "llvm/Support/raw_ostream.h"
131
132
// ParseSubtargetFeatures - Parses features string setting specified
133
// subtarget options.
134
180
void llvm::BPFSubtarget::ParseSubtargetFeatures(StringRef CPU, StringRef FS) {
135
180
  LLVM_DEBUG(dbgs() << "\nFeatures:" << FS);
136
180
  LLVM_DEBUG(dbgs() << "\nCPU:" << CPU << "\n\n");
137
180
  InitMCProcessorInfo(CPU, FS);
138
180
  const FeatureBitset& Bits = getFeatureBits();
139
180
  if (Bits[BPF::ALU32]) 
HasAlu32 = true8
;
140
180
  if (Bits[BPF::DummyFeature]) 
isDummyMode = true0
;
141
180
  if (Bits[BPF::DwarfRIS]) 
UseDwarfRIS = true0
;
142
180
}
143
#endif // GET_SUBTARGETINFO_TARGET_DESC
144
145
146
#ifdef GET_SUBTARGETINFO_HEADER
147
#undef GET_SUBTARGETINFO_HEADER
148
149
namespace llvm {
150
class DFAPacketizer;
151
namespace BPF_MC {
152
unsigned resolveVariantSchedClassImpl(unsigned SchedClass, const MCInst *MI, unsigned CPUID);
153
}
154
155
struct BPFGenSubtargetInfo : public TargetSubtargetInfo {
156
  explicit BPFGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS);
157
public:
158
  unsigned resolveSchedClass(unsigned SchedClass,  const MachineInstr *DefMI, const TargetSchedModel *SchedModel) const override;
159
  unsigned resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const override;
160
  DFAPacketizer *createDFAPacketizer(const InstrItineraryData *IID) const;
161
};
162
} // end namespace llvm
163
164
#endif // GET_SUBTARGETINFO_HEADER
165
166
167
#ifdef GET_SUBTARGETINFO_CTOR
168
#undef GET_SUBTARGETINFO_CTOR
169
170
#include "llvm/CodeGen/TargetSchedule.h"
171
172
namespace llvm {
173
extern const llvm::SubtargetFeatureKV BPFFeatureKV[];
174
extern const llvm::SubtargetSubTypeKV BPFSubTypeKV[];
175
extern const llvm::MCWriteProcResEntry BPFWriteProcResTable[];
176
extern const llvm::MCWriteLatencyEntry BPFWriteLatencyTable[];
177
extern const llvm::MCReadAdvanceEntry BPFReadAdvanceTable[];
178
BPFGenSubtargetInfo::BPFGenSubtargetInfo(const Triple &TT, StringRef CPU, StringRef FS)
179
  : TargetSubtargetInfo(TT, CPU, FS, makeArrayRef(BPFFeatureKV, 3), makeArrayRef(BPFSubTypeKV, 5), 
180
                        BPFWriteProcResTable, BPFWriteLatencyTable, BPFReadAdvanceTable, 
181
180
                        nullptr, nullptr, nullptr) {}
182
183
unsigned BPFGenSubtargetInfo
184
0
::resolveSchedClass(unsigned SchedClass, const MachineInstr *MI, const TargetSchedModel *SchedModel) const {
185
0
  report_fatal_error("Expected a variant SchedClass");
186
0
} // BPFGenSubtargetInfo::resolveSchedClass
187
188
unsigned BPFGenSubtargetInfo
189
0
::resolveVariantSchedClass(unsigned SchedClass, const MCInst *MI, unsigned CPUID) const {
190
0
  return BPF_MC::resolveVariantSchedClassImpl(SchedClass, MI, CPUID);
191
0
} // BPFGenSubtargetInfo::resolveVariantSchedClass
192
193
} // end namespace llvm
194
195
#endif // GET_SUBTARGETINFO_CTOR
196
197
198
#ifdef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
199
#undef GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
200
201
#endif // GET_STIPREDICATE_DECLS_FOR_MC_ANALYSIS
202
203
204
#ifdef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
205
#undef GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
206
207
#endif // GET_STIPREDICATE_DEFS_FOR_MC_ANALYSIS
208