diff mbox

[loop2_invariant] Skip inv (marked as move) from depends_on

Message ID CACgzC7B8Y8X-_pcKV+EavpFGFkq9XH-D0VF6vcTJuM5TGgRq2Q@mail.gmail.com
State New
Headers show

Commit Message

Zhenqiang Chen June 10, 2014, 9:32 a.m. UTC
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.chen@linaro.org>

        * loop-invariant.c (get_inv_cost): Skip invariants, which are marked
        as "move", from depends_on.

       if (! flag_ira_loop_pressure)

Comments

Steven Bosscher June 10, 2014, 11:04 a.m. UTC | #1
On Tue, Jun 10, 2014 at 11:32 AM, Zhenqiang Chen wrote:
>
>         * loop-invariant.c (get_inv_cost): Skip invariants, which are marked
>         as "move", from depends_on.
>

This is OK.

Ciao!
Steven
diff mbox

Patch

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);