Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(76)

Side by Side Diff: src/IceClFlags.def

Issue 1803403002: Subzero. Flags refactoring. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Remove test code. Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 //===- subzero/src/IceClFlags.def - Cl Flags for translation ----*- C++ -*-===//
2 //
3 // The Subzero Code Generator
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 ///
10 /// \file
11 /// \brief Declares the command line flags used by Subzero.
12 ///
13 //===----------------------------------------------------------------------===//
14
15 #ifndef SUBZERO_SRC_ICECLFLAGS_DEF
16 #define SUBZERO_SRC_ICECLFLAGS_DEF
17
18 namespace Ice {
19 // cl_detail defines tags (i.e., structs) for specifying the type of a flag
20 // (either single-, or multi-value), and whether or not the flag is available in
21 // non-LLVM_CL build.
22 namespace cl_detail {
23
24 // Single-value flag, available in a non-LLVM_CL build.
25 struct release_opt_flag {};
26 // Single-value flag, not available in a non-LLVM_CL build.
27 struct dev_opt_flag {};
28 // Multi-value flag, not available in a non-LLVM_CL build.
29 struct dev_list_flag {};
30
31 } // end of namespace detail
32 } // end of namespace Ice
33
34 #define COMMAND_LINE_FLAGS \
35 /* Name, Type, ClType, <<flag declaration ctor arguments>> */ \
36 X(IRFilename, std::string, release_opt_flag, cl::Positional, \
37 cl::desc("IR File"), cl::init("-")) \
38 \
39 X(NumTranslationThreads, uint32_t, release_opt_flag, "threads", \
40 cl::desc("Number of translation threads (0 for purely sequential)"), \
41 cl::init(2)) \
42 \
43 X(OptLevel, Ice::OptLevel, release_opt_flag, cl::desc("Optimization level"), \
44 cl::init(Ice::Opt_m1), cl::value_desc("level"), \
45 cl::values(clEnumValN(Ice::Opt_m1, "Om1", "-1"), \
46 clEnumValN(Ice::Opt_m1, "O-1", "-1"), \
47 clEnumValN(Ice::Opt_0, "O0", "0"), \
48 clEnumValN(Ice::Opt_1, "O1", "1"), \
49 clEnumValN(Ice::Opt_2, "O2", "2"), clEnumValEnd)) \
50 \
51 X(OutputFilename, std::string, release_opt_flag, "o", \
52 cl::desc("Override output filename"), cl::init("-"), \
53 cl::value_desc("filename")) \
54 \
55 X(TargetArch, Ice::TargetArch, release_opt_flag, "target", \
56 cl::desc("Target architecture:"), cl::init(Ice::Target_X8632), \
57 cl::values( \
58 clEnumValN(Ice::Target_X8632, "x8632", "x86-32"), \
59 clEnumValN(Ice::Target_X8632, "x86-32", "x86-32 (same as x8632)"), \
60 clEnumValN(Ice::Target_X8632, "x86_32", "x86-32 (same as x8632)"), \
61 clEnumValN(Ice::Target_X8664, "x8664", "x86-64"), \
62 clEnumValN(Ice::Target_X8664, "x86-64", "x86-64 (same as x8664)"), \
63 clEnumValN(Ice::Target_X8664, "x86_64", "x86-64 (same as x8664)"), \
64 clEnumValN(Ice::Target_ARM32, "arm", "arm32"), \
65 clEnumValN(Ice::Target_ARM32, "arm32", "arm32 (same as arm)"), \
66 clEnumValN(Ice::Target_ARM64, "arm64", "arm64"), \
67 clEnumValN(Ice::Target_MIPS32, "mips", "mips32"), \
68 clEnumValN(Ice::Target_MIPS32, "mips32", "mips32 (same as mips)"), \
69 clEnumValEnd)) \
70 \
Jim Stichnoth 2016/03/21 15:44:47 tab character...
John 2016/03/21 17:06:36 vim...
71 /* The following are development flags, and ideally should not appear in a \
72 * release build. */ \
73 \
74 X(AllowErrorRecovery, bool, dev_opt_flag, \
75 "allow-pnacl-reader-error-recovery", \
76 cl::desc("Allow error recovery when reading PNaCl bitcode."), \
77 cl::init(false)) \
78 \
79 X(AllowExternDefinedSymbols, bool, dev_opt_flag, \
80 "allow-externally-defined-symbols", \
81 cl::desc( \
82 "Allow global symbols to be externally defined (other than _start " \
83 "and __pnacl_pso_root)."), \
84 cl::init(false)) \
85 \
86 X(AllowIacaMarks, bool, dev_opt_flag, "allow-iaca-marks", \
87 cl::desc("Allow IACA (Intel Architecture Code Analyzer) marks to be " \
88 "inserted. These binaries are not executable."), \
89 cl::init(false)) \
90 \
91 X(AllowUninitializedGlobals, bool, dev_opt_flag, \
92 "allow-uninitialized-globals", \
93 cl::desc("Allow global variables to be uninitialized")) \
94 \
95 X(AlwaysExitSuccess, bool, dev_opt_flag, "exit-success", \
96 cl::desc("Exit with success status, even if errors found"), \
97 cl::init(false)) \
98 \
99 X(BitcodeAsText, bool, dev_opt_flag, "bitcode-as-text", \
100 cl::desc("Accept textual form of PNaCl bitcode " \
101 "records (i.e. not .ll assembly)"), \
102 cl::init(false)) \
103 \
104 X(BuildOnRead, bool, dev_opt_flag, "build-on-read", \
105 cl::desc("Build ICE instructions when reading bitcode"), cl::init(true)) \
106 \
107 X(DataSections, bool, dev_opt_flag, "fdata-sections", \
108 cl::desc("Emit (global) data into separate sections")) \
109 \
110 X(DecorateAsm, bool, dev_opt_flag, "asm-verbose", \
111 cl::desc("Decorate textual asm output with register liveness info")) \
112 \
113 X(DefaultFunctionPrefix, std::string, dev_opt_flag, \
114 "default-function-prefix", \
115 cl::desc("Define default function prefix for naming " \
116 "unnamed functions"), \
117 cl::init(Ice::BuildDefs::dump() ? "Function" : "F")) \
118 \
119 X(DefaultGlobalPrefix, std::string, dev_opt_flag, "default-global-prefix", \
120 cl::desc("Define default global prefix for naming " \
121 "unnamed globals"), \
122 cl::init(Ice::BuildDefs::dump() ? "Global" : "G")) \
123 \
124 X(DisableHybridAssembly, bool, dev_opt_flag, "no-hybrid-asm", \
125 cl::desc("Disable hybrid assembly when -filetype=iasm"), cl::init(false)) \
126 \
127 X(DisableInternal, bool, dev_opt_flag, "externalize", \
128 cl::desc("Externalize all symbols")) \
129 \
130 X(DisableTranslation, bool, dev_opt_flag, "notranslate", \
131 cl::desc("Disable Subzero translation")) \
132 \
133 X(DumpStats, bool, dev_opt_flag, "szstats", \
134 cl::desc("Print statistics after translating each function")) \
135 \
136 X(EnableBlockProfile, bool, dev_opt_flag, "enable-block-profile", \
137 cl::desc("Instrument basic blocks, and output profiling " \
138 "information to stdout at the end of program execution."), \
139 cl::init(false)) \
140 \
141 X(EnablePhiEdgeSplit, bool, dev_opt_flag, "phi-edge-split", \
142 cl::desc("Enable edge splitting for Phi lowering"), cl::init(true)) \
143 \
144 X(ExcludedRegisters, std::string, dev_list_flag, "reg-exclude", \
145 cl::CommaSeparated, cl::desc("Don't use specified registers")) \
146 \
147 X(ForceMemIntrinOpt, bool, dev_opt_flag, "fmem-intrin-opt", \
148 cl::desc("Force optimization of memory intrinsics.")) \
149 \
150 X(FunctionSections, bool, dev_opt_flag, "ffunction-sections", \
151 cl::desc("Emit functions into separate sections")) \
152 \
153 X(GenerateBuildAtts, bool, release_opt_flag, "build-atts", \
154 cl::desc("Generate list of build attributes associated with " \
155 "this executable."), \
156 cl::init(false)) \
157 \
158 X(InputFileFormat, llvm::NaClFileFormat, dev_opt_flag, "bitcode-format", \
159 cl::desc("Define format of input file:"), \
160 cl::values(clEnumValN(llvm::LLVMFormat, "llvm", "LLVM file (default)"), \
161 clEnumValN(llvm::PNaClFormat, "pnacl", "PNaCl bitcode file"), \
162 clEnumValEnd), \
163 cl::init(llvm::LLVMFormat)) \
164 \
165 X(KeepDeletedInsts, bool, dev_opt_flag, "keep-deleted-insts", \
166 cl::desc("Retain deleted instructions in the Cfg"), \
167 cl::init(Ice::BuildDefs::dump())) \
168 \
169 X(LLVMVerboseErrors, bool, dev_opt_flag, "verbose-llvm-parse-errors", \
170 cl::desc("Print out more descriptive PNaCl bitcode parse errors when " \
171 "building LLVM IR first"), \
172 cl::init(false)) \
173 \
174 X(LogFilename, std::string, dev_opt_flag, "log", \
175 cl::desc("Set log filename"), cl::init("-"), cl::value_desc("filename")) \
176 \
177 X(MaxNopsPerInstruction, int, dev_opt_flag, "max-nops-per-instruction", \
178 cl::desc("Max number of nops to insert per instruction"), cl::init(1)) \
179 \
180 X(MockBoundsCheck, bool, dev_opt_flag, "mock-bounds-check", \
181 cl::desc("Mock bounds checking on loads/stores")) \
182 \
183 X(NopProbabilityAsPercentage, int, dev_opt_flag, "nop-insertion-percentage", \
184 cl::desc("Nop insertion probability as percentage"), cl::init(10)) \
185 \
186 X(OutFileType, Ice::FileType, dev_opt_flag, "filetype", \
187 cl::desc("Output file type"), cl::init(Ice::FT_Iasm), \
188 cl::values( \
189 clEnumValN(Ice::FT_Elf, "obj", "Native ELF object ('.o') file"), \
190 clEnumValN(Ice::FT_Asm, "asm", "Assembly ('.s') file"), \
191 clEnumValN(Ice::FT_Iasm, "iasm", \
192 "Low-level integrated assembly ('.s') file"), \
193 clEnumValEnd)) \
194 \
195 X(RandomizeAndPoolImmediatesOption, Ice::RandomizeAndPoolImmediatesEnum, \
196 dev_opt_flag, "randomize-pool-immediates", \
197 cl::desc("Randomize or pooling the representation of immediates"), \
198 cl::init(Ice::RPI_None), \
199 cl::values(clEnumValN(Ice::RPI_None, "none", \
200 "Do not randomize or pooling immediates (default)"), \
201 clEnumValN(Ice::RPI_Randomize, "randomize", \
202 "Turn on immediate constants blinding"), \
203 clEnumValN(Ice::RPI_Pool, "pool", \
204 "Turn on immediate constants pooling"), \
205 clEnumValEnd)) \
206 \
207 X(RandomizeAndPoolImmediatesThreshold, uint32_t, dev_opt_flag, \
208 "randomize-pool-threshold", \
209 cl::desc("The threshold for immediates randomization and pooling"), \
210 cl::init(0xffff)) \
211 \
212 X(RandomizeRegisterAllocation, bool, dev_opt_flag, "randomize-regalloc", \
213 cl::desc("Randomize register allocation"), cl::init(false)) \
214 \
215 X(RandomSeed, unsigned long long, dev_opt_flag, "sz-seed", \
216 cl::desc("Seed the random number generator"), cl::init(1)) \
217 \
218 X(RegAllocReserve, bool, dev_opt_flag, "reg-reserve", \
219 cl::desc("Let register allocation use reserve registers"), \
220 cl::init(false)) \
221 \
222 X(ReorderBasicBlocks, bool, dev_opt_flag, "reorder-basic-blocks", \
223 cl::desc("Shuffle the layout of basic blocks in each function"), \
224 cl::init(false)) \
225 \
226 X(ReorderFunctions, bool, dev_opt_flag, "reorder-functions", \
227 cl::desc("Randomize function ordering"), cl::init(false)) \
228 \
229 X(ReorderFunctionsWindowSize, uint32_t, dev_opt_flag, \
230 "reorder-functions-window-size", \
231 cl::desc( \
232 "The shuffling window size for function reordering. 1 or 0 means " \
233 "no effective shuffling."), \
234 cl::init(8)) \
235 \
236 X(ReorderGlobalVariables, bool, dev_opt_flag, "reorder-global-variables", \
237 cl::desc("Randomize global data ordering"), cl::init(false)) \
238 \
239 X(ReorderPooledConstants, bool, dev_opt_flag, "reorder-pooled-constants", \
240 cl::desc("Randomize constant pool entry ordering"), cl::init(false)) \
241 \
242 X(RepeatRegAlloc, bool, dev_opt_flag, "regalloc-repeat", \
243 cl::desc("Repeat register allocation until convergence"), cl::init(true)) \
244 \
245 X(ShouldDoNopInsertion, bool, dev_opt_flag, "nop-insertion", \
246 cl::desc("Randomly insert NOPs"), cl::init(false)) \
247 \
248 X(SkipUnimplemented, bool, dev_opt_flag, "skip-unimplemented", \
249 cl::desc("Skip through unimplemented lowering code instead of aborting."), \
250 cl::init(false)) \
251 \
252 X(SubzeroTimingEnabled, bool, dev_opt_flag, "timing", \
253 cl::desc("Enable breakdown timing of Subzero translation")) \
254 \
255 X(TargetInstructionSet, Ice::TargetInstructionSet, dev_opt_flag, "mattr", \
256 cl::desc("Target architecture attributes"), \
257 cl::init(Ice::BaseInstructionSet), \
258 cl::values( \
259 clEnumValN(Ice::BaseInstructionSet, "base", \
260 "Target chooses baseline instruction set (default)"), \
261 clEnumValN(Ice::X86InstructionSet_SSE2, "sse2", \
262 "Enable X86 SSE2 instructions"), \
263 clEnumValN(Ice::X86InstructionSet_SSE4_1, "sse4.1", \
264 "Enable X86 SSE 4.1 instructions"), \
265 clEnumValN(Ice::ARM32InstructionSet_Neon, "neon", \
266 "Enable ARM Neon instructions"), \
267 clEnumValN(Ice::ARM32InstructionSet_HWDivArm, "hwdiv-arm", \
268 "Enable ARM integer divide instructions in ARM mode"), \
269 clEnumValEnd)) \
270 \
271 X(TestPrefix, std::string, dev_opt_flag, "prefix", \
272 cl::desc("Prepend a prefix to symbol names for testing"), cl::init(""), \
273 cl::value_desc("prefix")) \
274 \
275 X(TestStackExtra, uint32_t, dev_opt_flag, "test-stack-extra", \
276 cl::desc("Extra amount of stack to add to the " \
277 "frame in bytes (for testing)."), \
278 cl::init(0)) \
279 \
280 X(TimeEachFunction, bool, dev_opt_flag, "timing-funcs", \
281 cl::desc("Print total translation time for each function")) \
282 \
283 X(TimingFocusOn, std::string, dev_opt_flag, "timing-focus", \
284 cl::desc("Break down timing for a specific function (use '*' for all)"), \
285 cl::init("")) \
286 \
287 X(TranslateOnly, std::string, dev_opt_flag, "translate-only", \
288 cl::desc("Translate only the given function"), cl::init("")) \
289 \
290 X(UseNonsfi, bool, dev_opt_flag, "nonsfi", cl::desc("Enable Non-SFI mode")) \
291 \
292 X(UseRestrictedRegisters, std::string, dev_list_flag, "reg-use", \
293 cl::CommaSeparated, \
294 cl::desc("Only use specified registers for corresponding register " \
295 "classes")) \
296 \
297 X(UseSandboxing, bool, dev_opt_flag, "sandbox", cl::desc("Use sandboxing")) \
298 \
299 X(Verbose, Ice::VerboseItem, dev_list_flag, "verbose", cl::CommaSeparated, \
300 cl::desc("Verbose options (can be comma-separated):"), \
301 cl::values( \
302 clEnumValN(Ice::IceV_Instructions, "inst", \
303 "Print basic instructions"), \
304 clEnumValN(Ice::IceV_Deleted, "del", "Include deleted instructions"), \
305 clEnumValN(Ice::IceV_InstNumbers, "instnum", \
306 "Print instruction numbers"), \
307 clEnumValN(Ice::IceV_Preds, "pred", "Show predecessors"), \
308 clEnumValN(Ice::IceV_Succs, "succ", "Show successors"), \
309 clEnumValN(Ice::IceV_Liveness, "live", "Liveness information"), \
310 clEnumValN(Ice::IceV_RegOrigins, "orig", "Physical register origins"), \
311 clEnumValN(Ice::IceV_LinearScan, "regalloc", "Linear scan details"), \
312 clEnumValN(Ice::IceV_Frame, "frame", "Stack frame layout details"), \
313 clEnumValN(Ice::IceV_AddrOpt, "addropt", "Address mode optimization"), \
314 clEnumValN(Ice::IceV_Random, "random", "Randomization details"), \
315 clEnumValN(Ice::IceV_Folding, "fold", "Instruction folding details"), \
316 clEnumValN(Ice::IceV_RMW, "rmw", "ReadModifyWrite optimization"), \
317 clEnumValN(Ice::IceV_Loop, "loop", "Loop nest depth analysis"), \
318 clEnumValN(Ice::IceV_Mem, "mem", "Memory usage details"), \
319 clEnumValN(Ice::IceV_Status, "status", \
320 "Print the name of the function being translated"), \
321 clEnumValN(Ice::IceV_AvailableRegs, "registers", \
322 "Show available registers for register allocation"), \
323 clEnumValN(Ice::IceV_GlobalInit, "global_init", \
324 "Global initializers"), \
325 clEnumValN(Ice::IceV_ConstPoolStats, "cpool", \
326 "Constant pool counters"), \
327 clEnumValN(Ice::IceV_All, "all", "Use all verbose options"), \
328 clEnumValN(Ice::IceV_Most, "most", \
329 "Use all verbose options except 'regalloc,global_init'"), \
330 clEnumValN(Ice::IceV_None, "none", "No verbosity"), clEnumValEnd)) \
331 \
332 X(VerboseFocusOn, std::string, dev_opt_flag, "verbose-focus", \
333 cl::desc("Override with -verbose=none except for the specified function"), \
334 cl::init(""))
335 //#define X(Name, Type, ClType, ...)
336
337 #endif // SUBZERO_SRC_ICECLFLAGS_DEF
OLDNEW
« src/IceClFlags.cpp ('K') | « src/IceClFlags.cpp ('k') | src/IceClFlagsExtra.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698