Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ssa transform #10

Merged
merged 7 commits into from
May 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions mlton/backend/backend.fun
Original file line number Diff line number Diff line change
Expand Up @@ -190,11 +190,11 @@ fun toMachine (program: Ssa.Program.t, codegen) =
val p = maybePass ({name = "rssaShrink1",
doit = Program.shrink}, p)
val p = pass ({name = "insertLimitChecks",
doit = LimitCheck.insert}, p)
doit = LimitCheck.transform}, p)
val p = pass ({name = "insertSignalChecks",
doit = SignalCheck.insert}, p)
doit = SignalCheck.transform}, p)
val p = pass ({name = "implementHandlers",
doit = ImplementHandlers.doit}, p)
doit = ImplementHandlers.transform}, p)
val p = maybePass ({name = "rssaShrink2",
doit = Program.shrink}, p)
val () = Program.checkHandlers p
Expand Down
4 changes: 2 additions & 2 deletions mlton/backend/implement-handlers.fun
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See the file MLton-LICENSE for details.
*)

functor ImplementHandlers (S: IMPLEMENT_HANDLERS_STRUCTS): IMPLEMENT_HANDLERS =
functor ImplementHandlers (S: RSSA_TRANSFORM_STRUCTS): RSSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -209,7 +209,7 @@ fun flow (f: Function.t): Function.t =
start = newStart}
end

fun doit (Program.T {functions, handlesSignals, main, objectTypes}) =
fun transform (Program.T {functions, handlesSignals, main, objectTypes}) =
Program.T {functions = List.revMap (functions, flow),
handlesSignals = handlesSignals,
main = flow main,
Expand Down
4 changes: 2 additions & 2 deletions mlton/backend/limit-check.fun
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
* Stack limit checks are completely orthogonal to heap checks, and are simply
* inserted at the start of each function.
*)
functor LimitCheck (S: LIMIT_CHECK_STRUCTS): LIMIT_CHECK =
functor LimitCheck (S: RSSA_TRANSFORM_STRUCTS): RSSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -825,7 +825,7 @@ fun insertCoalesce (f: Function.t, handlesSignals) =
f
end

fun insert (Program.T {functions, handlesSignals, main, objectTypes}) =
fun transform (Program.T {functions, handlesSignals, main, objectTypes}) =
let
val _ = Control.diagnostic (fn () => Layout.str "Limit Check maxPaths")
datatype z = datatype Control.limitCheck
Expand Down
20 changes: 0 additions & 20 deletions mlton/backend/limit-check.sig

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
* See the file MLton-LICENSE for details.
*)

signature IMPLEMENT_HANDLERS_STRUCTS =
signature RSSA_TRANSFORM_STRUCTS =
sig
structure Rssa: RSSA
end

signature IMPLEMENT_HANDLERS =
signature RSSA_TRANSFORM =
sig
include IMPLEMENT_HANDLERS_STRUCTS
include RSSA_TRANSFORM_STRUCTS

val doit: Rssa.Program.t -> Rssa.Program.t
val transform: Rssa.Program.t -> Rssa.Program.t
end
4 changes: 2 additions & 2 deletions mlton/backend/signal-check.fun
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
* See the file MLton-LICENSE for details.
*)

functor SignalCheck (S: SIGNAL_CHECK_STRUCTS): SIGNAL_CHECK =
functor SignalCheck (S: RSSA_TRANSFORM_STRUCTS): RSSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -180,7 +180,7 @@ fun insertInFunction (f: Function.t): Function.t =
f
end

fun insert p =
fun transform p =
let
val Program.T {functions, handlesSignals, main, objectTypes} = p
in
Expand Down
20 changes: 0 additions & 20 deletions mlton/backend/signal-check.sig

This file was deleted.

4 changes: 1 addition & 3 deletions mlton/backend/sources.cm
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,11 @@ representation.sig
packed-representation.fun
ssa-to-rssa.sig
ssa-to-rssa.fun
implement-handlers.sig
rssa-transform.sig
implement-handlers.fun
implement-profiling.sig
implement-profiling.fun
limit-check.sig
limit-check.fun
signal-check.sig
signal-check.fun
live.sig
live.fun
Expand Down
4 changes: 1 addition & 3 deletions mlton/backend/sources.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,11 @@ local
packed-representation.fun
ssa-to-rssa.sig
ssa-to-rssa.fun
implement-handlers.sig
rssa-transform.sig
implement-handlers.fun
implement-profiling.sig
implement-profiling.fun
limit-check.sig
limit-check.fun
signal-check.sig
signal-check.fun
live.sig
live.fun
Expand Down
4 changes: 2 additions & 2 deletions mlton/ssa/combine-conversions.fun
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* See the file MLton-LICENSE for details.
*)

functor CombineConversions (S: COMBINE_CONVERSIONS_STRUCTS): COMBINE_CONVERSIONS =
functor CombineConversions (S: SSA_TRANSFORM_STRUCTS): SSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -106,7 +106,7 @@ fun mapStatement stmt =
Statement.T { exp = exp, ty = ty, var = var }
end

fun combine program =
fun transform program =
let
val Program.T { datatypes, functions, globals, main } = program
val shrink = shrinkFunction {globals = globals}
Expand Down
18 changes: 0 additions & 18 deletions mlton/ssa/combine-conversions.sig

This file was deleted.

4 changes: 2 additions & 2 deletions mlton/ssa/common-arg.fun
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* See the file MLton-LICENSE for details.
*)

functor CommonArg (S: COMMON_ARG_STRUCTS): COMMON_ARG =
functor CommonArg (S: SSA_TRANSFORM_STRUCTS): SSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -46,7 +46,7 @@ structure NodeInfo =
fun new var = T {var = var}
end

fun eliminate (Program.T {datatypes, globals, functions, main}) =
fun transform (Program.T {datatypes, globals, functions, main}) =
let
val {get = nodeInfo: unit Node.t -> NodeInfo.t,
set = setNodeInfo, ...} =
Expand Down
19 changes: 0 additions & 19 deletions mlton/ssa/common-arg.sig

This file was deleted.

4 changes: 2 additions & 2 deletions mlton/ssa/common-block.fun
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
* See the file MLton-LICENSE for details.
*)

functor CommonBlock (S: COMMON_BLOCK_STRUCTS): COMMON_BLOCK =
functor CommonBlock (S: SSA_TRANSFORM_STRUCTS): SSA_TRANSFORM =
struct

open S
open Exp Transfer

fun eliminate (Program.T {globals, datatypes, functions, main}) =
fun transform (Program.T {globals, datatypes, functions, main}) =
let
val shrink = shrinkFunction {globals = globals}

Expand Down
19 changes: 0 additions & 19 deletions mlton/ssa/common-block.sig

This file was deleted.

4 changes: 2 additions & 2 deletions mlton/ssa/common-subexp.fun
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
* See the file MLton-LICENSE for details.
*)

functor CommonSubexp (S: COMMON_SUBEXP_STRUCTS): COMMON_SUBEXP =
functor CommonSubexp (S: SSA_TRANSFORM_STRUCTS): SSA_TRANSFORM =
struct

open S

open Exp Transfer

fun eliminate (Program.T {globals, datatypes, functions, main}) =
fun transform (Program.T {globals, datatypes, functions, main}) =
let
(* Keep track of control-flow specific cse's,
* arguments, and in-degree of blocks.
Expand Down
19 changes: 0 additions & 19 deletions mlton/ssa/common-subexp.sig

This file was deleted.

4 changes: 2 additions & 2 deletions mlton/ssa/constant-propagation.fun
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* they are global in order to avoid infinite loops.
*)

functor ConstantPropagation (S: CONSTANT_PROPAGATION_STRUCTS) : CONSTANT_PROPAGATION =
functor ConstantPropagation (S: SSA_TRANSFORM_STRUCTS) : SSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -628,7 +628,7 @@ val traceMakeDataUnknown =
(* simplify *)
(* ------------------------------------------------- *)

fun simplify (program: Program.t): Program.t =
fun transform (program: Program.t): Program.t =
let
val program as Program.T {datatypes, globals, functions, main} =
eliminateDeadBlocks program
Expand Down
19 changes: 0 additions & 19 deletions mlton/ssa/constant-propagation.sig

This file was deleted.

4 changes: 2 additions & 2 deletions mlton/ssa/contify.fun
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Contification Using Dominators, by Fluet and Weeks. ICFP 2001.
*)

functor Contify (S: CONTIFY_STRUCTS): CONTIFY =
functor Contify (S: SSA_TRANSFORM_STRUCTS): SSA_TRANSFORM =
struct

open S
Expand Down Expand Up @@ -727,7 +727,7 @@ structure Transform =
= Control.trace (Control.Detail, "transform") transform
end

fun contify (program as Program.T _)
fun transform (program as Program.T _)
= let
val {get = getLabelInfo : Label.t -> (Handler.t * ContData.t) list ref,
...}
Expand Down
19 changes: 0 additions & 19 deletions mlton/ssa/contify.sig

This file was deleted.

Loading