30 |
where F = BackPatch.F |
where F = BackPatch.F |
31 |
structure CCalls : C_CALLS (* native C call generator *) |
structure CCalls : C_CALLS (* native C call generator *) |
32 |
where T = CpsRegs.T |
where T = CpsRegs.T |
33 |
|
structure OmitFramePtr : OMIT_FRAME_POINTER where F=BackPatch.F |
34 |
) : MACHINE_GEN = |
) : MACHINE_GEN = |
35 |
struct |
struct |
36 |
|
|
45 |
structure MachSpec = MachSpec |
structure MachSpec = MachSpec |
46 |
structure MLTreeComp= MLTreeComp |
structure MLTreeComp= MLTreeComp |
47 |
|
|
48 |
|
fun omitFramePointer(cluster as F.CLUSTER{annotations, ...}) = |
49 |
|
if #contains MLRiscAnnotations.USES_VIRTUAL_FRAME_POINTER (!annotations) then |
50 |
|
(print "calling omit frame pointer \n"; |
51 |
|
OmitFramePtr.omitframeptr{vfp=CpsRegs.vfp, cl=cluster, idelta=SOME 0:Int32.int option}; |
52 |
|
cluster) |
53 |
|
else cluster |
54 |
|
|
55 |
type mlriscPhase = string * (F.cluster -> F.cluster) |
type mlriscPhase = string * (F.cluster -> F.cluster) |
56 |
|
|
57 |
fun phase x = Stats.doPhase (Stats.makePhase x) |
fun phase x = Stats.doPhase (Stats.makePhase x) |
60 |
val mc = phase "MLRISC BackPatch.bbsched" BackPatch.bbsched |
val mc = phase "MLRISC BackPatch.bbsched" BackPatch.bbsched |
61 |
val finish = phase "MLRISC BackPatch.finish" BackPatch.finish |
val finish = phase "MLRISC BackPatch.finish" BackPatch.finish |
62 |
val ra = phase "MLRISC ra" RA.run |
val ra = phase "MLRISC ra" RA.run |
63 |
|
val omitfp = phase "MLRISC omit frame pointer" omitFramePointer |
64 |
|
|
65 |
val raPhase = ("ra",ra) |
val raPhase = ("ra",ra) |
66 |
val optimizerHook = ref [raPhase] |
|
67 |
|
|
68 |
|
val optimizerHook = |
69 |
|
ref [("ra", ra), |
70 |
|
("omitfp", omitfp) |
71 |
|
] |
72 |
|
|
73 |
|
|
74 |
(* Flowgraph generation *) |
(* Flowgraph generation *) |
75 |
structure FlowGraphGen = |
structure FlowGraphGen = |
105 |
val compile = compile |
val compile = compile |
106 |
) |
) |
107 |
|
|
108 |
|
|
109 |
val gen = phase "MLRISC MLTreeGen.codegen" MLTreeGen.codegen |
val gen = phase "MLRISC MLTreeGen.codegen" MLTreeGen.codegen |
110 |
|
|
111 |
fun codegen x = |
fun codegen x = |