mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +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_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_CONTROL_FLOW_OPT", analysis_options.no_ZAM_control_flow_opt);
|
||||
check_env_opt("ZEEK_DUMP_ZAM", analysis_options.dump_ZAM);
|
||||
check_env_opt("ZEEK_PROFILE", analysis_options.profile_ZAM);
|
||||
|
||||
|
|
|
@ -72,6 +72,9 @@ struct AnalyOpt {
|
|||
// Deactivate the low-level ZAM optimizer.
|
||||
bool no_ZAM_opt = false;
|
||||
|
||||
// Deactivate ZAM optimization of control flow.
|
||||
bool no_ZAM_control_flow_opt = false;
|
||||
|
||||
// Produce a profile of ZAM execution.
|
||||
bool profile_ZAM = false;
|
||||
|
||||
|
|
|
@ -144,6 +144,9 @@ bool ZAMCompiler::RemoveDeadCode() {
|
|||
if ( ! i0->live )
|
||||
continue;
|
||||
|
||||
if ( analysis_options.no_ZAM_control_flow_opt )
|
||||
continue;
|
||||
|
||||
auto i1 = NextLiveInst(i0);
|
||||
|
||||
// Look for degenerate branches.
|
||||
|
@ -181,6 +184,9 @@ bool ZAMCompiler::RemoveDeadCode() {
|
|||
}
|
||||
|
||||
bool ZAMCompiler::CollapseGoTos() {
|
||||
if ( analysis_options.no_ZAM_control_flow_opt )
|
||||
return false;
|
||||
|
||||
bool did_change = false;
|
||||
|
||||
for ( auto& i0 : insts1 ) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue