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/ra/region-based-ra.sml
ViewVC logotype

Annotation of /sml/trunk/src/MLRISC/ra/region-based-ra.sml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1126 - (view) (download)

1 : leunga 641 (*
2 :     * Region-based register allocator.
3 :     * This register allocation takes a cluster of large size and partitions
4 :     * it into manageable pieces to be allocated.
5 :     *)
6 :     functor RegionBasedRA
7 :     (RA : RA)
8 :     (FlowgraphPartitioner : RA_FLOWGRAPH_PARTITIONER
9 :     where type flowgraph = RA.F.flowgraph
10 :     where C = RA.C
11 :     ) : RA =
12 :     struct
13 :    
14 :     structure F = RA.F
15 :     structure FP = FlowgraphPartitioner
16 :     structure I = F.I
17 :     structure C = I.C
18 :     structure Core = RACore
19 :     structure G = Core.G
20 :    
21 :     open RA
22 :    
23 : blume 1126 val maxBlocks = MLRiscControl.mkInt ("ra-max-blocks", "max block count for region-based RA")
24 : leunga 641
25 :     (* Main entry point.
26 :     * All the magic is actually done in the FlowgraphPartitioner module
27 :     *)
28 :     fun ra (params:raClient list) flowgraph =
29 :     if FP.numberOfBlocks flowgraph > !maxBlocks then
30 :     let fun ra (param as {cellkind, ...}) =
31 :     FP.partition flowgraph cellkind (RA.ra [param])
32 :     in app ra params;
33 :     flowgraph
34 :     end
35 :     else RA.ra params flowgraph
36 :    
37 :     end

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