void sccp(Method m){
  addTraceAttr("Method",m);
  Deque<Block> code=dfs(m.entry.to);
  EdgeMap<Expr> uses=findUses(code);
  Map<Expr,Object> values=new TreeMap<Expr,Object>();
  Map<Expr,Typeref> types=new TreeMap<Expr,Typeref>();
  Set<Edge> reached=new TreeSet<Edge>();
  sccp_analyze(m,uses,values,types,reached);
  verboseStatus("REACHED " + reached);
  verboseStatus("TYPES " + types);
  sccp_cfgopt(values,types,reached);
  dce(m);
  code=dfs(m.entry.to);
  uses=findUses(code);
  TreeSet<Expr> work=new TreeSet<Expr>();
  for (  Block b : code)   for (  Expr e : b)   work.add(e);
  while (!work.isEmpty()) {
    Expr e=getExpr(work);
    sccp_modify(m,uses,values,types,e,work);
  }
  dce(m);
}

void sccp ( Method m ) { addTraceAttr ( "Method" , m ) ; Deque < Block > code = dfs ( m . entry . to ) ; EdgeMap < Expr > uses = findUses ( code ) ; Map < Expr , Object > values = new TreeMap < Expr , Object > ( ) ; Map < Expr , Typeref > types = new TreeMap < Expr , Typeref > ( ) ; Set < Edge > reached = new TreeSet < Edge > ( ) ; sccp_analyze ( m , uses , values , types , reached ) ; verboseStatus ( "REACHED " + reached ) ; verboseStatus ( "TYPES " + types ) ; sccp_cfgopt ( values , types , reached ) ; dce ( m ) ; code = dfs ( m . entry . to ) ; uses = findUses ( code ) ; TreeSet < Expr > work = new TreeSet < Expr > ( ) ; for ( Block b : code ) for ( Expr e : b ) work . add ( e ) ; while ( ! work . isEmpty ( ) ) { Expr e = getExpr ( work ) ; sccp_modify ( m , uses , values , types , e , work ) ; } dce ( m ) ; }
sparse conditional constant propagation
