Skip to content

Commit 5ab969b

Browse files
Add option to dump Pre-SSA Liveness calculation
1 parent 18db2b7 commit 5ab969b

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

optvm/src/main/java/com/compilerprogramming/ezlang/compiler/EnterSSA.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ public EnterSSA(CompiledFunction bytecodeFunction, EnumSet<Options> options) {
4848
this.blocks = domTree.blocks; // the blocks are ordered reverse post order
4949
findNonLocalNames();
5050
new Liveness(bytecodeFunction); // EWe require liveness info to construct pruned ssa
51+
if (options.contains(Options.DUMP_PRE_SSA_LIVENESS)) {
52+
System.out.println("Pre SSA Liveness");
53+
System.out.println(bytecodeFunction.toStr(new StringBuilder(), true));
54+
}
5155
insertPhis();
5256
renameVars();
5357
bytecodeFunction.isSSA = true;

optvm/src/main/java/com/compilerprogramming/ezlang/compiler/Options.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public enum Options {
1111
DUMP_INITIAL_IR,
1212
DUMP_PRE_SSA_DOMTREE,
1313
DUMP_PRE_SSA_DOMFRONTIERS,
14+
DUMP_PRE_SSA_LIVENESS,
1415
DUMP_SSA_IR,
1516
DUMP_SCCP_PREAPPLY,
1617
DUMP_SCCP_POSTAPPLY,

0 commit comments

Comments
 (0)