Hi,

with the changes in the IVopts pass from last year I see a reduced
number of induction variables used for the first of the 3 hotloops in
the 436.cactus benchmark:

http://gcc.gnu.org/viewcvs?view=revision&revision=162653

Which leads to an heavily increased number of instructions in the body
of the first loop in the resulting binary:

with GCC 4.5: BB 4: 52  <- number of instructions
with GCC 4.6: BB 4: 110 <- similiar result with GCC head

With GCC 4.6 a lot of loop invariant integer arithmetic is done in
order to calculate the addresses which are used to access the array
fields.

Adding another invariant motion pass improves the loop even beyond the
4.5 result:

with GCC 4.6 + attached patch: BB 4: 47

The benchmark result for 436.cactus only improves by about 2% since
the first loop is not actually the "hottest" in the trio but the code
is actually much better.

I've not been able to measure the compile time overhead. Out of 10
measurements compiling the cactus testcase the minimum of the compile
times was even lower then before. Perhaps having less instructions in
the loop body made other passes faster.  Overall I expect a very small
compile time increase.

Ok for mainline?

Bye,

-Andreas-


2011-07-11  Andreas Krebbel  <andreas.kreb...@de.ibm.com>

        * passes.c (init_optimization_passes): Add invariant motion pass
        after induction variable optimization.

Index: gcc/passes.c
===================================================================
*** gcc/passes.c.orig
--- gcc/passes.c
*************** init_optimization_passes (void)
*** 1363,1368 ****
--- 1363,1369 ----
          NEXT_PASS (pass_parallelize_loops);
          NEXT_PASS (pass_loop_prefetch);
          NEXT_PASS (pass_iv_optimize);
+         NEXT_PASS (pass_lim);
          NEXT_PASS (pass_tree_loop_done);
        }
        NEXT_PASS (pass_cse_reciprocals);

Reply via email to