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 /sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-liveness.sml
ViewVC logotype

Diff of /sml/branches/SMLNJ/src/MLRISC/IR/mlrisc-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 1  Line 1 
1    (*
2     * This module performs liveness analysis.
3     * It is implemented by instantiating the data flow analyzer module.
4     *
5     * -- Allen
6     *)
7    
8  signature LIVENESS_ANALYSIS =  signature LIVENESS_ANALYSIS =
9  sig  sig
10    
# Line 11  Line 18 
18           defUse  : CFG.block Graph.node -> RegSet.regset * RegSet.regset           defUse  : CFG.block Graph.node -> RegSet.regset * RegSet.regset
19         } -> unit         } -> unit
20    
21     val getLiveness : CFG.cfg -> Graph.node_id -> RegSet.regset * RegSet.regset     val getLiveness : CFG.cfg -> Graph.node_id ->
22                               {livein: RegSet.regset, liveout: RegSet.regset}
23    
24  end  end
25    
# Line 53  Line 61 
61                        }                        }
62                    end                    end
63    
64                fun epilogue _ { node = (_,CFG.BLOCK{annotations,...}),                fun epilogue _ { node = (b,CFG.BLOCK{annotations,...}),
65                                 input=liveOut, output=liveIn } =                                 input=liveOut, output=liveIn } =
66                    annotations := put((liveIn,liveOut),!annotations)                    annotations := put((liveIn,liveOut),!annotations)
67           end           end
# Line 65  Line 73 
73     fun getLiveness (G.GRAPH cfg) b =     fun getLiveness (G.GRAPH cfg) b =
74         let val CFG.BLOCK{annotations,...} = #node_info cfg b         let val CFG.BLOCK{annotations,...} = #node_info cfg b
75         in  case get(!annotations) of         in  case get(!annotations) of
76                SOME x => x                SOME(x,y) => {livein=x,liveout=y}
77             |  NONE => (S.empty,S.empty)             |  NONE => {livein=S.empty,liveout=S.empty}
78         end         end
79    
80  end  end
81    
 (*  
  * $Log$  
  *)  

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