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

SCM Repository

[diderot] Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml
ViewVC logotype

Diff of /branches/charisee_dev/src/compiler/high-to-mid/ProbeEin.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3060, Fri Mar 13 22:12:44 2015 UTC revision 3066, Sat Mar 14 16:34:25 2015 UTC
# Line 38  Line 38 
38      *)      *)
39    
40      val testing=0      val testing=0
41      val testlift=1      val testlift=0
42      val cnt = ref 0      val cnt = ref 0
43    
44      fun printEINAPP e=MidToString.printEINAPP e      fun printEINAPP e=MidToString.printEINAPP e
# Line 275  Line 275 
275      * Note how we keeps eps expressions so only generate pieces that are used      * Note how we keeps eps expressions so only generate pieces that are used
276      *)      *)
277      fun expandEinOp( e as (y, DstIL.EINAPP(ein,args))) = let      fun expandEinOp( e as (y, DstIL.EINAPP(ein,args))) = let
278            fun checkConst ([],a) = liftProbe a
279            | checkConst ((E.C _::_),a) =replaceProbe a
280            | checkConst ((_ ::es),a)=checkConst(es,a)
281          fun rewriteBody b=(case b          fun rewriteBody b=(case b
282              of E.Probe(E.Conv(_,_,_,[]),_)              of E.Probe(E.Conv(_,_,_,[]),_)
283                  => replaceProbe(0,e,b, [])                  => replaceProbe(0,e,b, [])
284              | E.Probe(E.Conv _,_)              | E.Probe(E.Conv (_,alpha,_,dx),_)
285                  => liftProbe(0,e,b,[])                  => checkConst(alpha@dx,(0,e,b,[]))
286              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))              | E.Sum(sx,p as E.Probe(E.Conv(_,_,_,[]),_))
287                  => replaceProbe(0,e,p, sx)                  => replaceProbe(0,e,p, sx)
288              | E.Sum(sx,p as E.Probe(E.Conv(_,[],_,_),_))              | E.Sum(sx,p as E.Probe(E.Conv(_,[],_,dx),_))
289                  => liftProbe(0,e,p,sx)                  => checkConst(dx,(0,e,p,sx))
290              | E.Sum(sx,E.Probe p)              | E.Sum(sx,E.Probe p)
291                  => replaceProbe(1,e,E.Probe p, sx)                  => replaceProbe(0,e,E.Probe p, sx)
292              | E.Sum(sx,E.Prod[eps,E.Probe p])              | E.Sum(sx,E.Prod[eps,E.Probe p])
293                  => replaceProbe(1,e,E.Probe p,sx)                  => replaceProbe(0,e,E.Probe p,sx)
294              | _ => [e]              | _ => [e]
295              (* end case *))              (* end case *))
296          in          in

Legend:
Removed from v.3060  
changed lines
  Added in v.3066

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