common block elimination
Stephen Weeks
MLton@sourcelight.com
Mon, 6 Aug 2001 17:35:13 -0700
> I didn't bother running the benchmarks -- this should have no effect on
> performance. But, it did save about .3MB off the size of a self-compile
> executable.
Nice win for such a simple opt.
> This is a bit better, only resetting globals of type exn, but it still
> seems a little long for a 100 line pass.
>
> commonBlock starting
> inferHandlers starting
> inferHandlers finished in 0.26 + 0.0 (0.0% GC)
> commonBlock finished in 1.59 + 1.90 (54% GC)
I took a look and only saw one minor thing, which I changed. This brought the
time down to
commonBlock starting
inferHandlers starting
inferHandlers finished in 0.26 + 0.0 (0.0% GC)
commonBlock finished in 1.51 + 0.0 (0.0% GC)
The GC is noise, so this was barely a win. Anyways, I agree it's a bit strange
that this pass is slower than say cse, but it's not so bad that I'm gonna think
about it. Oh yeah, one other thing I just saw -- if the order of the newDecs
doesn't matter, you can use an appendRev instead of @. But that's very minor.