This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: rtlopt loop unroller question
- From: Roger Sayle <roger at eyesopen dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc at gcc dot gnu dot org, Yossi Markovich <YOSSIM at il dot ibm dot com>, Dorit Naishlos <DORIT at il dot ibm dot com>, Andreas Jaeger <aj at suse dot de>
- Date: Wed, 22 Oct 2003 08:43:45 -0600 (MDT)
- Subject: Re: rtlopt loop unroller question
On Wed, 22 Oct 2003, Zdenek Dvorak wrote:
> As I suspected, my favourite piece of cse strikes again.
> With the patch below, the code produced is much better:
I've also been curious about the benefits of this piece of CSE.
It would be nice to get some benchmarking of your patch on several
platforms, and if things don't get significantly worse, remove this
section of code entirely.
What do others think?
> Index: cse.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/cse.c,v
> retrieving revision 1.231.2.11
> diff -c -3 -p -r1.231.2.11 cse.c
> *** cse.c 20 Jul 2003 22:04:20 -0000 1.231.2.11
> --- cse.c 22 Oct 2003 00:46:36 -0000
> *************** fold_rtx (x, insn)
> *** 4222,4227 ****
> --- 4222,4228 ----
> || XEXP (y, 0) == folded_arg0)
> break;
>
> + #if 0
> /* Don't associate these operations if they are a PLUS with the
> same constant and it is a power of two. These might be doable
> with a pre- or post-increment. Similarly for two subtracts of
> *************** fold_rtx (x, insn)
> *** 4237,4242 ****
> --- 4238,4244 ----
> || (HAVE_POST_DECREMENT
> && exact_log2 (- INTVAL (const_arg1)) >= 0)))
> break;
> + #endif
>
> /* Compute the code used to compose the constants. For example,
> A-C1-C2 is A-(C1 + C2), so if CODE == MINUS, we want PLUS. */
>
Roger
--