Hi, The patch skips an invariant from depends_on if it has been marked as "move" since its register pressure and cost had been taken into account in previous iterations.
Bootstrap and no make check regression on X86-64. Bootstrap and no make check regression on X86-64 with flag_ira_loop_pressure = true. OK for trunk? Thanks! -Zhenqiang ChangeLog: 2014-06-10 Zhenqiang Chen <zhenqiang.c...@linaro.org> * loop-invariant.c (get_inv_cost): Skip invariants, which are marked as "move", from depends_on. diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index e822bb6..fca9c2f 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -1148,6 +1148,10 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed, dep = invariants[depno]; + /* If DEP is moved out of the loop, it is not a depends_on any more. */ + if (dep->move) + continue; + dep_ret = get_inv_cost (dep, &acomp_cost, aregs_needed, &dep_cl); if (! flag_ira_loop_pressure)