esmangle icon indicating copy to clipboard operation
esmangle copied to clipboard

eliminate common prefixes/suffixes in conditionals using CFG

Open michaelficarra opened this issue 12 years ago • 0 comments

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

michaelficarra avatar Jun 24 '13 03:06 michaelficarra