flattener

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Tue, 8 Jan 2002 13:42:42 -0500 (EST)


I'm still a little curious about what's going on with the flattener.  I
expanded the single flatten pass in the SSA pipeline to 3 in a row; this
has the effect of unpacking tuples up to three levels deep.  Here are the
benchmark results; note that MLton1 corresponds to what we normally do
(i.e., one flatten pass) and MLton0 corresponds to no flatten passes at
all.

MLton0 -- mlton -drop-pass flatten3 -drop-pass flatten2 -drop-pass flatten1
MLton1 -- mlton -drop-pass flatten3 -drop-pass flatten2
MLton2 -- mlton -drop-pass flatten3
MLton3 -- mlton 

run time
benchmark         MLton0 MLton1 MLton2 MLton3
barnes-hut          9.18   4.30   4.86   4.21
checksum            3.09   3.09   3.09   3.09
count-graphs        6.50   4.88   4.29   3.99
DLXSimulator       17.80  15.54  15.64  15.68
fft                 9.46   9.42   9.46   9.41
fib                 3.41   3.41   3.41   3.41
hamlet             11.93   7.37   7.32   7.45
imp-for             9.07   8.23   9.07   8.23
knuth-bendix       12.58   6.48   6.32   5.77
lexgen             14.55  10.80   9.97   9.89
life                6.58   6.87   6.23   6.66
logic              23.81  18.02  17.86  17.95
mandelbrot          6.33   6.20   6.33   6.20
matrix-multiply     3.97   3.88   3.96   3.98
md5                 9.74   2.03   2.02   2.03
merge              91.21  49.58  49.48  49.74
mlyacc             11.59   9.39   9.26   9.13
mpuz                4.49   4.54   4.47   4.66
nucleic             8.15   8.31   8.83  21.21
peek                3.24   3.25   3.24   3.25
psdes-random        3.11   3.36   3.11   3.36
ratio-regions      12.70   8.82   8.42   8.39
ray                 3.53   3.72   3.66   4.14
raytrace           10.16   4.94   6.78   6.84
simple             10.23   6.08   6.62   6.49
smith-normal-form   0.95   0.94   0.94   0.94
tailfib            15.48  15.48  15.48  15.48
tak                13.44   8.88   8.98   8.88
tensor              5.82   5.82   5.82   5.82
tsp                10.04   8.76   9.43   9.34
tyan               20.43  17.33  16.96  18.14
vector-concat       5.57   5.87   5.86   5.97
vector-rev          4.13   4.12   4.11   4.11
vliw                7.13   6.15   6.43   6.87
wc-input1           1.80   1.74   1.81   1.80
wc-scanStream       3.48   3.47   3.42   3.42
zebra               2.35   2.34   2.21   2.28
zern               35.28  35.28  35.16  35.42
run time ratio
benchmark         MLton1 MLton2 MLton3
barnes-hut          0.47   0.53   0.46
checksum            1.00   1.00   1.00
count-graphs        0.75   0.66   0.61
DLXSimulator        0.87   0.88   0.88
fft                 1.00   1.00   1.00
fib                 1.00   1.00   1.00
hamlet              0.62   0.61   0.62
imp-for             0.91   1.00   0.91
knuth-bendix        0.51   0.50   0.46
lexgen              0.74   0.68   0.68
life                1.04   0.95   1.01
logic               0.76   0.75   0.75
mandelbrot          0.98   1.00   0.98
matrix-multiply     0.98   1.00   1.00
md5                 0.21   0.21   0.21
merge               0.54   0.54   0.55
mlyacc              0.81   0.80   0.79
mpuz                1.01   1.00   1.04
nucleic             1.02   1.08   2.60
peek                1.00   1.00   1.01
psdes-random        1.08   1.00   1.08
ratio-regions       0.69   0.66   0.66
ray                 1.05   1.04   1.17
raytrace            0.49   0.67   0.67
simple              0.59   0.65   0.63
smith-normal-form   0.99   0.99   0.99
tailfib             1.00   1.00   1.00
tak                 0.66   0.67   0.66
tensor              1.00   1.00   1.00
tsp                 0.87   0.94   0.93
tyan                0.85   0.83   0.89
vector-concat       1.05   1.05   1.07
vector-rev          1.00   1.00   0.99
vliw                0.86   0.90   0.96
wc-input1           0.97   1.01   1.00
wc-scanStream       1.00   0.99   0.98
zebra               1.00   0.94   0.97
zern                1.00   1.00   1.00

I guess it doesn't say much new.  count-graphs is the only benchmark that
looks like it benefits from repeated flattening.  Overall, flattening at
least once is certainly a win.  I'm a little surprised that vector-concat
slows down with flattening.