This requires several things:
-
Add support for SSA in maru-ir:
1.1 Add phi() nodes
1.2 Add a "isSSA(p: Program): boolean" function
1.3 Add a toSSA(p: Program): [Program, Map<Identifier, Identifier>] that converts a program to SSA form, and emits an auxiliary map from the original Identifiers in the program to their SSA equivalents. Since identifiers are unique objects, this is a 1-1 map.
1.4. Add a test for each sample in maru-ir2, that after its converted to SSA (toSSA is called), it is indeed in SSA form (isSSA is true), and that it executes with the same result as before. (Note that we have to be careful so that the src fields of the ssa nodes preserve the src fields of the original nodes. This should be mostly trivial, except for phi nodes)
-
Use toSSA in sol2maruir
Depends on #37
This requires several things:
Add support for SSA in maru-ir:
1.1 Add phi() nodes
1.2 Add a "isSSA(p: Program): boolean" function
1.3 Add a
toSSA(p: Program): [Program, Map<Identifier, Identifier>]that converts a program to SSA form, and emits an auxiliary map from the original Identifiers in the program to their SSA equivalents. Since identifiers are unique objects, this is a 1-1 map.1.4. Add a test for each sample in maru-ir2, that after its converted to SSA (toSSA is called), it is indeed in SSA form (isSSA is true), and that it executes with the same result as before. (Note that we have to be careful so that the
srcfields of the ssa nodes preserve thesrcfields of the original nodes. This should be mostly trivial, except for phi nodes)Use
toSSAin sol2maruirDepends on #37