4 <:Restore:> is a rewrite pass for the <:SSA:> and <:SSA2:>
5 <:IntermediateLanguage:>s, invoked from <:KnownCase:> and
10 This pass restores the SSA condition for a violating <:SSA:> or
11 <:SSA2:> program; the program must satisfy:
13 Every path from the root to a use of a variable (excluding globals)
14 passes through a def of that variable.
19 * <!ViewGitFile(mlton,master,mlton/ssa/restore.sig)>
20 * <!ViewGitFile(mlton,master,mlton/ssa/restore.fun)>
21 * <!ViewGitFile(mlton,master,mlton/ssa/restore2.sig)>
22 * <!ViewGitFile(mlton,master,mlton/ssa/restore2.fun)>
24 == Details and Notes ==
26 Based primarily on Section 19.1 of <!Cite(Appel98, Modern Compiler
27 Implementation in ML)>.
29 The main deviation is the calculation of liveness of the violating
30 variables, which is used to predicate the insertion of phi arguments.
31 This is due to the algorithm's bias towards imperative languages, for
32 which it makes the assumption that all variables are defined in the
33 start block and all variables are "used" at exit.
35 This is "optimized" for restoration of functions with small numbers of
36 violating variables -- use bool vectors to represent sets of violating
39 Also, we use a `Promise.t` to suspend part of the dominance frontier