• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #include "driver_options.h"
17 
18 #include <cstdint>
19 #include <string>
20 
21 namespace opts::cg {
22 
23 maplecl::Option<bool> pie({"-fPIE", "--pie", "-pie"},
24                           "  --pie                       \tGenerate position-independent executable\n"
25                           "  --no-pie\n",
26                           {cgCategory, driverCategory, ldCategory}, maplecl::DisableWith("--no-pie"));
27 
28 maplecl::Option<bool> fpic({"-fPIC", "--fpic", "-fpic"},
29                            "  --fpic                      \tGenerate position-independent shared library\n"
30                            "  --no-fpic\n",
31                            {cgCategory, driverCategory, ldCategory}, maplecl::DisableWith("--no-fpic"));
32 
33 maplecl::Option<bool> verboseAsm({"--verbose-asm"},
34                                  "  --verbose-asm               \tAdd comments to asm output\n"
35                                  "  --no-verbose-asm\n",
36                                  {cgCategory}, maplecl::DisableWith("--no-verbose-asm"));
37 
38 maplecl::Option<bool> verboseCg({"--verbose-cg"},
39                                 "  --verbose-cg               \tAdd comments to cg output\n"
40                                 "  --no-verbose-cg\n",
41                                 {cgCategory}, maplecl::DisableWith("--no-verbose-cg"));
42 
43 maplecl::Option<bool> maplelinker({"--maplelinker"},
44                                   "  --maplelinker               \tGenerate the MapleLinker .s format\n"
45                                   "  --no-maplelinker\n",
46                                   {cgCategory}, maplecl::DisableWith("--no-maplelinker"));
47 
48 maplecl::Option<bool> quiet({"--quiet"},
49                             "  --quiet                     \tBe quiet (don't output debug messages)\n"
50                             "  --no-quiet\n",
51                             {cgCategory}, maplecl::DisableWith("--no-quiet"));
52 
53 maplecl::Option<bool> cg({"--cg"},
54                          "  --cg                        \tGenerate the output .s file\n"
55                          "  --no-cg\n",
56                          {cgCategory}, maplecl::DisableWith("--no-cg"));
57 
58 maplecl::Option<bool> replaceAsm({"--replaceasm"},
59                                  "  --replaceasm                \tReplace the the assembly code\n"
60                                  "  --no-replaceasm\n",
61                                  {cgCategory}, maplecl::DisableWith("--no-replaceasm"));
62 
63 maplecl::Option<bool> supportFuncSymbol({"--enable-func-symbol"},
64                                 "  --enable-func-symbol               \tenable function symbols in symbol table\n"
65                                 "  --disable-func-symbol\n",
66                                 {cgCategory}, maplecl::DisableWith("--disable-func-symbol"));
67 
68 maplecl::Option<bool> generalRegOnly(
69     {"--general-reg-only"},
70     " --general-reg-only           \tdisable floating-point or Advanced SIMD registers\n"
71     " --no-general-reg-only\n",
72     {cgCategory}, maplecl::DisableWith("--no-general-reg-only"));
73 
74 maplecl::Option<bool> lazyBinding({"--lazy-binding"},
75                                   "  --lazy-binding              \tBind class symbols lazily[default off]\n",
76                                   {cgCategory}, maplecl::DisableWith("--no-lazy-binding"));
77 
78 maplecl::Option<bool> hotFix({"--hot-fix"},
79                              "  --hot-fix                   \tOpen for App hot fix[default off]\n"
80                              "  --no-hot-fix\n",
81                              {cgCategory}, maplecl::DisableWith("--no-hot-fix"));
82 
83 maplecl::Option<bool> ebo({"--ebo"},
84                           "  --ebo                       \tPerform Extend block optimization\n"
85                           "  --no-ebo\n",
86                           {cgCategory}, maplecl::DisableWith("--no-ebo"));
87 
88 maplecl::Option<bool> cfgo({"--cfgo"},
89                            "  --cfgo                      \tPerform control flow optimization\n"
90                            "  --no-cfgo\n",
91                            {cgCategory}, maplecl::DisableWith("--no-cfgo"));
92 
93 maplecl::Option<bool> ico({"--ico"},
94                           "  --ico                       \tPerform if-conversion optimization\n"
95                           "  --no-ico\n",
96                           {cgCategory}, maplecl::DisableWith("--no-ico"));
97 
98 maplecl::Option<bool> storeloadopt({"--storeloadopt"},
99                                    "  --storeloadopt              \tPerform global store-load optimization\n"
100                                    "  --no-storeloadopt\n",
101                                    {cgCategory}, maplecl::DisableWith("--no-storeloadopt"));
102 
103 maplecl::Option<bool> globalopt({"--globalopt"},
104                                 "  --globalopt                 \tPerform global optimization\n"
105                                 "  --no-globalopt\n",
106                                 {cgCategory}, maplecl::DisableWith("--no-globalopt"));
107 
108 maplecl::Option<bool> hotcoldsplit({"--hotcoldsplit"},
109                                    "  --hotcoldsplit        \tPerform HotColdSplit optimization\n"
110                                    "  --no-hotcoldsplit\n",
111                                    {cgCategory}, maplecl::DisableWith("--no-hotcoldsplit"));
112 
113 maplecl::Option<bool> prelsra({"--prelsra"},
114                               "  --prelsra                   \tPerform live interval simplification in LSRA\n"
115                               "  --no-prelsra\n",
116                               {cgCategory}, maplecl::DisableWith("--no-prelsra"));
117 
118 maplecl::Option<bool> calleeregsPlacement(
119     {"--calleeregs-placement"},
120     "  --calleeregs-placement      \tOptimize placement of callee-save registers\n"
121     "  --no-calleeregs-placement\n",
122     {cgCategory}, maplecl::DisableWith("--no-calleeregs-placement"));
123 
124 maplecl::Option<bool> ssapreSave({"--ssapre-save"},
125                                  "  --ssapre-save                \tUse ssapre algorithm to save callee-save registers\n"
126                                  "  --no-ssapre-save\n",
127                                  {cgCategory}, maplecl::DisableWith("--no-ssapre-save"));
128 
129 maplecl::Option<bool> ssupreRestore({"--ssupre-restore"},
130                                     "  --ssupre-restore"
131                                     "             \tUse ssupre algorithm to restore callee-save registers\n"
132                                     "  --no-ssupre-restore\n",
133                                     {cgCategory}, maplecl::DisableWith("--no-ssupre-restore"));
134 
135 maplecl::Option<bool> prepeep({"--prepeep"},
136                               "  --prepeep                   \tPerform peephole optimization before RA\n"
137                               "  --no-prepeep\n",
138                               {cgCategory}, maplecl::DisableWith("--no-prepeep"));
139 
140 maplecl::Option<bool> peep({"--peep"},
141                            "  --peep                      \tPerform peephole optimization after RA\n"
142                            "  --no-peep\n",
143                            {cgCategory}, maplecl::DisableWith("--no-peep"));
144 
145 maplecl::Option<bool> preschedule({"--preschedule"},
146                                   "  --preschedule               \tPerform prescheduling\n"
147                                   "  --no-preschedule\n",
148                                   {cgCategory}, maplecl::DisableWith("--no-preschedule"));
149 
150 maplecl::Option<bool> schedule({"--schedule"},
151                                "  --schedule                  \tPerform scheduling\n"
152                                "  --no-schedule\n",
153                                {cgCategory}, maplecl::DisableWith("--no-schedule"));
154 
155 maplecl::Option<bool> retMerge({"--ret-merge"},
156                                "  --ret-merge                 \tMerge return bb into a single destination\n"
157                                "  --no-ret-merge              \tallows for multiple return bb\n",
158                                {cgCategory}, maplecl::DisableWith("--no-ret-merge"));
159 
160 maplecl::Option<bool> vregRename({"--vreg-rename"},
161                                  "  --vreg-rename"
162                                  "                  \tPerform rename of long live range around loops in coloring RA\n"
163                                  "  --no-vreg-rename\n",
164                                  {cgCategory}, maplecl::DisableWith("--no-vreg-rename"));
165 
166 maplecl::Option<bool> fullcolor({"--fullcolor"},
167                                 "  --fullcolor                  \tPerform multi-pass coloring RA\n"
168                                 "  --no-fullcolor\n",
169                                 {cgCategory}, maplecl::DisableWith("--no-fullcolor"));
170 
171 maplecl::Option<bool> writefieldopt({"--writefieldopt"},
172                                     "  --writefieldopt                  \tPerform WriteRefFieldOpt\n"
173                                     "  --no-writefieldopt\n",
174                                     {cgCategory}, maplecl::DisableWith("--no-writefieldopt"));
175 
176 maplecl::Option<bool> dumpOlog({"--dump-olog"},
177                                "  --dump-olog                 \tDump CFGO and ICO debug information\n"
178                                "  --no-dump-olog\n",
179                                {cgCategory}, maplecl::DisableWith("--no-dump-olog"));
180 
181 maplecl::Option<bool> nativeopt({"--nativeopt"},
182                                 "  --nativeopt                 \tEnable native opt\n"
183                                 "  --no-nativeopt\n",
184                                 {cgCategory}, maplecl::DisableWith("--no-nativeopt"));
185 
186 maplecl::Option<bool> objmap({"--objmap"},
187                              "  --objmap"
188                              "                    \tCreate object maps (GCTIBs) inside the main output (.s) file\n"
189                              "  --no-objmap\n",
190                              {cgCategory}, maplecl::DisableWith("--no-objmap"));
191 
192 maplecl::Option<bool> yieldpoint({"--yieldpoint"},
193                                  "  --yieldpoint                \tGenerate yieldpoints [default]\n"
194                                  "  --no-yieldpoint\n",
195                                  {cgCategory}, maplecl::DisableWith("--no-yieldpoint"));
196 
197 maplecl::Option<bool> proepilogue({"--proepilogue"},
198                                   "  --proepilogue               \tDo tail call optimization and"
199                                   " eliminate unnecessary prologue and epilogue.\n"
200                                   "  --no-proepilogue\n",
201                                   {cgCategory}, maplecl::DisableWith("--no-proepilogue"));
202 
203 maplecl::Option<bool> localRc({"--local-rc"},
204                               "  --local-rc                  \tHandle Local Stack RC [default]\n"
205                               "  --no-local-rc\n",
206                               {cgCategory}, maplecl::DisableWith("--no-local-rc"));
207 
208 maplecl::Option<std::string> insertCall({"--insert-call"},
209                                         "  --insert-call=name          \tInsert a call to the named function\n",
210                                         {cgCategory});
211 
212 maplecl::Option<bool> addDebugTrace({"--add-debug-trace"},
213                                     "  --add-debug-trace"
214                                     "           \tInstrument the output .s file to print call traces at runtime\n",
215                                     {cgCategory});
216 
217 maplecl::Option<bool> addFuncProfile({"--add-func-profile"},
218                                      "  --add-func-profile"
219                                      "          \tInstrument the output .s file to record func at runtime\n",
220                                      {cgCategory});
221 
222 maplecl::Option<std::string> classListFile(
223     {"--class-list-file"},
224     "  --class-list-file"
225     "           \tSet the class list file for the following generation options,\n"
226     "                              \tif not given, "
227     "generate for all visible classes\n"
228     "                              \t--class-list-file=class_list_file\n",
229     {cgCategory});
230 
231 maplecl::Option<bool> genCMacroDef(
232     {"--gen-c-macro-def"},
233     "  --gen-c-macro-def"
234     "           \tGenerate a .def file that contains extra type metadata, including the\n"
235     "                              \tclass instance sizes and field offsets (default)\n"
236     "  --no-gen-c-macro-def\n",
237     {cgCategory}, maplecl::DisableWith("--no-gen-c-macro-def"));
238 
239 maplecl::Option<bool> genGctibFile({"--gen-gctib-file"},
240                                    "  --gen-gctib-file"
241                                    "            \tGenerate a separate .s file for GCTIBs. Usually used together with\n"
242                                    "                              \t--no-objmap (not implemented yet)\n"
243                                    "  --no-gen-gctib-file\n",
244                                    {cgCategory}, maplecl::DisableWith("--no-gen-gctib-file"));
245 
246 maplecl::Option<bool> stackProtectorStrong(
247     {"--stack-protector-strong", "-fstack-protector", "-fstack-protector-strong"},
248     "  --stack-protector-strong                \tadd stack guard for some function \n"
249     "  --no-stack-protector-strong \n",
250     {cgCategory, driverCategory}, maplecl::DisableEvery({"--no-stack-protector-strong", "-fno-stack-protector"}));
251 
252 maplecl::Option<bool> stackProtectorAll({"--stack-protector-all"},
253                                         "  --stack-protector-all                 \tadd stack guard for all functions \n"
254                                         "  --no-stack-protector-all\n",
255                                         {cgCategory}, maplecl::DisableWith("--no-stack-protector-all"));
256 
257 maplecl::Option<bool> debug({"-g", "--g"}, "  -g                          \tGenerate debug information\n",
258                             {cgCategory});
259 
260 maplecl::Option<bool> gdwarf({"--gdwarf"}, "  --gdwarf                    \tGenerate dwarf infomation\n", {cgCategory});
261 
262 maplecl::Option<bool> gsrc(
263     {"--gsrc"}, "  --gsrc                      \tUse original source file instead of mpl file for debugging\n",
264     {cgCategory});
265 
266 maplecl::Option<bool> gmixedsrc({"--gmixedsrc"},
267                                 "  --gmixedsrc"
268                                 "                 \tUse both original source file and mpl file for debugging\n",
269                                 {cgCategory});
270 
271 maplecl::Option<bool> gmixedasm({"--gmixedasm"},
272                                 "  --gmixedasm"
273                                 "                 \tComment out both original source file and mpl file for debugging\n",
274                                 {cgCategory});
275 
276 maplecl::Option<bool> profile({"--p", "-p"}, "  -p                          \tGenerate profiling infomation\n",
277                               {cgCategory});
278 
279 maplecl::Option<bool> withRaLinearScan({"--with-ra-linear-scan"},
280                                        "  --with-ra-linear-scan       \tDo linear-scan register allocation\n",
281                                        {cgCategory});
282 
283 maplecl::Option<bool> withRaGraphColor({"--with-ra-graph-color"},
284                                        "  --with-ra-graph-color       \tDo coloring-based register allocation\n",
285                                        {cgCategory});
286 
287 maplecl::Option<bool> patchLongBranch({"--patch-long-branch"},
288                                       "  --patch-long-branch"
289                                       "         \tEnable patching long distance branch with jumping pad\n",
290                                       {cgCategory});
291 
292 maplecl::Option<bool> constFold({"--const-fold"},
293                                 "  --const-fold                \tEnable constant folding\n"
294                                 "  --no-const-fold\n",
295                                 {cgCategory}, maplecl::DisableWith("--no-const-fold"));
296 
297 maplecl::Option<std::string> ehExclusiveList(
298     {"--eh-exclusive-list"},
299     "  --eh-exclusive-list         \tFor generating gold files in unit testing\n"
300     "                              \t--eh-exclusive-list=list_file\n",
301     {cgCategory});
302 
303 maplecl::Option<bool> o0({"-O0", "--O0"}, "  -O0                         \tNo optimization.\n", {cgCategory});
304 
305 maplecl::Option<bool> o1({"-O1", "--O1"}, "  -O1                         \tDo some optimization.\n", {cgCategory});
306 
307 maplecl::Option<bool> o2({"-O2", "--O2"}, "  -O2                          \tDo some optimization.\n", {cgCategory});
308 
309 maplecl::Option<bool> os({"-Os", "--Os"}, "  -Os                          \tOptimize for size, based on O2.\n",
310                          {cgCategory});
311 
312 maplecl::Option<bool> olitecg({"-Olitecg", "--Olitecg"}, " -Olitecg                       \tOptimize for litecg.\n",
313                               {cgCategory});
314 
315 maplecl::Option<uint64_t> lsraBb({"--lsra-bb"},
316                                  "  --lsra-bb=NUM"
317                                  "               \tSwitch to spill mode if number of bb in function exceeds NUM\n",
318                                  {cgCategory});
319 
320 maplecl::Option<uint64_t> lsraInsn(
321     {"--lsra-insn"},
322     "  --lsra-insn=NUM"
323     "             \tSwitch to spill mode if number of instructons in function exceeds NUM\n",
324     {cgCategory});
325 
326 maplecl::Option<uint64_t> lsraOverlap({"--lsra-overlap"},
327                                       "  --lsra-overlap=NUM          \toverlap NUM to decide pre spill in lsra\n",
328                                       {cgCategory});
329 
330 maplecl::Option<uint8_t> remat({"--remat"},
331                                "  --remat                     \tEnable rematerialization during register allocation\n"
332                                "                              \t     0: no rematerialization (default)\n"
333                                "                              \t  >= 1: rematerialize constants\n"
334                                "                              \t  >= 2: rematerialize addresses\n"
335                                "                              \t  >= 3: rematerialize local dreads\n"
336                                "                              \t  >= 4: rematerialize global dreads\n",
337                                {cgCategory});
338 
339 maplecl::Option<bool> suppressFileinfo({"--suppress-fileinfo"},
340                                        "  --suppress-fileinfo         \tFor generating gold files in unit testing\n",
341                                        {cgCategory});
342 
343 maplecl::Option<bool> dumpCfg({"--dump-cfg"}, "  --dump-cfg\n", {cgCategory});
344 
345 maplecl::Option<std::string> target({"--target"}, "  --target=TARGETMACHINE \t generate code for TARGETMACHINE\n",
346                                     {cgCategory}, maplecl::optionalValue);
347 
348 maplecl::Option<std::string> dumpPhases({"--dump-phases"},
349                                         "  --dump-phases=PHASENAME,..."
350                                         " \tEnable debug trace for specified phases in the comma separated list\n",
351                                         {cgCategory});
352 
353 maplecl::Option<std::string> skipPhases({"--skip-phases"},
354                                         "  --skip-phases=PHASENAME,..."
355                                         " \tSkip the phases specified in the comma separated list\n",
356                                         {cgCategory});
357 
358 maplecl::Option<std::string> skipFrom({"--skip-from"},
359                                       "  --skip-from=PHASENAME       \tSkip the rest phases from PHASENAME(included)\n",
360                                       {cgCategory});
361 
362 maplecl::Option<std::string> skipAfter(
363     {"--skip-after"}, "  --skip-after=PHASENAME      \tSkip the rest phases after PHASENAME(excluded)\n", {cgCategory});
364 
365 maplecl::Option<std::string> dumpFunc(
366     {"--dump-func"},
367     "  --dump-func=FUNCNAME"
368     "        \tDump/trace only for functions whose names contain FUNCNAME as substring\n"
369     "                              \t(can only specify once)\n",
370     {cgCategory});
371 
372 maplecl::Option<bool> timePhases(
373     {"--time-phases"},
374     "  --time-phases               \tCollect compilation time stats for each phase\n"
375     "  --no-time-phases            \tDon't Collect compilation time stats for each phase\n",
376     {cgCategory}, maplecl::DisableWith("--no-time-phases"));
377 
378 maplecl::Option<bool> useBarriersForVolatile({"--use-barriers-for-volatile"},
379                                              "  --use-barriers-for-volatile \tOptimize volatile load/str\n"
380                                              "  --no-use-barriers-for-volatile\n",
381                                              {cgCategory}, maplecl::DisableWith("--no-use-barriers-for-volatile"));
382 
383 maplecl::Option<std::string> range(
384     {"--range"}, "  --range=NUM0,NUM1           \tOptimize only functions in the range [NUM0, NUM1]\n", {cgCategory});
385 
386 maplecl::Option<uint8_t> fastAlloc({"--fast-alloc"},
387                                    "  --fast-alloc=[0/1]          \tO2 RA fast mode, set to 1 to spill all registers\n",
388                                    {cgCategory});
389 
390 maplecl::Option<std::string> spillRange(
391     {"--spill_range"}, "  --spill_range=NUM0,NUM1     \tO2 RA spill registers in the range [NUM0, NUM1]\n",
392     {cgCategory});
393 
394 maplecl::Option<bool> dupBb({"--dup-bb"},
395                             "  --dup-bb                 \tAllow cfg optimizer to duplicate bb\n"
396                             "  --no-dup-bb              \tDon't allow cfg optimizer to duplicate bb\n",
397                             {cgCategory}, maplecl::DisableWith("--no-dup-bb"));
398 
399 maplecl::Option<bool> calleeCfi({"--callee-cfi"},
400                                 "  --callee-cfi                \tcallee cfi message will be generated\n"
401                                 "  --no-callee-cfi             \tcallee cfi message will not be generated\n",
402                                 {cgCategory}, maplecl::DisableWith("--no-callee-cfi"));
403 
404 maplecl::Option<bool> printFunc({"--print-func"},
405                                 "  --print-func\n"
406                                 "  --no-print-func\n",
407                                 {cgCategory}, maplecl::DisableWith("--no-print-func"));
408 
409 maplecl::Option<std::string> cyclePatternList({"--cycle-pattern-list"},
410                                               "  --cycle-pattern-list        \tFor generating cycle pattern meta\n"
411                                               "                              \t--cycle-pattern-list=list_file\n",
412                                               {cgCategory});
413 
414 maplecl::Option<std::string> duplicateAsmList(
415     {"--duplicate_asm_list"},
416     "  --duplicate_asm_list        \tDuplicate asm functions to delete plt call\n"
417     "                              \t--duplicate_asm_list=list_file\n",
418     {cgCategory});
419 
420 maplecl::Option<std::string> duplicateAsmList2({"--duplicate_asm_list2"},
421                                                "  --duplicate_asm_list2"
422                                                "       \tDuplicate more asm functions to delete plt call\n"
423                                                "                              \t--duplicate_asm_list2=list_file\n",
424                                                {cgCategory});
425 
426 maplecl::Option<std::string> blockMarker({"--block-marker"},
427                                          "  --block-marker"
428                                          "              \tEmit block marker symbols in emitted assembly files\n",
429                                          {cgCategory});
430 
431 maplecl::Option<bool> soeCheck({"--soe-check"},
432                                "  --soe-check                 \tInsert a soe check instruction[default off]\n",
433                                {cgCategory});
434 
435 maplecl::Option<bool> checkArraystore({"--check-arraystore"},
436                                       "  --check-arraystore          \tcheck arraystore exception[default off]\n"
437                                       "  --no-check-arraystore\n",
438                                       {cgCategory}, maplecl::DisableWith("--no-check-arraystore"));
439 
440 maplecl::Option<bool> debugSchedule({"--debug-schedule"},
441                                     "  --debug-schedule            \tdump scheduling information\n"
442                                     "  --no-debug-schedule\n",
443                                     {cgCategory}, maplecl::DisableWith("--no-debug-schedule"));
444 
445 maplecl::Option<bool> bruteforceSchedule({"--bruteforce-schedule"},
446                                          "  --bruteforce-schedule       \tdo brute force schedule\n"
447                                          "  --no-bruteforce-schedule\n",
448                                          {cgCategory}, maplecl::DisableWith("--no-bruteforce-schedule"));
449 
450 maplecl::Option<bool> simulateSchedule({"--simulate-schedule"},
451                                        "  --simulate-schedule         \tdo simulate schedule\n"
452                                        "  --no-simulate-schedule\n",
453                                        {cgCategory}, maplecl::DisableWith("--no-simulate-schedule"));
454 
455 maplecl::Option<bool> crossLoc({"--cross-loc"},
456                                "  --cross-loc                 \tcross loc insn schedule\n"
457                                "  --no-cross-loc\n",
458                                {cgCategory}, maplecl::DisableWith("--no-cross-loc"));
459 
460 maplecl::Option<std::string> floatAbi({"--float-abi"},
461                                       "  --float-abi=name            \tPrint the abi type.\n"
462                                       "                              \tname=hard: abi-hard (Default)\n"
463                                       "                              \tname=soft: abi-soft\n"
464                                       "                              \tname=softfp: abi-softfp\n",
465                                       {cgCategory});
466 
467 maplecl::Option<std::string> filetype({"--filetype"},
468                                       "  --filetype=name             \tChoose a file type.\n"
469                                       "                              \tname=asm: Emit an assembly file (Default)\n"
470                                       "                              \tname=obj: Emit an object file\n"
471                                       "                              \tname=null: not support yet\n",
472                                       {cgCategory});
473 
474 maplecl::Option<bool> longCalls({"--long-calls"},
475                                 "  --long-calls                \tgenerate long call\n"
476                                 "  --no-long-calls\n",
477                                 {cgCategory}, maplecl::DisableWith("--no-long-calls"));
478 
479 maplecl::Option<bool> functionSections({"--function-sections"},
480                                        " --function-sections           \t \n"
481                                        "  --no-function-sections\n",
482                                        {cgCategory}, maplecl::DisableWith("--no-function-sections"));
483 
484 maplecl::Option<bool> omitFramePointer({"--omit-frame-pointer", "-fomit-frame-pointer"},
485                                        " --omit-frame-pointer          \t do not use frame pointer \n"
486                                        " --no-omit-frame-pointer\n",
487                                        {cgCategory, driverCategory},
488                                        maplecl::DisableEvery({"--no-omit-frame-pointer", "-fno-omit-frame-pointer"}));
489 
490 maplecl::Option<bool> fastMath({"--fast-math"},
491                                "  --fast-math                  \tPerform fast math\n"
492                                "  --no-fast-math\n",
493                                {cgCategory}, maplecl::DisableWith("--no-fast-math"));
494 
495 maplecl::Option<bool> tailcall({"--tailcall"},
496                                "  --tailcall                   \tDo tail call optimization\n"
497                                "  --no-tailcall\n",
498                                {cgCategory}, maplecl::DisableWith("--no-tailcall"));
499 
500 maplecl::Option<bool> alignAnalysis({"--align-analysis"},
501                                     "  --align-analysis                 \tPerform alignanalysis\n"
502                                     "  --no-align-analysis\n",
503                                     {cgCategory}, maplecl::DisableWith("--no-align-analysis"));
504 
505 maplecl::Option<bool> cgSsa({"--cg-ssa"},
506                             "  --cg-ssa                     \tPerform cg ssa\n"
507                             "  --no-cg-ssa\n",
508                             {cgCategory}, maplecl::DisableWith("--no-cg-ssa"));
509 
510 maplecl::Option<bool> common({"--common", "-fcommon"},
511                              " --common           \t \n"
512                              " --no-common\n",
513                              {cgCategory, driverCategory}, maplecl::DisableEvery({"--no-common", "-fno-common"}));
514 
515 maplecl::Option<bool> condbrAlign({"--condbr-align"},
516                                   "  --condbr-align                   \tPerform condbr align\n"
517                                   "  --no-condbr-align\n",
518                                   {cgCategory}, maplecl::DisableWith("--no-condbr-align"));
519 
520 maplecl::Option<bool> optimizedFrameLayout({"--optimized-frame-layout"},
521                                            "  --optimized-frame-layout         \tEnable optimezed framelayout, "
522                                            "put small local variables near sp, put callee save region near sp\n",
523                                            {cgCategory}, maplecl::DisableWith("--no-optimized-frame-layout"));
524 
525 maplecl::Option<uint32_t> alignMinBbSize({"--align-min-bb-size"},
526                                          " --align-min-bb-size=NUM"
527                                          "           \tO2 Minimum bb size for alignment   unit:byte\n",
528                                          {cgCategory});
529 
530 maplecl::Option<uint32_t> alignMaxBbSize({"--align-max-bb-size"},
531                                          " --align-max-bb-size=NUM"
532                                          "           \tO2 Maximum bb size for alignment   unit:byte\n",
533                                          {cgCategory});
534 
535 maplecl::Option<uint32_t> loopAlignPow(
536     {"--loop-align-pow"}, " --loop-align-pow=NUM           \tO2 loop bb align pow (NUM == 0, no loop-align)\n",
537     {cgCategory});
538 
539 maplecl::Option<uint32_t> jumpAlignPow(
540     {"--jump-align-pow"}, " --jump-align-pow=NUM           \tO2 jump bb align pow (NUM == 0, no jump-align)\n",
541     {cgCategory});
542 
543 maplecl::Option<uint32_t> funcAlignPow(
544     {"--func-align-pow"}, " --func-align-pow=NUM           \tO2 func bb align pow (NUM == 0, no func-align)\n",
545     {cgCategory});
546 }  // namespace opts::cg
547