Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] View of /sml/trunk/src/MLRISC/SSA/ssa-copy.sml
ViewVC logotype

View of /sml/trunk/src/MLRISC/SSA/ssa-copy.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 246 - (download) (annotate)
Sat Apr 17 18:47:12 1999 UTC (20 years, 6 months ago) by monnier
File size: 1250 byte(s)
This commit was generated by cvs2svn to compensate for changes in r245,
which included commits to RCS files with non-trunk default branches.
(*
 * Some utilities for dealing for parallel copies
 *)
signature SSA_COPIES =
sig

   structure SP : SSA_PROPERTIES
   structure C  : CELLS
      sharing SP.C = C

   val simplifyCopy' : C.register list * C.register list -> 
                          C.register list * C.register list
   val simplifyCopy : SP.opn list * SP.opn list -> SP.opn list * SP.opn list

end

functor SSACopiesFn(SP : SSA_PROPERTIES) : SSA_COPIES =
struct

   structure SP = SP
   structure C  = SP.C

   fun error msg = MLRiscErrorMsg.impossible("SSACopies."^msg)

   fun simplifyCopy'(dst,src) =
   let fun f(d::ds,s::ss,dst,src) =
           if d = s then f(ds,ss,dst,src)
           else f(ds,ss,d::dst,s::src)
         | f([],[],dst,src) = (dst,src)
         | f _ = error "simplifyCopy'"
   in  f(dst,src,[],[]) end

   fun simplifyCopy(dst,src) =
   let fun f([],[],dst,src) = (dst,src)
         | f(d::ds,s::ss,dst,src) = 
               if (case (d,s) of
                    (SP.REG(x,_),SP.REG(y,_)) => x=y
                  | (SP.FIX(x,_),SP.FIX(y,_)) => x=y
                  | _ => false)
               then f(ds,ss,dst,src)
               else f(ds,ss,d::dst,s::src)
         | f _ = error "simplifyCopy"
   in  f(dst,src,[],[])
   end

end

(*
 * $Log$
 *)

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