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/trunk/src/MLRISC/frequencies/complete-probs-fn.sml
 [smlnj] / sml / trunk / src / MLRISC / frequencies / complete-probs-fn.sml

# Diff of /sml/trunk/src/MLRISC/frequencies/complete-probs-fn.sml

revision 1248, Wed Jun 19 16:24:19 2002 UTC revision 1249, Tue Jun 25 21:23:40 2002 UTC
# Line 22  Line 22
22      structure CFG = CFG      structure CFG = CFG
23      structure Prob = Probability      structure Prob = Probability
24
25        val dumpCFG = MLRiscControl.mkFlag
26                          ("dump-cfg-after-complete-probs",
27                           "when true, CFG is output after probability completion")
28
29      val {get=getProb, ...} = MLRiscAnnotations.BRANCH_PROB      val {get=getProb, ...} = MLRiscAnnotations.BRANCH_PROB
30
31    (* Complete edge probabilities. *)    (* Complete edge probabilities. *)
32      fun completeProbs (Graph.GRAPH{forall_nodes, out_edges, ...}) = let      fun completeProbs (cfg as Graph.GRAPH{forall_nodes, out_edges, ...}) = let
33            fun doBlock (blkId, _) = let            fun doBlock (blkId, _) = let
34                  fun computeProbs ((_, _, e as CFG.EDGE{a, ...})::r, remaining, n, es) = (                  fun computeProbs ((_, _, e as CFG.EDGE{a, ...})::r, remaining, n, es) = (
35                        case getProb(!a)                        case getProb(!a)
# Line 45  Line 49
49                  end                  end
50            in            in
51              forall_nodes doBlock              forall_nodes doBlock
52                before (if !dumpCFG then CFG.dump (!MLRiscControl.debug_stream,
53                                                  "after probability completion", cfg)
54                       else ())
55            end            end
56
57    end    end

Legend:
 Removed from v.1248 changed lines Added in v.1249

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