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)
13static llvm::opt::OptTable::Tables optionTables() {
14 using llvm::opt::DefaultVis, llvm::opt::HelpHidden,
15 llvm::opt::RenderAsInput, llvm::opt::RenderJoined,
16 llvm::opt::RenderSeparate;
17
18#ifdef __GNUC__
19#pragma GCC diagnostic push
20#pragma GCC diagnostic ignored "-Woverlength-strings"
21#endif
22static constexpr char OptionStrTableStorage[] =
23 "\0"
24 "-\0"
25 "--\0"
26 "<input>\0"
27 "<unknown>\0"
28 "-instcombine-code-sinking\0"
29 "Enable code sinking\0"
30 "-instcombine-guard-widening-window\0"
31 "How wide an instruction window to bypass looking for another guard\0"
32 "-instcombine-lower-dbg-declare\0"
33 "\0"
34 "\0"
35 "-instcombine-max-allocsite-removable-users\0"
36 "Maximum number of users to visit in alloc-site removability analysis\0"
37 "-instcombine-max-copied-from-constant-users\0"
38 "Maximum users to visit in copy from constant transform\0"
39 "-instcombine-max-num-phis\0"
40 "Maximum number phis to handle in intptr/ptrint folding\0"
41 "-instcombine-max-sink-users\0"
42 "Maximum number of undroppable users for instruction sinking\0"
43 "-instcombine-maxarray-size\0"
44 "Maximum array size considered when doing a combine\0"
45 "-instcombine-negator-enabled\0"
46 "Should we attempt to sink negations?\0"
47 "-instcombine-negator-max-depth\0"
48 "What is the maximal lookup depth when trying to check for viability of negation sinking\0"
49 "-instcombine-simplify-vector-elts-depth\0"
50 "Depth limit when simplifying vector instructions and their operands\0"
51 "-instcombine-verify-known-bits\0"
52 "Verify that computeKnownBits() and SimplifyDemandedBits() are consistent\0"
53 ;
54#ifdef __GNUC__
55#pragma GCC diagnostic pop
56#endif
57
58static constexpr llvm::StringTable
59OptionStrTable = OptionStrTableStorage;
60
61 static constexpr llvm::StringTable::Offset OptionPrefixesTable[] = {
62 0 /* prefixes */,
63 2 /* prefixes */, 1 /* '-' */, 3 /* '--' */
64 };
65
66 static constexpr llvm::opt::OptTable::HelpTextVariant OptionHelpTextVariantsTable[] = {
67 {0, 0},
68 };
69
70 static constexpr unsigned OptionSubCommandIDsTable[] = {
71 0 /* subcommands */
72 };
73
74 static constexpr llvm::opt::OptTable::InfoExtra OptionInfoExtrasTable[] = {
75 {0, 0, 0, 0, 0, 0, 0, 0},
76 {0, 0, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0},
77 };
78
79 static constexpr llvm::opt::OptTable::Info OptionInfoTable[] = {
80 {6 /* <input> */, 0, 0, 0, 1, 0, llvm::opt::Option::InputClass},
81 {14 /* <unknown> */, 0, 0, 0, 1, 0, llvm::opt::Option::UnknownClass},
82 {24 /* -instcombine-code-sinking */, 50, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
83 {70 /* -instcombine-guard-widening-window */, 105, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
84 {172 /* -instcombine-lower-dbg-declare */, 203, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
85 {205 /* -instcombine-max-allocsite-removable-users */, 248, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
86 {317 /* -instcombine-max-copied-from-constant-users */, 361, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
87 {416 /* -instcombine-max-num-phis */, 442, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
88 {497 /* -instcombine-max-sink-users */, 525, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
89 {585 /* -instcombine-maxarray-size */, 612, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
90 {663 /* -instcombine-negator-enabled */, 692, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
91 {729 /* -instcombine-negator-max-depth */, 760, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
92 {848 /* -instcombine-simplify-vector-elts-depth */, 888, 0, 0, 1, 1, llvm::opt::Option::SeparateOrEqClass},
93 {956 /* -instcombine-verify-known-bits */, 987, 0, 0, 1, 1, llvm::opt::Option::FlagOrEqClass},
94 };
95
96 return {OptionStrTable, OptionPrefixesTable,
97 OptionInfoTable, OptionInfoExtrasTable, OptionHelpTextVariantsTable, {}, OptionSubCommandIDsTable};
98}
99#undef OPTTABLE_CODE
100#endif // OPTTABLE_CODE || OPTIONS_STRUCT_DEFS
101
102
103#ifdef OPTIONS_STRUCT_DECL
104#undef OPTIONS_STRUCT_DECL
105#include "llvm/ADT/ArrayRef.h"
106#include "llvm/ADT/BoolOrDefault.h"
107#include "llvm/ADT/StringRef.h"
108#include "llvm/Support/Allocator.h"
109
110namespace llvm {
111namespace opt {
112class Arg;
113class OptTable;
114} // namespace opt
115} // namespace llvm
116
117namespace llvm {
118struct InstCombineCLOptions {
119 bool code_sinking{true};
120 unsigned guard_widening_window{3};
121 bool lower_dbg_declare{true};
122 unsigned max_allocsite_removable_users{2048};
123 unsigned max_copied_from_constant_users{300};
124 unsigned max_num_phis{512};
125 unsigned max_sink_users{32};
126 unsigned maxarray_size{1024};
127 bool negator_enabled{true};
128 unsigned negator_max_depth{~0U};
129 unsigned simplify_vector_elts_depth{10};
130 bool verify_known_bits{false};
131
132 /// The instance cl::ParseCommandLineOptions sets.
133 static InstCombineCLOptions Global;
134
135 static const llvm::opt::OptTable &optTable();
136 /// Sets the member that \p A names, allocating a list from \p Alloc.
137 /// Returns false if the value is invalid.
138 bool apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc);
139};
140} // namespace llvm
141#endif // OPTIONS_STRUCT_DECL
142
143#ifdef OPTIONS_STRUCT_DEFS
144#undef OPTIONS_STRUCT_DEFS
145llvm::InstCombineCLOptions llvm::InstCombineCLOptions::Global;
146
147namespace {
148enum ID : unsigned {
149 OPT_INVALID = 0,
150 OPT_INPUT,
151 OPT_UNKNOWN,
152 OPT_instcombine_code_sinking,
153 OPT_instcombine_guard_widening_window,
154 OPT_instcombine_lower_dbg_declare,
155 OPT_instcombine_max_allocsite_removable_users,
156 OPT_instcombine_max_copied_from_constant_users,
157 OPT_instcombine_max_num_phis,
158 OPT_instcombine_max_sink_users,
159 OPT_instcombine_maxarray_size,
160 OPT_instcombine_negator_enabled,
161 OPT_instcombine_negator_max_depth,
162 OPT_instcombine_simplify_vector_elts_depth,
163 OPT_instcombine_verify_known_bits,
164};
165} // namespace
166
167const llvm::opt::OptTable &llvm::InstCombineCLOptions::optTable() {
168 static const llvm::opt::LibraryOptTable T(optionTables());
169 return T;
170}
171
172bool llvm::InstCombineCLOptions::apply(const llvm::opt::Arg &A, llvm::BumpPtrAllocator &Alloc) {
173 switch (A.getOption().getID()) {
174 case OPT_instcombine_code_sinking:
175 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", code_sinking, Alloc);
176 case OPT_instcombine_guard_widening_window:
177 return llvm::opt::parseArgValue(A.getValue(), guard_widening_window, Alloc);
178 case OPT_instcombine_lower_dbg_declare:
179 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", lower_dbg_declare, Alloc);
180 case OPT_instcombine_max_allocsite_removable_users:
181 return llvm::opt::parseArgValue(A.getValue(), max_allocsite_removable_users, Alloc);
182 case OPT_instcombine_max_copied_from_constant_users:
183 return llvm::opt::parseArgValue(A.getValue(), max_copied_from_constant_users, Alloc);
184 case OPT_instcombine_max_num_phis:
185 return llvm::opt::parseArgValue(A.getValue(), max_num_phis, Alloc);
186 case OPT_instcombine_max_sink_users:
187 return llvm::opt::parseArgValue(A.getValue(), max_sink_users, Alloc);
188 case OPT_instcombine_maxarray_size:
189 return llvm::opt::parseArgValue(A.getValue(), maxarray_size, Alloc);
190 case OPT_instcombine_negator_enabled:
191 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", negator_enabled, Alloc);
192 case OPT_instcombine_negator_max_depth:
193 return llvm::opt::parseArgValue(A.getValue(), negator_max_depth, Alloc);
194 case OPT_instcombine_simplify_vector_elts_depth:
195 return llvm::opt::parseArgValue(A.getValue(), simplify_vector_elts_depth, Alloc);
196 case OPT_instcombine_verify_known_bits:
197 return llvm::opt::parseArgValue(A.getNumValues() ? A.getValue() : "true", verify_known_bits, Alloc);
198 }
199 llvm_unreachable("option without a member");
200}
201#endif // OPTIONS_STRUCT_DEFS
202/////////
203// ValuesCode
204
205#ifdef OPTTABLE_VALUES_CODE
206static llvm::StringRef getOptionValuesCode(unsigned ID) {
207 switch (ID) {
208 }
209 return {};
210}
211#undef OPTTABLE_VALUES_CODE
212#endif // OPTTABLE_VALUES_CODE
213/////////
214// Groups
215
216#ifdef OPTION
217
218//////////
219// Options
220
221OPTION(0, 6 /* <input> */, INPUT, Input, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
222OPTION(0, 14 /* <unknown> */, UNKNOWN, Unknown, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 0, 0, 0, 0, 0)
223OPTION(1, 24 /* -instcombine-code-sinking */, anonymous_0, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 50, 0, 0, 0, 0)
224OPTION(1, 70 /* -instcombine-guard-widening-window */, anonymous_1, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 105, 0, 0, 0, 0)
225OPTION(1, 172 /* -instcombine-lower-dbg-declare */, anonymous_2, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 203, 0, 0, 0, 0)
226OPTION(1, 205 /* -instcombine-max-allocsite-removable-users */, anonymous_3, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 248, 0, 0, 0, 0)
227OPTION(1, 317 /* -instcombine-max-copied-from-constant-users */, anonymous_4, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 361, 0, 0, 0, 0)
228OPTION(1, 416 /* -instcombine-max-num-phis */, anonymous_5, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 442, 0, 0, 0, 0)
229OPTION(1, 497 /* -instcombine-max-sink-users */, anonymous_6, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 525, 0, 0, 0, 0)
230OPTION(1, 585 /* -instcombine-maxarray-size */, anonymous_7, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 612, 0, 0, 0, 0)
231OPTION(1, 663 /* -instcombine-negator-enabled */, anonymous_8, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 692, 0, 0, 0, 0)
232OPTION(1, 729 /* -instcombine-negator-max-depth */, anonymous_9, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 760, 0, 0, 0, 0)
233OPTION(1, 848 /* -instcombine-simplify-vector-elts-depth */, anonymous_10, SeparateOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 888, 0, 0, 0, 0)
234OPTION(1, 956 /* -instcombine-verify-known-bits */, anonymous_11, FlagOrEq, INVALID, INVALID, 0, 0, static_cast<unsigned>(DefaultVis), 0, 987, 0, 0, 0, 0)
235#endif // OPTION
236
237#ifdef SIMPLE_ENUM_VALUE_TABLE
238
239struct SimpleEnumValue {
240 const char *Name;
241 unsigned Value;
242};
243
244struct SimpleEnumValueTable {
245 const SimpleEnumValue *Table;
246 unsigned Size;
247};
248static const SimpleEnumValueTable SimpleEnumValueTables[] = {};
249static const unsigned SimpleEnumValueTablesSize = std::size(SimpleEnumValueTables);
250#endif // SIMPLE_ENUM_VALUE_TABLE
251