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

SCM Repository

[diderot] View of /branches/vis15/src/compiler/high-to-mid/handle-ein.sml
ViewVC logotype

View of /branches/vis15/src/compiler/high-to-mid/handle-ein.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3790 - (download) (annotate)
Thu Apr 28 18:57:03 2016 UTC (3 years, 11 months ago) by jhr
File size: 993 byte(s)
  code cleanup; fix printing of dom tree
(* handle-ein.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.
 *)

structure HandleEin : sig

    val expand : MidIR.var * Ein.ein * MidIR.var list -> MidIR.assignment list

  end = struct
   
    structure E = Ein
    structure SrcIR = HighIR
    structure DstIR = MidIR

    fun useCount (SrcIR.V{useCnt, ...}) = !useCnt

    fun expand (lhs, ein, args) = let
        (* ************** distribute and push Summation*********** *)
          val ein' = EinSums.transform ein
        (* **************** split phase ************* *)
          val newbies = FloatEin.transform (lhs, ein', args)
        (* ************** ProbeEIN *********** *)
          val avail = AvailRHS.new()
          val _ = List.app (ProbeEin.expand avail) (newbies);
          val stmts = List.rev (AvailRHS.getAssignments avail)
	  in
	    List.map DstIR.ASSGN stmts
	  end

  end (* HandleEin *)

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