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/compiler/CodeGen/main/machine-gen.sml
ViewVC logotype

Diff of /sml/trunk/compiler/CodeGen/main/machine-gen.sml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 554, Thu Mar 2 21:29:44 2000 UTC revision 555, Fri Mar 3 16:10:30 2000 UTC
# Line 19  Line 19 
19        where S = MLTreeComp.T.Stream        where S = MLTreeComp.T.Stream
20        where P = PseudoOps        where P = PseudoOps
21        where I = MLTreeComp.I        where I = MLTreeComp.I
22       structure Shuffle    : SHUFFLE              (* shuffling copies *)
23          where I = MLTreeComp.I
24     structure BackPatch  : BBSCHED              (* machine code emitter *)     structure BackPatch  : BBSCHED              (* machine code emitter *)
25        where F.P = PseudoOps        where F.P = PseudoOps
26        where F.I = Asm.I        where F.I = Asm.I
# Line 34  Line 36 
36     structure T         = MLTreeComp.T     structure T         = MLTreeComp.T
37     structure S         = T.Stream     structure S         = T.Stream
38     structure Asm       = Asm     structure Asm       = Asm
39       structure Shuffle   = Shuffle
40     structure MachSpec  = MachSpec     structure MachSpec  = MachSpec
41     structure MLTreeComp= MLTreeComp     structure MLTreeComp= MLTreeComp
42    
43     val optimizerHook : (F.cluster -> F.cluster) option ref = ref NONE     type mlriscPhase = string * (F.cluster -> F.cluster)
44    
45     fun phase x = Stats.doPhase (Stats.makePhase x)     fun phase x = Stats.doPhase (Stats.makePhase x)
46       fun makePhase(name,f) = (name, phase name f)
47    
48     fun opt cluster =     val mc      = phase "MLRISC BackPatch.bbsched" BackPatch.bbsched
        case !optimizerHook of  
          SOME f => f cluster  
        | NONE => cluster  
   
    val ra      = phase "MLRISC ra" RA.ra  
    val opt     = phase "MLRISC optimization" opt  
    val bbsched = phase "MLRISC BackPatch.bbsched" BackPatch.bbsched  
49     val finish  = phase "MLRISC BackPatch.finish" BackPatch.finish     val finish  = phase "MLRISC BackPatch.finish" BackPatch.finish
50       val ra      = phase "MLRISC ra" RA.ra
51    
52       val raPhase = ("ra",ra)
53       val optimizerHook = ref [raPhase]
54    
55     (* Flowgraph generation *)     (* Flowgraph generation *)
56     structure FlowGraphGen =     structure FlowGraphGen =
# Line 67  Line 67 
67                )                )
68    
69     fun compile cluster =     fun compile cluster =
70     let val cluster = opt cluster     let fun runPhases([],cluster) = cluster
71         val cluster = ra cluster           | runPhases((_,f)::phases,cluster) = runPhases(phases,f cluster)
72     in  bbsched cluster end     in  mc(runPhases(!optimizerHook,cluster))
73       end
74    
75     (* compilation of CPS to MLRISC *)     (* compilation of CPS to MLRISC *)
76     structure MLTreeGen =     structure MLTreeGen =

Legend:
Removed from v.554  
changed lines
  Added in v.555

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