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

SCM Repository

[smlnj] Diff of /MLRISC/trunk/ra/liveness.sml
ViewVC logotype

Diff of /MLRISC/trunk/ra/liveness.sml

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

revision 410, Fri Sep 3 00:25:03 1999 UTC revision 411, Fri Sep 3 00:25:03 1999 UTC
# Line 26  Line 26 
26    structure F  = Flowgraph    structure F  = Flowgraph
27    structure SL = SortedList    structure SL = SortedList
28    
29    fun error msg = MLRiscErrorMsg.impossible ("Liveness."^msg)    fun error msg = MLRiscErrorMsg.error("Liveness",msg)
30    
31    fun prList(l,msg:string) = let    fun prList(l,msg:string) = let
32        fun pr([]) = print "\n"        fun pr([]) = print "\n"
# Line 72  Line 72 
72                end                end
73    
74            fun outB(F.BBLOCK{succ=ref [], ...}) = false            fun outB(F.BBLOCK{succ=ref [], ...}) = false
75              | outB(F.BBLOCK{succ=ref [F.EXIT _], ...}) = false              | outB(F.BBLOCK{succ=ref [(F.EXIT _,_)], ...}) = false
76              | outB(F.BBLOCK{succ, liveOut,...}) = let              | outB(F.BBLOCK{succ, liveOut,...}) = let
77                  fun inSuccs([], acc) = acc                  fun inSuccs([], acc) = acc
78                    | inSuccs(F.EXIT _::sl, acc) = inSuccs(sl, acc)                    | inSuccs((F.EXIT _,_)::sl, acc) = inSuccs(sl, acc)
79                    | inSuccs(F.BBLOCK{blknum,liveIn,...}::sl, acc) =                    | inSuccs((F.BBLOCK{blknum,liveIn,...},_)::sl, acc) =
80                        inSuccs(sl, SL.merge(regSet(!liveIn), acc))                        inSuccs(sl, SL.merge(regSet(!liveIn), acc))
81                  val liveout = inSuccs(!succ, [])                  val liveout = inSuccs(!succ, [])
82                  val change = listNeq(regSet(!liveOut),liveout)                  val change = listNeq(regSet(!liveOut),liveout)
# Line 98  Line 98 
98                val visited = Array.array(M,false)                val visited = Array.array(M,false)
99                fun visit(n, changed) = let                fun visit(n, changed) = let
100                    fun visitSucc([],changed') = changed'                    fun visitSucc([],changed') = changed'
101                      | visitSucc(F.EXIT _::ns, changed') =                      | visitSucc((F.EXIT _,_)::ns, changed') =
102                         visitSucc(ns, changed')                         visitSucc(ns, changed')
103                      | visitSucc(F.BBLOCK{blknum=n, ...}::ns,changed') =                      | visitSucc((F.BBLOCK{blknum=n, ...},_)::ns,changed') =
104                         if Array.sub(visited,n) then visitSucc(ns,changed')                         if Array.sub(visited,n) then visitSucc(ns,changed')
105                         else visitSucc(ns,visit(n,changed'))                         else visitSucc(ns,visit(n,changed'))
106    
# Line 132  Line 132 
132  end  end
133    
134    
 (*  
  * $Log: liveness.sml,v $  
  * Revision 1.1.1.1  1998/04/08 18:39:02  george  
  * Version 110.5  
  *  
  *)  

Legend:
Removed from v.410  
changed lines
  Added in v.411

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