Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] Annotation of /branches/vis15/src/compiler/low-opt/low-opt.sml
ViewVC logotype

Annotation of /branches/vis15/src/compiler/low-opt/low-opt.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3747 - (view) (download)

1 : jhr 3714 (* low-opt.sml
2 :     *
3 :     * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
4 :     *
5 :     * COPYRIGHT (c) 2016 The University of Chicago
6 :     * All rights reserved.
7 :     *
8 :     * Optimization of the LowIR representation of Diderot terms.
9 :     *)
10 :    
11 :     structure LowOptimizer : sig
12 :    
13 :     val optimize : LowIR.program -> LowIR.program
14 :    
15 :     val checkAfter : string * LowIR.program -> LowIR.program
16 :    
17 :     end = struct
18 :    
19 :     (* Value numbering for LowIR *)
20 :     structure VN = ValueNumberingFn (DomTreeFn(LowIR))
21 :    
22 :     val checkAfter = Log.after {
23 :     dumpCtl = Ctl.dumpLowIR,
24 :     checkCtl = Ctl.checkLowIR,
25 :     output = LowPP.output,
26 :     checkIR = PhaseTimer.withTimer Timers.timeLowCheck (fn arg => CheckLow.check arg)
27 :     }
28 :    
29 :     fun transform (ctl, timer, phase, transform, prog) =
30 : jhr 3747 if Controls.get ctl
31 : jhr 3714 then checkAfter (phase, PhaseTimer.withTimer timer transform prog)
32 :     else prog
33 :    
34 :     fun optimize prog = let
35 : jhr 3747 val prog = transform (Ctl.lowVN, Timers.timeLowVN, "value numbering", VN.transform, prog)
36 :     val prog = transform (Ctl.lowContract, Timers.timeLowContract, "contraction", LowContract.transform, prog)
37 : jhr 3714 in
38 :     prog
39 :     end
40 :    
41 :     end

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0