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

SCM Repository

[diderot] Diff of /trunk/src/compiler/mid-il/mid-opt.sml
ViewVC logotype

Diff of /trunk/src/compiler/mid-il/mid-opt.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2355, Sun Apr 7 11:35:08 2013 UTC revision 2356, Sun Apr 7 14:45:25 2013 UTC
# Line 27  Line 27 
27              ("mid-check", checkFlag, "enable consistency checking for MidIL [debug]")              ("mid-check", checkFlag, "enable consistency checking for MidIL [debug]")
28            ]            ]
29    
30        val timeCheck = PhaseTimer.withTimer Timers.timeMidCheck (fn arg => CheckMidIL.check arg)
31    
32      fun checkIL (phase, prog) =      fun checkIL (phase, prog) =
33            if !checkFlag andalso CheckMidIL.check ("after " ^ phase, prog)            if !checkFlag andalso timeCheck ("after " ^ phase, prog)
34              then (              then (
35                TextIO.output(TextIO.stdErr, concat[                TextIO.output(TextIO.stdErr, concat[
36                    "***** Internal error after ", phase,                    "***** Internal error after ", phase,
# Line 42  Line 44 
44                prog)                prog)
45              else prog              else prog
46    
47      fun transform (ctl, phase, transform, prog) =      fun transform (ctl, timer, phase, transform, prog) =
48            if !ctl            if !ctl
49              then checkIL (phase, transform prog)              then checkIL(phase, PhaseTimer.withTimer timer transform prog)
50              else prog              else prog
51    
52      fun optimize prog = let      fun optimize prog = let
53            val prog = transform (vnFlag, "value numbering", VN.transform, prog)            val prog = checkIL ("translation to MidIL", prog)
54            val prog = transform (contractFlag, "contraction", MidContract.transform, prog)            val prog = transform (vnFlag, Timers.timeMidVN, "value numbering", VN.transform, prog)
55              val prog = transform (contractFlag, Timers.timeMidCheck, "contraction", MidContract.transform, prog)
56            in            in
57              prog              prog
58            end            end

Legend:
Removed from v.2355  
changed lines
  Added in v.2356

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