Message ID | CACgzC7BZtZRf0B0f=mXMJu6nKVQLv_H2entC5xpRRdnQ8r4uSg@mail.gmail.com |
---|---|
State | New |
Headers | show |
On 07/01/14 01:16, Zhenqiang Chen wrote: > > ChangeLog: > 2014-07-01 Zhenqiang Chen <zhenqiang.chen@linaro.org> > > * loop-invariant.c (struct invariant): Add a new member: eqno; > (find_identical_invariants): Update eqno; > (create_new_invariant): Init eqno; > (get_inv_cost): Compute comp_cost wiht eqno; s/wiht/with/ Do you have a testcase for this? If at all possible I'd like to see some kind of test to verify that this tracking results in better invariant selection. With some kind of test and the ChangeLog typo fixed, this is OK. jeff
diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index d47d461..bd67eb9 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -104,6 +104,9 @@ struct invariant /* The number of the invariant with the same value. */ unsigned eqto; + /* The number of invariants which eqto this. */ + unsigned eqno; + /* If we moved the invariant out of the loop, the register that contains its value. */ rtx reg; @@ -498,6 +501,7 @@ find_identical_invariants (invariant_htab_type *eq, struct invariant *inv) struct invariant *dep; rtx expr, set; enum machine_mode mode; + struct invariant *tmp; if (inv->eqto != ~0u)