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/flowgraph/cfgPeephole.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/flowgraph/cfgPeephole.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 933 - (view) (download)

1 : george 933 (*
2 :     * Run peephole optimization on a cluster
3 :     *)
4 :     functor CFGPeephole
5 :     (structure CFG : CONTROL_FLOW_GRAPH
6 :     structure PeepHole : PEEPHOLE
7 :     sharing CFG.I = PeepHole.I
8 :     ) : CFG_OPTIMIZATION =
9 :     struct
10 :     structure CFG = CFG
11 :    
12 :     val name = "Peephole optimization"
13 :    
14 :     fun run (cfg as Graph.GRAPH graph) = let
15 :     fun opt (_, CFG.BLOCK{insns, ...}) = insns := PeepHole.peephole(rev(!insns))
16 :     in
17 :     #forall_nodes graph opt;
18 :     cfg
19 :     end
20 :    
21 :     end

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