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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3877 - (download) (annotate)
Wed May 18 21:21:25 2016 UTC (3 years, 8 months ago) by jhr
File size: 975 byte(s)
working on merge
(* tree-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 TreeIR representation of Diderot terms.
 *)

structure TreeOptimizer : sig

    val optimize : TreeIR.program -> TreeIR.program

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

  end = struct

    val checkAfter = Log.after {
	    dumpCtl = Ctl.dumpTreeIR,
	    checkCtl = Ctl.checkTreeIR,
	    output = TreePP.output,
	    checkIR = PhaseTimer.withTimer Timers.timeTreeCheck (fn arg => CheckTree.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.treeContract, Timers.timeTreeContract, "contraction", TreeContract.transform, prog)
	  in
	    prog
	  end

  end

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