1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
|
(*
* This module is responsible for generating new instructions from
* MLTREE and inserting them into the SSA graph. This is useful for
* patching in new instructions as the SSA graph is being transformed.
*
* Special MLRISC Magic(tm) for invoking the instruction selection
* module and ssa-ifying the output code are all hidden here.
*
* -- Allen (leunga@cs.nyu.edu)
*
*)
signature SSA_INSTRGEN =
sig
structure SSA : SSA
structure RTL : MLTREE_RTL
structure MLTreeComp : MLTREECOMP
sharing SSA.MLTreeComp = MLTreeComp
sharing SSA.RTL = RTL
exception Illegal
(* Convert internal RTL into a mltree term *)
val translate : SSA.ssa ->
{rtl:RTL.rtl, defs:SSA.value list, uses:SSA.value list} ->
MLTreeComp.T.stm
(* Convert an mltree term into a list of instructions *)
val instrGen : SSA.ssa -> MLTreeComp.T.stm -> SSA.I.instruction list
(* Insert instructions into the SSA graph *)
(* Replace the instruction at id *)
val replace : SSA.ssa -> {id:SSA.ssa_id, mltree:MLTreeComp.T.stm} -> bool
end
|