Skip to content

Commit 7ec65fa

Browse files
committed
[mono][interp] Don't run any optimizations if we have cprop disabled
Before this commit, with all optimization disabled, some optimizations (that were dependent on cprop) were still being run.
1 parent b2b56ef commit 7ec65fa

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/mono/mono/mini/interp/transform-opt.c

+6-4
Original file line numberDiff line numberDiff line change
@@ -3841,6 +3841,10 @@ interp_optimize_code (TransformData *td)
38413841
if (mono_interp_opt & INTERP_OPT_BBLOCKS)
38423842
MONO_TIME_TRACK (mono_interp_stats.optimize_bblocks_time, interp_optimize_bblocks (td));
38433843

3844+
// Nothing to optimize if we don't have cprop enabled
3845+
if (!(mono_interp_opt & INTERP_OPT_CPROP))
3846+
return;
3847+
38443848
if (!(mono_interp_opt & INTERP_OPT_SSA))
38453849
td->disable_ssa = TRUE;
38463850

@@ -3864,15 +3868,13 @@ interp_optimize_code (TransformData *td)
38643868
else
38653869
MONO_TIME_TRACK (mono_interp_stats.ssa_compute_time, interp_compute_ssa (td));
38663870

3867-
if (mono_interp_opt & INTERP_OPT_CPROP)
3868-
MONO_TIME_TRACK (mono_interp_stats.cprop_time, interp_cprop (td));
3871+
MONO_TIME_TRACK (mono_interp_stats.cprop_time, interp_cprop (td));
38693872

38703873
interp_var_deadce (td);
38713874

38723875
// We run this after var deadce to detect more single use vars. This pass will clear
38733876
// unnecessary instruction on the fly so deadce is no longer needed to run.
3874-
if ((mono_interp_opt & INTERP_OPT_SUPER_INSTRUCTIONS) &&
3875-
(mono_interp_opt & INTERP_OPT_CPROP))
3877+
if (mono_interp_opt & INTERP_OPT_SUPER_INSTRUCTIONS)
38763878
MONO_TIME_TRACK (mono_interp_stats.super_instructions_time, interp_super_instructions (td));
38773879

38783880
if (!td->disable_ssa)

0 commit comments

Comments
 (0)