[Mono-dev] [PATCH] A "fastpath" dead code elimination

Ben Maurer bmaurer at ximian.com
Tue Nov 15 16:54:43 EST 2005


On Tue, 2005-11-15 at 15:14 -0500, Miguel de Icaza wrote:
> Hello,
> 
> > The alias analysis pass has O(n) complexity (n = code size), it is
> > just a linear sweep on the list of instructions.
> > Then, deadce operates one BB at a time, scanning the code linearly
> > and using the liveness bits as start/end conditions (so it is O(n)
> > as well).
> 
> Is there is a threshold that will disable the optimization from running?

Massi's code is inside:

        if (cfg->opt & MONO_OPT_LINEARS) {

We already have:

	if ((cfg->num_varinfo > 2000) && !mono_compile_aot) {
		/* 
		 * we disable some optimizations if there are too many variables
		 * because JIT time may become too expensive. The actual number needs 
		 * to be tweaked and eventually the non-linear algorithms should be fixed.
		 */
		cfg->opt &= ~ (MONO_OPT_LINEARS | MONO_OPT_COPYPROP | MONO_OPT_CONSPROP);
		cfg->disable_ssa = TRUE;
	}

Obviously though, that comment about tuning still applies.

-- Ben




More information about the Mono-devel-list mailing list