mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
added "-O noinline" option to turn off ZAM inlining, to help with diagnosing optimization problems
This commit is contained in:
parent
1dc74eaa9c
commit
fadda05782
3 changed files with 12 additions and 0 deletions
|
@ -188,6 +188,7 @@ static void print_analysis_help() {
|
||||||
fprintf(stderr, " dump-ZAM dump generated ZAM code; implies gen-ZAM-code\n");
|
fprintf(stderr, " dump-ZAM dump generated ZAM code; implies gen-ZAM-code\n");
|
||||||
fprintf(stderr, " gen-ZAM-code generate ZAM code (without turning on additional optimizations)\n");
|
fprintf(stderr, " gen-ZAM-code generate ZAM code (without turning on additional optimizations)\n");
|
||||||
fprintf(stderr, " inline inline function calls\n");
|
fprintf(stderr, " inline inline function calls\n");
|
||||||
|
fprintf(stderr, " no-inline turn off inlining\n");
|
||||||
fprintf(stderr, " no-ZAM-opt omit low-level ZAM optimization\n");
|
fprintf(stderr, " no-ZAM-opt omit low-level ZAM optimization\n");
|
||||||
fprintf(stderr, " optimize-all optimize all scripts, even inlined ones\n");
|
fprintf(stderr, " optimize-all optimize all scripts, even inlined ones\n");
|
||||||
fprintf(stderr, " optimize-AST optimize the (transformed) AST; implies xform\n");
|
fprintf(stderr, " optimize-AST optimize the (transformed) AST; implies xform\n");
|
||||||
|
@ -235,6 +236,8 @@ static void set_analysis_option(const char* opt, Options& opts) {
|
||||||
a_o.activate = a_o.gen_ZAM_code = true;
|
a_o.activate = a_o.gen_ZAM_code = true;
|
||||||
else if ( util::streq(opt, "inline") )
|
else if ( util::streq(opt, "inline") )
|
||||||
a_o.inliner = true;
|
a_o.inliner = true;
|
||||||
|
else if ( util::streq(opt, "no-inline") )
|
||||||
|
a_o.no_inliner = true;
|
||||||
else if ( util::streq(opt, "no-ZAM-opt") )
|
else if ( util::streq(opt, "no-ZAM-opt") )
|
||||||
a_o.activate = a_o.no_ZAM_opt = true;
|
a_o.activate = a_o.no_ZAM_opt = true;
|
||||||
else if ( util::streq(opt, "optimize-all") )
|
else if ( util::streq(opt, "optimize-all") )
|
||||||
|
|
|
@ -256,6 +256,7 @@ static void init_options() {
|
||||||
check_env_opt("ZEEK_DUMP_XFORM", analysis_options.dump_xform);
|
check_env_opt("ZEEK_DUMP_XFORM", analysis_options.dump_xform);
|
||||||
check_env_opt("ZEEK_DUMP_UDS", analysis_options.dump_uds);
|
check_env_opt("ZEEK_DUMP_UDS", analysis_options.dump_uds);
|
||||||
check_env_opt("ZEEK_INLINE", analysis_options.inliner);
|
check_env_opt("ZEEK_INLINE", analysis_options.inliner);
|
||||||
|
check_env_opt("ZEEK_NO_INLINE", analysis_options.no_inliner);
|
||||||
check_env_opt("ZEEK_OPT", analysis_options.optimize_AST);
|
check_env_opt("ZEEK_OPT", analysis_options.optimize_AST);
|
||||||
check_env_opt("ZEEK_XFORM", analysis_options.activate);
|
check_env_opt("ZEEK_XFORM", analysis_options.activate);
|
||||||
check_env_opt("ZEEK_ZAM", analysis_options.gen_ZAM);
|
check_env_opt("ZEEK_ZAM", analysis_options.gen_ZAM);
|
||||||
|
@ -322,6 +323,9 @@ static void init_options() {
|
||||||
|
|
||||||
if ( analysis_options.optimize_AST || analysis_options.gen_ZAM_code || analysis_options.usage_issues > 0 )
|
if ( analysis_options.optimize_AST || analysis_options.gen_ZAM_code || analysis_options.usage_issues > 0 )
|
||||||
analysis_options.activate = true;
|
analysis_options.activate = true;
|
||||||
|
|
||||||
|
if ( analysis_options.no_inliner )
|
||||||
|
analysis_options.inliner = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void report_CPP() {
|
static void report_CPP() {
|
||||||
|
|
|
@ -50,6 +50,11 @@ struct AnalyOpt {
|
||||||
// If true, do global inlining.
|
// If true, do global inlining.
|
||||||
bool inliner = false;
|
bool inliner = false;
|
||||||
|
|
||||||
|
// If true, suppress global inlining. A separate option because
|
||||||
|
// it needs to override situations where "inliner" is implicitly
|
||||||
|
// enabled due to other options.
|
||||||
|
bool no_inliner = false;
|
||||||
|
|
||||||
// If true, report which functions are directly and indirectly
|
// If true, report which functions are directly and indirectly
|
||||||
// recursive, and exit. Only germane if running the inliner.
|
// recursive, and exit. Only germane if running the inliner.
|
||||||
bool report_recursive = false;
|
bool report_recursive = false;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue