-/**
- * Collect phi class data
- */
-static void stat_phi_class(be_chordal_env_t *chordal_env, pset *pc) {
- int i, o, size, if_free, phis;
- ir_node **members, *p;
-
- /* phi class count */
- curr_vals[I_CLS_CNT]++;
-
- /* phi class size */
- size = pset_count(pc);
- if (size > MAX_CLS_SIZE)
- curr_vals[I_CLS_SIZE_E]++;
- else
- curr_vals[I_CLS_SIZE_S + size]++;
-
- /* get an array of all members for double iterating */
- members = xmalloc(size * sizeof(*members));
- for (i = 0, p = pset_first(pc); p; p = pset_next(pc))
- members[i++] = p;
- assert(i == size);
-
- /* determine number of phis on this class */
- phis = 0;
- for (i = 0; i < size-1; ++i)
- if (is_Phi(members[i]))
- phis++;
- if (phis > MAX_CLS_PHIS)
- curr_vals[I_CLS_PHIS_E]++;
- else
- curr_vals[I_CLS_PHIS_S + phis]++;
-
- /* determine interference of phi class members */
- curr_vals[I_CLS_IF_MAX] += size*(size-1)/2;
- if_free = 1;
- for (i = 0; i < size-1; ++i)
- for (o = i+1; o < size; ++o)
- if (nodes_interfere(chordal_env, members[i], members[o])) {
- if_free = 0;
- curr_vals[I_CLS_IF_CNT]++;
- }
-
- /* Does this phi class have an inner interference? */
- curr_vals[I_CLS_IF_FREE] += if_free;
-
- xfree(members);
-}
-
-#define is_curr_reg_class(irn) \
- (arch_get_irn_reg_class(chordal_env->session_env->main_env->arch_env, irn, \
- arch_pos_make_out(0)) == chordal_env->cls)
-
-void copystat_collect_cls(be_chordal_env_t *chordal_env) {
- ir_node *n;
- pset *pc;
-
- for (n = pset_first(all_phi_nodes); n; n = pset_next(all_phi_nodes))
- if (is_curr_reg_class(n))
- stat_phi_node(chordal_env, n);
-
- for (n = pset_first(all_copy_nodes); n; n = pset_next(all_copy_nodes))
- if (is_curr_reg_class(n))
- stat_copy_node(chordal_env, n);
-
- for (pc = pset_first(all_phi_classes); pc; pc = pset_next(all_phi_classes)) {
- ir_node *member = pset_first(pc);
- pset_break(pc);
- if (is_curr_reg_class(member))
- stat_phi_class(chordal_env, pc);
- }
-}
-
-void copystat_add_max_costs(int costs) {