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

SCM Repository

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

View of /branches/vis15/src/compiler/simplify/simple-opt.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4043 - (download) (annotate)
Sun Jun 26 14:00:38 2016 UTC (3 years, 2 months ago) by jhr
File size: 937 byte(s)
  Working on merge: changed the way that we handle kernels in the AST and SimpleAST IRs (treat
  them like literals, instead of like variables).  Added code to rewrite Inside tests in Simple
  IR to use the image instead of the field, which fixes a problem with trying to do inside tests
  on Ein fields.  Added code to promote locals to globals as part of the simplify-vars phase.
(* simple-opt.sml
 *
 * Optimization of the SimpleAST representation
 *
 * This code is part of the Diderot Project (http://diderot-language.cs.uchicago.edu)
 *
 * COPYRIGHT (c) 2015 The University of Chicago
 * All rights reserved.
 *)

structure SimpleOpt : sig

    val transform : Simple.program -> Simple.program

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

  end = struct

    structure S = Simple

    val checkAfter = Log.after {
	    dumpCtl = Ctl.dumpSimple,
	    checkCtl = Ctl.dumpSimple,
	    output = SimplePP.output,
	    checkIR = CheckSimple.check
	  }

    fun transform prog = let
	  val prog = checkAfter ("inlining", Inliner.transform prog)
	  val prog = checkAfter ("contraction", SimpleContract.transform prog)
	  val prog = checkAfter ("simplify fields", SimplifyFields.transform prog)
	  val prog = checkAfter ("simplify variables", SimplifyVars.transform prog)
	  in
	    prog
	  end

  end

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