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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3856 - (download) (annotate)
Sat May 14 12:49:20 2016 UTC (4 years, 5 months ago) by jhr
File size: 1259 byte(s)
  Working on merge
(* low-opt.sml
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 * COPYRIGHT (c) 2016 The University of Chicago
 * All rights reserved.
 * Optimization of the LowIR representation of Diderot terms.

structure LowOptimizer : sig

    val optimize : LowIR.program -> LowIR.program

    val checkAfter : string * LowIR.program -> LowIR.program

  end = struct

  (* Value numbering for LowIR *)
    structure VN = ValueNumberingFn (DomTreeFn(LowIR))

    val checkAfter = Log.after {
	    dumpCtl = Ctl.dumpLowIR,
	    checkCtl = Ctl.checkLowIR,
	    output = LowPP.output,
	    checkIR = PhaseTimer.withTimer Timers.timeLowCheck (fn arg => CheckLow.check arg)

    fun transform (ctl, timer, phase, transform, prog) =
	  if Controls.get ctl
	    then checkAfter (phase, PhaseTimer.withTimer timer transform prog)
	    else prog

    fun optimize prog = let
	  val prog = transform (Ctl.lowContract, Timers.timeLowContract, "contraction(1)", LowContract.transform, prog)
	  val prog = transform (Ctl.lowVN, Timers.timeLowVN, "value numbering", VN.transform, prog)
	  val prog = transform (Ctl.lowContract, Timers.timeLowContract, "contraction(2)", LowContract.transform, prog)


ViewVC Help
Powered by ViewVC 1.0.0