protected void computeWeightsForPts(){
  int i;
  int s, t;
  off_graph_edge p;
  IVarAbstraction node;
  pre_cnt=0;
  for (i=0; i < n_var; ++i) {
    pre[i]=-1;
    count[i]=0;
    rep[i]=i;
    repsize[i]=1;
    node=int2var.get(i);
    node.top_value=Integer.MIN_VALUE;
  }
  for (i=0; i < n_var; ++i)   if (pre[i] == -1)   tarjan_scc(i);
  for (i=0; i < n_var; ++i) {
    p=varGraph.get(i);
    s=find_parent(i);
    while (p != null) {
      t=find_parent(p.t);
      if (t != s)       count[t]++;
      p=p.next;
    }
  }
  for (i=0; i < n_var; ++i) {
    p=varGraph.get(i);
    if (p != null && rep[i] != i) {
      t=find_parent(i);
      while (p.next != null)       p=p.next;
      p.next=varGraph.get(t);
      varGraph.set(t,varGraph.get(i));
      varGraph.set(i,null);
    }
  }
  queue.clear();
  for (i=0; i < n_var; ++i)   if (rep[i] == i && count[i] == 0)   queue.addLast(i);
  i=0;
  while (!queue.isEmpty()) {
    s=queue.getFirst();
    queue.removeFirst();
    node=int2var.get(s);
    node.top_value=i;
    i+=repsize[s];
    p=varGraph.get(s);
    while (p != null) {
      t=find_parent(p.t);
      if (t != s) {
        if (--count[t] == 0)         queue.addLast(t);
      }
      p=p.next;
    }
  }
  for (i=n_var - 1; i > -1; --i) {
    if (rep[i] != i) {
      node=int2var.get(find_parent(i));
      IVarAbstraction me=int2var.get(i);
      me.top_value=node.top_value + repsize[node.id] - 1;
      --repsize[node.id];
    }
  }
}

protected void computeWeightsForPts ( ) { int i ; int s , t ; off_graph_edge p ; IVarAbstraction node ; pre_cnt = 0 ; for ( i = 0 ; i < n_var ; ++ i ) { pre [ i ] = - 1 ; count [ i ] = 0 ; rep [ i ] = i ; repsize [ i ] = 1 ; node = int2var . get ( i ) ; node . top_value = Integer . MIN_VALUE ; } for ( i = 0 ; i < n_var ; ++ i ) if ( pre [ i ] == - 1 ) tarjan_scc ( i ) ; for ( i = 0 ; i < n_var ; ++ i ) { p = varGraph . get ( i ) ; s = find_parent ( i ) ; while ( p != null ) { t = find_parent ( p . t ) ; if ( t != s ) count [ t ] ++ ; p = p . next ; } } for ( i = 0 ; i < n_var ; ++ i ) { p = varGraph . get ( i ) ; if ( p != null && rep [ i ] != i ) { t = find_parent ( i ) ; while ( p . next != null ) p = p . next ; p . next = varGraph . get ( t ) ; varGraph . set ( t , varGraph . get ( i ) ) ; varGraph . set ( i , null ) ; } } queue . clear ( ) ; for ( i = 0 ; i < n_var ; ++ i ) if ( rep [ i ] == i && count [ i ] == 0 ) queue . addLast ( i ) ; i = 0 ; while ( ! queue . isEmpty ( ) ) { s = queue . getFirst ( ) ; queue . removeFirst ( ) ; node = int2var . get ( s ) ; node . top_value = i ; i += repsize [ s ] ; p = varGraph . get ( s ) ; while ( p != null ) { t = find_parent ( p . t ) ; if ( t != s ) { if ( -- count [ t ] == 0 ) queue . addLast ( t ) ; } p = p . next ; } } for ( i = n_var - 1 ; i > - 1 ; -- i ) { if ( rep [ i ] != i ) { node = int2var . get ( find_parent ( i ) ) ; IVarAbstraction me = int2var . get ( i ) ; me . top_value = node . top_value + repsize [ node . id ] - 1 ; -- repsize [ node . id ] ; } } }
prepare for a near optimal worklist selection strategy inspired by ben ' s pldi 07 work . prerequisite : impact graph
