common block elimination

Matthew Fluet mfluet@intertrust.com
Tue, 7 Aug 2001 22:13:41 -0700 (PDT)


>From yesterday:

> [mfluet@starlinux lib]$ size mlton-compile.G1.*
>    text    data     bss     dec     hex filename
> 6396032  761692   31204 7188928  6db1c0 mlton-compile.G1.wCBE
> 6695840  761780   31204 7488824  724538 mlton-compile.G1.woCBE

Here are the new sizes:

   text    data     bss     dec     hex filename
6359568  760652   31108 7151328  6d1ee0 mlton-compile.G1.wCBE
6702224  760948   31108 7494280  725a88 mlton-compile.G1.woCBE

So, those additional common blocks didn't buy as much as I thought they
might.  But, I did verify that the equals_0 CPS function does now have
exactly two blocks that return -- one returns true and one returns false
(as opposed to the 50 or so blocks that it had before).  On the up-side,
common block elimination is cutting code size by more than the code it's
adding, so I think it's a win.

I have one guess for the shrink in the data section.  If enough blocks got
eliminated so that a Switch that was being translated as a jump table
(because each branch got a unique label) could better be translated as a
few equality checks (because many branches now have the same label), then
we save the size of the jump table in the data section.