esmangle
esmangle copied to clipboard
eliminate common prefixes/suffixes in conditionals using CFG
if(condition){
a();
b();
} else {
c();
b();
}
b will be called unconditionally, so it can be taken out.
if(condition) a(); else c();
b();
This will be easy when we generate control flow graphs. Any equivalent nodes that both point at the same node (and any node that points to two equivalent nodes) can be optimised.
Let's try out https://github.com/Swatinem/esgraph