Unroller with branch and count patch

Mircea Namolaru NAMOLARU@il.ibm.com
Wed Feb 18 14:25:00 GMT 2004


This patch is intended for GCC mainline. It enables the GCC 3.4 new
unroller to work with loops ending with an branch and count instruction
(this is a frequent case on Power due to the doloop optimization).
It corrects the regression seen for the GCC 3.4 new unroller on Power
platforms for the option -funroll-loops (we intend to submit this patch
also to GCC 3.4).

Testing was done on Power4. Bootstrapping was done by
adding -funroll-loops to -O2 level of optimization (as our changes
affect the unrolling). Regression test passed successfully.

Mircea Namolaru

2004-02-15  Mircea Namolaru  <namolaru@il.ibm.com>

        * cfgloop.h (get_var_set_from_bct, is_bct_cond): Declaration of 
new
        functions.
        * cfgloopanal.c: Include loop.h.
        (get_var_set_from_bct, is_bct_cond): New functions.
        (blocks_single_set_registers, count_loop_iterations, 
simple_increment):
        Handle branch and count jumps.
        * doloop.c (doloop_condition_get): Export.
        * loop-init.c (fixup_loop_exit_succesor): New function.
        (loop_optimizer_finalize): Handle loops ending with branch and 
count
        jumps.
        * loop-unroll.c: Include toplev.h
        (discard_increment, expand_bct): New functions.
        (peel_loop_completely,
        unroll_loop_constant_iterations, unroll_loop_runtime_iterations):
        Handle the removal of branch and count jumps.
        * loop.h (doloop_condition_get): Declare.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: uroll.patch
Type: application/octet-stream
Size: 19948 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20040218/d3295817/attachment.obj>


More information about the Gcc-patches mailing list