2 * @file firm_cmdline.h -- Additional Firm generating backend parameters
4 * Generates Firm fro the IL. It works with both C++ and C programs.
6 * Compile with STANDALONE_CP_FIRM_BE defined and BACK_END_IS_CP_FIRM_BE
7 * defined as 1 to get a main program back end. Otherwise, a version to be
8 * called in the same program as the front end is produced (if needed).
10 #ifndef FIRM_CMDLINE_H
11 #define FIRM_CMDLINE_H
13 #include "fe_common.h"
16 DBG_MODE_NONE = 0, /**< no special debug support */
17 DBG_MODE_BACKSTORE = 1, /**< backstores are created */
18 DBG_MODE_FULL = 2, /**< no register valiables */
21 /* optimization settings */
23 a_byte enabled; /**< enable all optimizations */
24 a_byte debug_mode; /**< debug mode: store all local variables */
25 a_byte const_folding; /**< enable constant folding */
26 a_byte cse; /**< enable common-subexpression elimination */
27 a_byte gcse; /**< enable global common-subexpression elimination */
28 a_byte confirm; /**< enable Confirm optimization */
29 a_byte muls; /**< enable architecture dependent mul optimization */
30 a_byte divs; /**< enable architecture dependent div optimization */
31 a_byte mods; /**< enable architecture dependent mod optimization */
32 a_byte alias_analysis; /**< enable Alias Analysis */
33 a_byte strict_alias; /**< enable strict Alias Analysis (using type based AA) */
34 a_byte no_alias; /**< no aliasing possible. */
35 a_byte cc_opt; /**< optimize calling conventions */
36 a_byte fp_model; /**< fp model */
37 a_byte verify; /**< Firm verifier setting */
38 a_byte check_all; /**< enable checking all Firm phases */
39 a_byte lower; /**< enable Firm lowering */
40 a_byte honor_restrict; /**< enable restrict keyword */
41 a_byte lower_bitfields; /**< lower bitfield access */
42 a_byte pic; /**< generate position independent code */
43 int clone_threshold; /**< The threshold value for procedure cloning. */
44 unsigned inline_maxsize; /**< Maximum function size for inlining. */
45 unsigned inline_threshold;/**< Inlining benefice threshold. */
46 a_byte verify_edges; /**< verify edges */
48 a_byte grs_create_pattern;
49 a_byte enable_statev; /**< enable statev output */
50 char *statev_filter; /**< statev filter */
53 /** statistic options */
54 typedef enum a_firmstat_selection_tag {
55 STAT_NONE = 0x00000000,
56 STAT_BEFORE_OPT = 0x00000001,
57 STAT_AFTER_OPT = 0x00000002,
58 STAT_AFTER_LOWER = 0x00000004,
59 STAT_FINAL_IR = 0x00000008,
60 STAT_FINAL = 0x00000010,
61 } a_firmstat_selection;
63 /* backend selection */
64 typedef enum a_backend_selection_tag {
65 BE_NONE = 0, /**< no backend */
66 BE_FIRM_BE = 1, /**< Use Firm internal backend facility. */
67 BE_FIRM2C = 2 /**< Use generic Firm2C backend */
68 } a_backend_selection;
72 a_byte debug_print; /**< enable debug print */
73 a_byte all_types; /**< dump the All_types graph */
74 a_byte no_blocks; /**< dump non-blocked graph */
75 a_byte extbb; /**< dumps extended basic blocks */
76 a_byte ir_graph; /**< dump all graphs */
77 a_byte all_phases; /**< dump the IR graph after all phases */
78 a_byte statistic; /**< Firm statistic setting */
79 a_byte stat_pattern; /**< enable Firm statistic pattern */
80 a_byte stat_dag; /**< enable Firm DAG statistic */
81 char *filter; /**< the dump filter */
84 struct a_firm_be_opt {
90 struct a_firm_ext_grs {
91 a_byte simd_opt; /**< enable graph based SIMD optimization */
92 a_byte create_pattern; /**< enable pattern creation for SIMD opts */
97 extern struct a_firm_be_opt firm_be_opt;
98 extern struct a_firm_opt firm_opt;
99 extern struct a_firm_dump firm_dump;
100 extern struct a_firm_ext_grs firm_ext_grs;
102 void print_option_help(const char *name, const char *description);
105 * prints the firm version number
107 void print_firm_version(FILE *f);
110 * called by the generic command line parser
111 * to handle the --firm= or -f options
113 int firm_option(const char *opt);