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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 3713 - (download) (annotate)
Fri Apr 1 22:58:06 2016 UTC (5 years, 2 months ago) by jhr
File size: 1235 byte(s)
  removed dead code
(* mid-opt.sml
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 * Optimization of the MidIR representation of Diderot terms.  The main
 * task of this phase is to statically resolve field definitions.

structure MidOptimizer : sig

    val optimize : MidIR.program -> MidIR.program

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

  end = struct

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

    val checkAfter = Log.after {
	    dumpCtl = Ctl.dumpMidIR,
	    checkCtl = Ctl.checkMidIR,
	    output = MidPP.output,
	    checkIR = PhaseTimer.withTimer Timers.timeMidCheck (fn arg => CheckMid.check arg)

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

    fun optimize prog = let
	  val prog = transform (Controls.get Ctl.midVN, Timers.timeMidVN, "value numbering", VN.transform, prog)
	  val prog = transform (Controls.get Ctl.midContract, Timers.timeMidContract, "contraction", MidContract.transform, prog)


ViewVC Help
Powered by ViewVC 1.0.0