1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* Option Parsing Definitions *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9/////////
10// Tables
11
12#if defined(OPTTABLE_CODE) || defined(OPTIONS_STRUCT_DEFS)
13namespace {
14enum ID : unsigned {
15 OPT_INVALID = 0,
16 OPT_INPUT,
17 OPT_UNKNOWN,
18 OPT_riscv_br_merging_base_cost,
19 OPT_riscv_br_merging_likely_bias,
20 OPT_riscv_br_merging_unlikely_bias,
21 OPT_riscv_constant_pool_for_large_ints,
22 OPT_riscv_cost_per_use,
23 OPT_riscv_enable_cfi_instr_inserter,
24 OPT_riscv_enable_copy_propagation,
25 OPT_riscv_enable_copyelim,
26 OPT_riscv_enable_dead_defs,
27 OPT_riscv_enable_global_merge,
28 OPT_riscv_enable_loop_data_prefetch,
29 OPT_riscv_enable_machine_combiner,
30 OPT_riscv_enable_pipeliner,
31 OPT_riscv_enable_sink_fold,
32 OPT_riscv_force_machine_combiner_strategy,
33 OPT_riscv_frm_insert_opt,
34 OPT_riscv_insert_vsetvli_whole_vector_register_move_valid_vtype,
35 OPT_riscv_landing_pad_label,
36 OPT_riscv_load_store_scan_limit,
37 OPT_riscv_lower_ext_max_web_size,
38 OPT_riscv_lower_form_vw_w_with_splat,
39 OPT_riscv_lower_fp_repeated_divisors,
40 OPT_riscv_lower_fpimm_cost,
41 OPT_riscv_max_build_ints_cost,
42 OPT_riscv_min_jump_table_entries,
43 OPT_riscv_mips_ccmov,
44 OPT_riscv_mips_load_store_pairs,
45 OPT_riscv_or_like_select,
46 OPT_riscv_outliner_regsave,
47 OPT_riscv_prefer_whole_register_move,
48 OPT_riscv_reassoc_shl_addi_add,
49 OPT_riscv_regalloc_hints,
50 OPT_riscv_sched_load_latency,
51 OPT_riscv_sched_mispredict_penalty,
52 OPT_riscv_select_opt,
53 OPT_riscv_sextw_removal,
54 OPT_riscv_strip_w_suffix,
55 OPT_riscv_use_aa,
56 OPT_riscv_use_rematerializable_movimm,
57 OPT_riscv_v_min_trip_count,
58 OPT_riscv_v_register_bit_width_lmul,
59 OPT_riscv_v_slp_max_vf,
60 OPT_riscv_v_vector_bits_max,
61 OPT_riscv_v_vector_bits_min,
62 OPT_riscv_vector_mask_mutation,
63 OPT_riscv_zilsd_max_reschedule_distance,
64 OPT_riscv_zilsd_opt,
65};
66} // namespace
67
68static llvm::opt::OptTable::Tables optionTables() {
69 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
70 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
71 llvm::opt::RenderSeparate;
72
73#ifdef __GNUC__
74#pragma GCC diagnostic push
75#pragma GCC diagnostic ignored "-Woverlength-strings"
76#endif
77static constexpr char OptionStrTableStorage[] =
78 "\0"
79 "-\0"
80 "--\0"
81 "<input>\0"
82 "<unknown>\0"
83 "-riscv-br-merging-base-cost\0"
84 "Sets the cost threshold for when multiple conditionals will be merged into one branch versus be split in multiple branches. Merging conditionals saves branches at the cost of additional instructions. This value sets the instruction cost limit, below which conditionals will be merged, and above which conditionals will be split. Set to -1 to never merge branches\0"
85 "-riscv-br-merging-likely-bias\0"
86 "Increases 'riscv-br-merging-base-cost' in cases that it is likely that all conditionals will be executed. For example for merging the conditionals (a == b && c > d), if its known that a == b is likely, then it is likely that if the conditionals are split both sides will be executed, so it may be desirable to increase the instruction cost threshold. Set to -1 to never merge likely branches\0"
87 "-riscv-br-merging-unlikely-bias\0"
88 "Decreases 'riscv-br-merging-base-cost' in cases that it is unlikely that all conditionals will be executed. For example for merging the conditionals (a == b && c > d), if its known that a == b is unlikely, then it is unlikely that if the conditionals are split both sides will be executed, so it may be desirable to decrease the instruction cost threshold. Set to -1 to never merge unlikely branches\0"
89 "-riscv-constant-pool-for-large-ints\0"
90 "Enable using constant pool for large integers\0"
91 "-riscv-cost-per-use\0"
92 "\0"
93 "\0"
94 "-riscv-enable-cfi-instr-inserter\0"
95 "Enable CFI Instruction Inserter for RISC-V\0"
96 "-riscv-enable-copy-propagation\0"
97 "Enable the copy propagation with RISC-V copy instr\0"
98 "-riscv-enable-copyelim\0"
99 "Enable the redundant copy elimination pass\0"
100 "-riscv-enable-dead-defs\0"
101 "Enable the pass that removes dead definitions and replaces stores to them with stores to x0\0"
102 "-riscv-enable-global-merge\0"
103 "Enable the global merge pass\0"
104 "-riscv-enable-loop-data-prefetch\0"
105 "Enable the loop data prefetch pass\0"
106 "-riscv-enable-machine-combiner\0"
107 "Enable the machine combiner pass\0"
108 "-riscv-enable-pipeliner\0"
109 "Enable Machine Pipeliner for RISC-V\0"
110 "-riscv-enable-sink-fold\0"
111 "Enable sinking and folding of instruction copies\0"
112 "-riscv-force-machine-combiner-strategy\0"
113 "Force machine combiner to use a specific strategy for machine trace metrics evaluation\0"
114 "<local|min-instr>\0"
115 "local,min-instr\0"
116 "-riscv-frm-insert-opt\0"
117 "Enable optimized frm insertion\0"
118 "-riscv-insert-vsetvli-whole-vector-register-move-valid-vtype\0"
119 "Insert vsetvlis before vmvNr.vs to ensure vtype is valid and vill is cleared\0"
120 "-riscv-landing-pad-label\0"
121 "Use preferred fixed label for all labels\0"
122 "-riscv-load-store-scan-limit\0"
123 "-riscv-lower-ext-max-web-size\0"
124 "Give the maximum size (in number of nodes) of the web of instructions that we will consider for VW expansion\0"
125 "-riscv-lower-form-vw-w-with-splat\0"
126 "Allow the formation of VW_W operations (e.g., VWADD_W) with splat constants\0"
127 "-riscv-lower-fp-repeated-divisors\0"
128 "Set the minimum number of repetitions of a divisor to allow transformation to multiplications by the reciprocal\0"
129 "-riscv-lower-fpimm-cost\0"
130 "Give the maximum number of instructions that we will use for creating a floating-point immediate value\0"
131 "-riscv-max-build-ints-cost\0"
132 "The maximum cost used for building integers\0"
133 "-riscv-min-jump-table-entries\0"
134 "Set minimum number of entries to use a jump table on RISCV\0"
135 "-riscv-mips-ccmov\0"
136 "Use 'mips.ccmov' instruction\0"
137 "-riscv-mips-load-store-pairs\0"
138 "Enable the load/store pair optimization pass\0"
139 "-riscv-or-like-select\0"
140 "-riscv-outliner-regsave\0"
141 "Enable RegSave strategy in machine outliner (save X5 to a temporary register when X5 is live across outlined calls)\0"
142 "-riscv-prefer-whole-register-move\0"
143 "Prefer whole register move for vector registers\0"
144 "-riscv-reassoc-shl-addi-add\0"
145 "Swap add and addi in cases where the add may be combined with a shift\0"
146 "-riscv-regalloc-hints\0"
147 "Enable two address hints for register allocation\0"
148 "-riscv-sched-load-latency\0"
149 "Override the load latency (in cycles) in the scheduler model. A non-negative value overrides the target default\0"
150 "-riscv-sched-mispredict-penalty\0"
151 "Override the mispredict penalty (in cycles) in the scheduler model. A non-negative value overrides the target default\0"
152 "-riscv-select-opt\0"
153 "Enable select to branch optimizations\0"
154 "-riscv-sextw-removal\0"
155 "Enable removal of sext.w\0"
156 "-riscv-strip-w-suffix\0"
157 "Enable strip W suffix\0"
158 "-riscv-use-aa\0"
159 "Enable the use of AA during codegen\0"
160 "-riscv-use-rematerializable-movimm\0"
161 "Use a rematerializable pseudoinstruction for 2 instruction constant materialization\0"
162 "-riscv-v-min-trip-count\0"
163 "Set the lower bound of a trip count to decide on vectorization while tail-folding\0"
164 "-riscv-v-register-bit-width-lmul\0"
165 "The LMUL to use for getRegisterBitWidth queries. Affects LMUL used by autovectorized code. Fractional LMULs are not supported\0"
166 "-riscv-v-slp-max-vf\0"
167 "Overrides result used for getMaximumVF query which is used exclusively by SLP vectorizer\0"
168 "-riscv-v-vector-bits-max\0"
169 "Assume V extension vector registers are at most this big, with zero meaning no maximum size is assumed\0"
170 "-riscv-v-vector-bits-min\0"
171 "Assume V extension vector registers are at least this big, with zero meaning no minimum size is assumed. A value of -1 means use Zvl*b extension. This is primarily used to enable autovectorization with fixed width vectors\0"
172 "-riscv-vector-mask-mutation\0"
173 "Enable the vector mask scheduling mutation\0"
174 "-riscv-zilsd-max-reschedule-distance\0"
175 "Maximum distance for rescheduling load/store instructions\0"
176 "-riscv-zilsd-opt\0"
177 "Enable Zilsd load/store optimization\0"
178 ;
179#ifdef __GNUC__
180#pragma GCC diagnostic pop
181#endif
182
183static constexpr llvm::StringTable
184OptionStrTable = OptionStrTableStorage;
185
186 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
187 0 /* prefixes */,
188 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
189 };
190
191 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
192 {0, 0},
193 };
194
195 static constexpr unsigned OptionSubCommandIDsTable[] = {
196 0 /* subcommands */
197 };
198
199 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
200 {0, 0, 0, 0, 0, 0, 0, 0},
201 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
202 {2160, 0, 2178, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
203 };
204
205 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
206 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
207 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
208 {24 /* -riscv-br-merging-base-cost */, 52, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
209 {415 /* -riscv-br-merging-likely-bias */, 445, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
210 {837 /* -riscv-br-merging-unlikely-bias */, 869, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
211 {1269 /* -riscv-constant-pool-for-large-ints */, 1305, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
212 {1351 /* -riscv-cost-per-use */, 1371, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
213 {1373 /* -riscv-enable-cfi-instr-inserter */, 1406, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
214 {1449 /* -riscv-enable-copy-propagation */, 1480, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
215 {1531 /* -riscv-enable-copyelim */, 1554, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
216 {1597 /* -riscv-enable-dead-defs */, 1621, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
217 {1713 /* -riscv-enable-global-merge */, 1740, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
218 {1769 /* -riscv-enable-loop-data-prefetch */, 1802, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
219 {1837 /* -riscv-enable-machine-combiner */, 1868, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
220 {1901 /* -riscv-enable-pipeliner */, 1925, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
221 {1961 /* -riscv-enable-sink-fold */, 1985, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
222 {2034 /* -riscv-force-machine-combiner-strategy */, 2073, 0, 0, 2, 1, llvm::opt::Option::SeparateOrEqClass},
223 {2194 /* -riscv-frm-insert-opt */, 2216, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
224 {2247 /* -riscv-insert-vsetvli-whole-vector-register-move-valid-vtype */, 2308, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
225 {2385 /* -riscv-landing-pad-label */, 2410, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
226 {2451 /* -riscv-load-store-scan-limit */, 1371, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
227 {2480 /* -riscv-lower-ext-max-web-size */, 2510, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
228 {2619 /* -riscv-lower-form-vw-w-with-splat */, 2653, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
229 {2729 /* -riscv-lower-fp-repeated-divisors */, 2763, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
230 {2875 /* -riscv-lower-fpimm-cost */, 2899, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
231 {3002 /* -riscv-max-build-ints-cost */, 3029, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
232 {3073 /* -riscv-min-jump-table-entries */, 3103, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
233 {3162 /* -riscv-mips-ccmov */, 3180, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
234 {3209 /* -riscv-mips-load-store-pairs */, 3238, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
235 {3283 /* -riscv-or-like-select */, 1371, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
236 {3305 /* -riscv-outliner-regsave */, 3329, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
237 {3445 /* -riscv-prefer-whole-register-move */, 3479, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
238 {3527 /* -riscv-reassoc-shl-addi-add */, 3555, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
239 {3625 /* -riscv-regalloc-hints */, 3647, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
240 {3696 /* -riscv-sched-load-latency */, 3722, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
241 {3834 /* -riscv-sched-mispredict-penalty */, 3866, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
242 {3984 /* -riscv-select-opt */, 4002, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
243 {4040 /* -riscv-sextw-removal */, 4061, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
244 {4086 /* -riscv-strip-w-suffix */, 4108, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
245 {4130 /* -riscv-use-aa */, 4144, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
246 {4180 /* -riscv-use-rematerializable-movimm */, 4215, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
247 {4299 /* -riscv-v-min-trip-count */, 4323, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
248 {4405 /* -riscv-v-register-bit-width-lmul */, 4438, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
249 {4564 /* -riscv-v-slp-max-vf */, 4584, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
250 {4673 /* -riscv-v-vector-bits-max */, 4698, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
251 {4801 /* -riscv-v-vector-bits-min */, 4826, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
252 {5048 /* -riscv-vector-mask-mutation */, 5076, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
253 {5119 /* -riscv-zilsd-max-reschedule-distance */, 5156, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
254 {5214 /* -riscv-zilsd-opt */, 5231, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
255 };
256
257 return {OptionStrTable, OptionPrefixesTable,
258 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
259}
260#undef OPTTABLE_CODE
261#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
262
263
264#ifdef OPTIONS_STRUCT_DECL
265#undef OPTIONS_STRUCT_DECL
266#include "llvm/ADT/ArrayRef.h"
267#include "llvm/ADT/BoolOrDefault.h"
268#include "llvm/ADT/StringRef.h"
269#include "llvm/Support/Allocator.h"
270#include "llvm/Support/LibraryOptionsContext.h"
271
272namespace llvm {
273namespace opt {
274class Arg;
275class LibraryOptionsParser;
276class OptTable;
277} // namespace opt
278} // namespace llvm
279
280namespace llvm {
281struct RISCVOptions {
282 bool use_rematerializable_movimm{false};
283 std::optional<int> br_merging_base_cost{std::nullopt};
284 int br_merging_likely_bias{0};
285 int br_merging_unlikely_bias{-1};
286 unsigned lower_ext_max_web_size{18};
287 bool lower_form_vw_w_with_splat{false};
288 unsigned lower_fp_repeated_divisors{2};
289 int lower_fpimm_cost{3};
290 bool reassoc_shl_addi_add{true};
291 std::optional<uint32_t> landing_pad_label{std::nullopt};
292 bool frm_insert_opt{true};
293 bool insert_vsetvli_whole_vector_register_move_valid_vtype{true};
294 std::optional<MachineTraceStrategy> force_machine_combiner_strategy{std::nullopt};
295 bool outliner_regsave{true};
296 bool prefer_whole_register_move{false};
297 unsigned load_store_scan_limit{128};
298 bool sextw_removal{true};
299 bool strip_w_suffix{true};
300 bool cost_per_use{true};
301 bool regalloc_hints{true};
302 bool constant_pool_for_large_ints{true};
303 unsigned max_build_ints_cost{0};
304 std::optional<unsigned> min_jump_table_entries{std::nullopt};
305 bool mips_ccmov{true};
306 bool mips_load_store_pairs{false};
307 std::optional<unsigned> sched_load_latency{std::nullopt};
308 std::optional<unsigned> sched_mispredict_penalty{std::nullopt};
309 bool use_aa{true};
310 bool enable_cfi_instr_inserter{false};
311 bool enable_copy_propagation{true};
312 bool enable_copyelim{true};
313 bool enable_dead_defs{true};
314 llvm::BoolOrDefault enable_global_merge{llvm::BoolOrDefault::Default};
315 bool enable_loop_data_prefetch{true};
316 bool enable_machine_combiner{true};
317 bool enable_pipeliner{false};
318 bool enable_sink_fold{true};
319 bool select_opt{true};
320 std::optional<unsigned> v_vector_bits_max{std::nullopt};
321 std::optional<int> v_vector_bits_min{std::nullopt};
322 bool vector_mask_mutation{true};
323 bool or_like_select{true};
324 unsigned v_min_trip_count{5};
325 unsigned v_register_bit_width_lmul{2};
326 std::optional<unsigned> v_slp_max_vf{std::nullopt};
327 unsigned zilsd_max_reschedule_distance{10};
328 bool zilsd_opt{true};
329
330 static constexpr bool PerContext = true;
331 static const llvm::opt::OptTable &optTable();
332 /// Sets the member that \p A names, allocating a list from \p Alloc.
333 /// Returns false if the value is invalid.
334 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
335
336private:
337 friend class llvm::cl::LibraryOptionsContext;
338 friend class llvm::opt::LibraryOptionsParser;
339
340 static RISCVOptions Global;
341 static const RISCVOptions Default;
342};
343} // namespace llvm
344#endif // OPTIONS_STRUCT_DECL
345
346#ifdef OPTIONS_STRUCT_DEFS
347#undef OPTIONS_STRUCT_DEFS
348llvm::RISCVOptions llvm::RISCVOptions::Global;
349LLVM_REQUIRE_CONSTANT_INITIALIZATION const llvm::RISCVOptions llvm::RISCVOptions::Default;
350
351const llvm::opt::OptTable &llvm::RISCVOptions::optTable() {
352 static const llvm::opt::LibraryOptTable T(optionTables());
353 return T;
354}
355
356bool llvm::RISCVOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
357 switch (A.getOption().getID()) {
358 case OPT_riscv_br_merging_base_cost:
359 return llvm::opt::parseArgValue(A.getValue(), br_merging_base_cost, Alloc);
360 case OPT_riscv_br_merging_likely_bias:
361 return llvm::opt::parseArgValue(A.getValue(), br_merging_likely_bias, Alloc);
362 case OPT_riscv_br_merging_unlikely_bias:
363 return llvm::opt::parseArgValue(A.getValue(), br_merging_unlikely_bias, Alloc);
364 case OPT_riscv_constant_pool_for_large_ints:
365 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", constant_pool_for_large_ints, Alloc);
366 case OPT_riscv_cost_per_use:
367 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", cost_per_use, Alloc);
368 case OPT_riscv_enable_cfi_instr_inserter:
369 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_cfi_instr_inserter, Alloc);
370 case OPT_riscv_enable_copy_propagation:
371 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_copy_propagation, Alloc);
372 case OPT_riscv_enable_copyelim:
373 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_copyelim, Alloc);
374 case OPT_riscv_enable_dead_defs:
375 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_dead_defs, Alloc);
376 case OPT_riscv_enable_global_merge:
377 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_global_merge, Alloc);
378 case OPT_riscv_enable_loop_data_prefetch:
379 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_loop_data_prefetch, Alloc);
380 case OPT_riscv_enable_machine_combiner:
381 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_machine_combiner, Alloc);
382 case OPT_riscv_enable_pipeliner:
383 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_pipeliner, Alloc);
384 case OPT_riscv_enable_sink_fold:
385 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", enable_sink_fold, Alloc);
386 case OPT_riscv_force_machine_combiner_strategy:
387 return llvm::opt::parseArgValue(A.getValue(), force_machine_combiner_strategy, Alloc, [](llvm::StringRef V, auto &X) {
388 if (V == "local") {
389 X = MachineTraceStrategy::TS_Local;
390 return true;
391 }
392 if (V == "min-instr") {
393 X = MachineTraceStrategy::TS_MinInstrCount;
394 return true;
395 }
396 return false;
397 });
398 case OPT_riscv_frm_insert_opt:
399 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", frm_insert_opt, Alloc);
400 case OPT_riscv_insert_vsetvli_whole_vector_register_move_valid_vtype:
401 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", insert_vsetvli_whole_vector_register_move_valid_vtype, Alloc);
402 case OPT_riscv_landing_pad_label:
403 return llvm::opt::parseArgValue(A.getValue(), landing_pad_label, Alloc);
404 case OPT_riscv_load_store_scan_limit:
405 return llvm::opt::parseArgValue(A.getValue(), load_store_scan_limit, Alloc);
406 case OPT_riscv_lower_ext_max_web_size:
407 return llvm::opt::parseArgValue(A.getValue(), lower_ext_max_web_size, Alloc);
408 case OPT_riscv_lower_form_vw_w_with_splat:
409 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", lower_form_vw_w_with_splat, Alloc);
410 case OPT_riscv_lower_fp_repeated_divisors:
411 return llvm::opt::parseArgValue(A.getValue(), lower_fp_repeated_divisors, Alloc);
412 case OPT_riscv_lower_fpimm_cost:
413 return llvm::opt::parseArgValue(A.getValue(), lower_fpimm_cost, Alloc);
414 case OPT_riscv_max_build_ints_cost:
415 return llvm::opt::parseArgValue(A.getValue(), max_build_ints_cost, Alloc);
416 case OPT_riscv_min_jump_table_entries:
417 return llvm::opt::parseArgValue(A.getValue(), min_jump_table_entries, Alloc);
418 case OPT_riscv_mips_ccmov:
419 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mips_ccmov, Alloc);
420 case OPT_riscv_mips_load_store_pairs:
421 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", mips_load_store_pairs, Alloc);
422 case OPT_riscv_or_like_select:
423 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", or_like_select, Alloc);
424 case OPT_riscv_outliner_regsave:
425 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", outliner_regsave, Alloc);
426 case OPT_riscv_prefer_whole_register_move:
427 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", prefer_whole_register_move, Alloc);
428 case OPT_riscv_reassoc_shl_addi_add:
429 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", reassoc_shl_addi_add, Alloc);
430 case OPT_riscv_regalloc_hints:
431 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", regalloc_hints, Alloc);
432 case OPT_riscv_sched_load_latency:
433 return llvm::opt::parseArgValue(A.getValue(), sched_load_latency, Alloc);
434 case OPT_riscv_sched_mispredict_penalty:
435 return llvm::opt::parseArgValue(A.getValue(), sched_mispredict_penalty, Alloc);
436 case OPT_riscv_select_opt:
437 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", select_opt, Alloc);
438 case OPT_riscv_sextw_removal:
439 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", sextw_removal, Alloc);
440 case OPT_riscv_strip_w_suffix:
441 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", strip_w_suffix, Alloc);
442 case OPT_riscv_use_aa:
443 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", use_aa, Alloc);
444 case OPT_riscv_use_rematerializable_movimm:
445 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", use_rematerializable_movimm, Alloc);
446 case OPT_riscv_v_min_trip_count:
447 return llvm::opt::parseArgValue(A.getValue(), v_min_trip_count, Alloc);
448 case OPT_riscv_v_register_bit_width_lmul:
449 return llvm::opt::parseArgValue(A.getValue(), v_register_bit_width_lmul, Alloc);
450 case OPT_riscv_v_slp_max_vf:
451 return llvm::opt::parseArgValue(A.getValue(), v_slp_max_vf, Alloc);
452 case OPT_riscv_v_vector_bits_max:
453 return llvm::opt::parseArgValue(A.getValue(), v_vector_bits_max, Alloc);
454 case OPT_riscv_v_vector_bits_min:
455 return llvm::opt::parseArgValue(A.getValue(), v_vector_bits_min, Alloc);
456 case OPT_riscv_vector_mask_mutation:
457 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", vector_mask_mutation, Alloc);
458 case OPT_riscv_zilsd_max_reschedule_distance:
459 return llvm::opt::parseArgValue(A.getValue(), zilsd_max_reschedule_distance, Alloc);
460 case OPT_riscv_zilsd_opt:
461 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", zilsd_opt, Alloc);
462 }
463 llvm_unreachable("option without a member");
464}
465#endif // OPTIONS_STRUCT_DEFS
466/////////
467// ValuesCode
468
469#ifdef OPTTABLE_VALUES_CODE
470static llvm::StringRef getOptionValuesCode(unsigned ID) {
471 switch (ID) {
472 }
473 return {};
474}
475#undef OPTTABLE_VALUES_CODE
476#endif // OPTTABLE_VALUES_CODE
477/////////
478// Groups
479
480#ifdef OPTION
481
482//////////
483// Options
484
485OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
486OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
487OPTION(1, 24 /* -riscv-br-merging-base-cost */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 52, 0, 0, 0, 0)
488OPTION(1, 415 /* -riscv-br-merging-likely-bias */, anonymous_2, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 445, 0, 0, 0, 0)
489OPTION(1, 837 /* -riscv-br-merging-unlikely-bias */, anonymous_3, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 869, 0, 0, 0, 0)
490OPTION(1, 1269 /* -riscv-constant-pool-for-large-ints */, anonymous_20, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1305, 0, 0, 0, 0)
491OPTION(1, 1351 /* -riscv-cost-per-use */, anonymous_18, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1371, 0, 0, 0, 0)
492OPTION(1, 1373 /* -riscv-enable-cfi-instr-inserter */, anonymous_28, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1406, 0, 0, 0, 0)
493OPTION(1, 1449 /* -riscv-enable-copy-propagation */, anonymous_29, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1480, 0, 0, 0, 0)
494OPTION(1, 1531 /* -riscv-enable-copyelim */, anonymous_30, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1554, 0, 0, 0, 0)
495OPTION(1, 1597 /* -riscv-enable-dead-defs */, anonymous_31, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1621, 0, 0, 0, 0)
496OPTION(1, 1713 /* -riscv-enable-global-merge */, anonymous_32, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1740, 0, 0, 0, 0)
497OPTION(1, 1769 /* -riscv-enable-loop-data-prefetch */, anonymous_33, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1802, 0, 0, 0, 0)
498OPTION(1, 1837 /* -riscv-enable-machine-combiner */, anonymous_34, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1868, 0, 0, 0, 0)
499OPTION(1, 1901 /* -riscv-enable-pipeliner */, anonymous_35, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1925, 0, 0, 0, 0)
500OPTION(1, 1961 /* -riscv-enable-sink-fold */, anonymous_36, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1985, 0, 0, 0, 0)
501OPTION(1, 2034 /* -riscv-force-machine-combiner-strategy */, anonymous_12, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2073, 0, 2160, 2178, 0)
502OPTION(1, 2194 /* -riscv-frm-insert-opt */, anonymous_10, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2216, 0, 0, 0, 0)
503OPTION(1, 2247 /* -riscv-insert-vsetvli-whole-vector-register-move-valid-vtype */, anonymous_11, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2308, 0, 0, 0, 0)
504OPTION(1, 2385 /* -riscv-landing-pad-label */, anonymous_9, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2410, 0, 0, 0, 0)
505OPTION(1, 2451 /* -riscv-load-store-scan-limit */, anonymous_15, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1371, 0, 0, 0, 0)
506OPTION(1, 2480 /* -riscv-lower-ext-max-web-size */, anonymous_4, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2510, 0, 0, 0, 0)
507OPTION(1, 2619 /* -riscv-lower-form-vw-w-with-splat */, anonymous_5, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2653, 0, 0, 0, 0)
508OPTION(1, 2729 /* -riscv-lower-fp-repeated-divisors */, anonymous_6, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2763, 0, 0, 0, 0)
509OPTION(1, 2875 /* -riscv-lower-fpimm-cost */, anonymous_7, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 2899, 0, 0, 0, 0)
510OPTION(1, 3002 /* -riscv-max-build-ints-cost */, anonymous_21, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3029, 0, 0, 0, 0)
511OPTION(1, 3073 /* -riscv-min-jump-table-entries */, anonymous_22, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3103, 0, 0, 0, 0)
512OPTION(1, 3162 /* -riscv-mips-ccmov */, anonymous_23, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3180, 0, 0, 0, 0)
513OPTION(1, 3209 /* -riscv-mips-load-store-pairs */, anonymous_24, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3238, 0, 0, 0, 0)
514OPTION(1, 3283 /* -riscv-or-like-select */, anonymous_41, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 1371, 0, 0, 0, 0)
515OPTION(1, 3305 /* -riscv-outliner-regsave */, anonymous_13, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3329, 0, 0, 0, 0)
516OPTION(1, 3445 /* -riscv-prefer-whole-register-move */, anonymous_14, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3479, 0, 0, 0, 0)
517OPTION(1, 3527 /* -riscv-reassoc-shl-addi-add */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3555, 0, 0, 0, 0)
518OPTION(1, 3625 /* -riscv-regalloc-hints */, anonymous_19, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3647, 0, 0, 0, 0)
519OPTION(1, 3696 /* -riscv-sched-load-latency */, anonymous_25, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3722, 0, 0, 0, 0)
520OPTION(1, 3834 /* -riscv-sched-mispredict-penalty */, anonymous_26, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 3866, 0, 0, 0, 0)
521OPTION(1, 3984 /* -riscv-select-opt */, anonymous_37, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4002, 0, 0, 0, 0)
522OPTION(1, 4040 /* -riscv-sextw-removal */, anonymous_16, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4061, 0, 0, 0, 0)
523OPTION(1, 4086 /* -riscv-strip-w-suffix */, anonymous_17, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4108, 0, 0, 0, 0)
524OPTION(1, 4130 /* -riscv-use-aa */, anonymous_27, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4144, 0, 0, 0, 0)
525OPTION(1, 4180 /* -riscv-use-rematerializable-movimm */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4215, 0, 0, 0, 0)
526OPTION(1, 4299 /* -riscv-v-min-trip-count */, anonymous_42, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4323, 0, 0, 0, 0)
527OPTION(1, 4405 /* -riscv-v-register-bit-width-lmul */, anonymous_43, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4438, 0, 0, 0, 0)
528OPTION(1, 4564 /* -riscv-v-slp-max-vf */, anonymous_44, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4584, 0, 0, 0, 0)
529OPTION(1, 4673 /* -riscv-v-vector-bits-max */, anonymous_38, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4698, 0, 0, 0, 0)
530OPTION(1, 4801 /* -riscv-v-vector-bits-min */, anonymous_39, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 4826, 0, 0, 0, 0)
531OPTION(1, 5048 /* -riscv-vector-mask-mutation */, anonymous_40, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 5076, 0, 0, 0, 0)
532OPTION(1, 5119 /* -riscv-zilsd-max-reschedule-distance */, anonymous_45, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 5156, 0, 0, 0, 0)
533OPTION(1, 5214 /* -riscv-zilsd-opt */, anonymous_46, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 5231, 0, 0, 0, 0)
534#endif // OPTION
535
536#ifdef SIMPLE_ENUM_VALUE_TABLE
537
538struct SimpleEnumValue {
539 const char *Name;
540 unsigned Value;
541};
542
543struct SimpleEnumValueTable {
544 const SimpleEnumValue *Table;
545 unsigned Size;
546};
547static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
548static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
549#endif // SIMPLE_ENUM_VALUE_TABLE
550