6 An Optimisation Pass To\\
7 The Glasgow Haskell Compiler\\[40pt]
11 (GRASP Project scribe)
18 {\Large The state of play}
21 sun3% time gcc -c hello.c
22 0.240u 0.520s 0:01.00 76.0% 0+51k 0+9io 0pf+0w
24 sun3% time nlmlc -c hello.m
25 3.320u 1.740s 0:05.65 89.5% 0+240k 1+21io 1pf+0w
27 sun3% time nhc -c hello.hs
28 26.680u 2.860s 0:32.00 92.3% 0+950k 2+31io 18pf+0w
31 6.980u 7.880s 0:14.93 99.5% 0+50k 0+0io 0pf+0w
33 sun3% time do100x # LML
34 7.880u 10.500s 0:18.50 99.3% 0+57k 1+0io 1pf+0w
36 sun3% time do100x # haskell
37 7.760u 10.440s 0:18.48 98.4% 0+56k 1+0io 1pf+0w
40 %% % time hello100 > /dev/null
41 %% 0.060u 0.100s 0:00.16 100.0% 0+51k 0+0io 0pf+0w
45 {\Large Analyses (FPCA~'89, PLDI~'91)}
47 binding-time analysis\\
52 interference analysis\\
56 polymorphic-instance analysis\\
57 stacklessness anaysis\\
64 Contrast with conventional-compiler concerns:
66 use of runtime feedback\\
67 matching w/ low-level hardware concerns\\
68 work very hard for their extra information
72 {\Large Optimisations in use: LML}
76 constant folding, arithmetic simplification
78 many local transformations (case of case...)
80 inlining, $\beta$-reduction
84 G-code and m-code optimisation