+ /*
+ * Add a loop from end to start.
+ * The problem is then an eigenvalue problem:
+ * Solve A*x = 1*x => (A-I)x = 0
+ */
+ s = set_find_freq(freqs, get_irg_start_block(irg));
+ e = set_find_freq(freqs, get_irg_end_block(irg));
+ if (e->idx >= 0)
+ gs_matrix_set(mat, s->idx, e->idx, 1.0);
+
+ /* solve the system and delete the matrix */
+ solve_lgs(mat, x, size);
+ gs_delete_matrix(mat);
+
+ /*
+ * compute the normalization factor.
+ * 1.0 / exec freq of start block.
+ */
+ norm = x[s->idx] != 0.0 ? 1.0 / x[s->idx] : 1.0;