Coverage Report

Created: 2018-09-25 17:16

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