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

SCM Repository

[smlnj] Annotation of /sml/trunk/src/MLRISC/SSA/ssa-ccp.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/SSA/ssa-ccp.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 695 - (view) (download)

1 : leunga 695 (*
2 :     * Conditional Constant Propagation
3 :     *)
4 :     functor SSACCP(CCP : SSA_CONDITIONAL_CONSTANT_PROPAGATION) : SSA_OPTIMIZATION =
5 :     struct
6 :     structure SSA = CCP.SSA
7 :     structure CF = CCP.CF
8 :     structure A = Array
9 :    
10 :     type flowgraph = SSA.ssa
11 :    
12 :     val name = "conditional constant propagation"
13 :    
14 :     fun error msg = MLRiscErrorMsg.error("SSACCP",msg)
15 :    
16 :     fun run SSA =
17 :     let val valueMap = CCP.condConstProp SSA
18 :     val defSiteTbl = SSA.defSiteTbl SSA
19 :     val showVal = SSA.showVal SSA
20 :     val showOp = SSA.showOp SSA
21 :     val showVN = CF.showVN SSA
22 :     in A.appi (fn (v,vn) =>
23 :     if vn <> CF.bot andalso vn <> CF.top then
24 :     (let val i = A.sub(defSiteTbl,v)
25 :     in print(showVal v^" "^showOp i^" = "^showVN vn^"\n")
26 :     end
27 :     )
28 :     else ())
29 :     (valueMap, 0, NONE);
30 :     SSA
31 :     end
32 :     end

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