mirror of
https://github.com/zeek/zeek.git
synced 2025-10-04 15:48:19 +00:00
internal option to suppress control-flow optimization
This commit is contained in:
parent
63f76c7f84
commit
db22448270
3 changed files with 10 additions and 0 deletions
|
@ -271,6 +271,7 @@ static void init_options() {
|
||||||
check_env_opt("ZEEK_REPORT_UNCOMPILABLE", analysis_options.report_uncompilable);
|
check_env_opt("ZEEK_REPORT_UNCOMPILABLE", analysis_options.report_uncompilable);
|
||||||
check_env_opt("ZEEK_ZAM_CODE", analysis_options.gen_ZAM_code);
|
check_env_opt("ZEEK_ZAM_CODE", analysis_options.gen_ZAM_code);
|
||||||
check_env_opt("ZEEK_NO_ZAM_OPT", analysis_options.no_ZAM_opt);
|
check_env_opt("ZEEK_NO_ZAM_OPT", analysis_options.no_ZAM_opt);
|
||||||
|
check_env_opt("ZEEK_NO_ZAM_CONTROL_FLOW_OPT", analysis_options.no_ZAM_control_flow_opt);
|
||||||
check_env_opt("ZEEK_DUMP_ZAM", analysis_options.dump_ZAM);
|
check_env_opt("ZEEK_DUMP_ZAM", analysis_options.dump_ZAM);
|
||||||
check_env_opt("ZEEK_PROFILE", analysis_options.profile_ZAM);
|
check_env_opt("ZEEK_PROFILE", analysis_options.profile_ZAM);
|
||||||
|
|
||||||
|
|
|
@ -72,6 +72,9 @@ struct AnalyOpt {
|
||||||
// Deactivate the low-level ZAM optimizer.
|
// Deactivate the low-level ZAM optimizer.
|
||||||
bool no_ZAM_opt = false;
|
bool no_ZAM_opt = false;
|
||||||
|
|
||||||
|
// Deactivate ZAM optimization of control flow.
|
||||||
|
bool no_ZAM_control_flow_opt = false;
|
||||||
|
|
||||||
// Produce a profile of ZAM execution.
|
// Produce a profile of ZAM execution.
|
||||||
bool profile_ZAM = false;
|
bool profile_ZAM = false;
|
||||||
|
|
||||||
|
|
|
@ -144,6 +144,9 @@ bool ZAMCompiler::RemoveDeadCode() {
|
||||||
if ( ! i0->live )
|
if ( ! i0->live )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
if ( analysis_options.no_ZAM_control_flow_opt )
|
||||||
|
continue;
|
||||||
|
|
||||||
auto i1 = NextLiveInst(i0);
|
auto i1 = NextLiveInst(i0);
|
||||||
|
|
||||||
// Look for degenerate branches.
|
// Look for degenerate branches.
|
||||||
|
@ -181,6 +184,9 @@ bool ZAMCompiler::RemoveDeadCode() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ZAMCompiler::CollapseGoTos() {
|
bool ZAMCompiler::CollapseGoTos() {
|
||||||
|
if ( analysis_options.no_ZAM_control_flow_opt )
|
||||||
|
return false;
|
||||||
|
|
||||||
bool did_change = false;
|
bool did_change = false;
|
||||||
|
|
||||||
for ( auto& i0 : insts1 ) {
|
for ( auto& i0 : insts1 ) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue