This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [patch] for ivopts problem in PR 19038
- From: Richard Henderson <rth at redhat dot com>
- To: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Wed, 19 Jan 2005 14:34:21 -0800
- Subject: Re: [patch] for ivopts problem in PR 19038
- References: <20050119220122.GA18949@atrey.karlin.mff.cuni.cz>
On Wed, Jan 19, 2005 at 11:01:22PM +0100, Zdenek Dvorak wrote:
> do
> {
> i_1 = phi (0, i_2);
> something;
> i_2 = i_1 + 1;
> } while (i_1 != n)
I wonder how much benefit we'd get from
np1 = n + 1;
do
{
i_1 = phi (0, i_2);
something;
i_2 = i_1 + 1;
} while (i_2 != np1);
Given NE and unsigned or -fwrapv, of course. I suppose it depends
on whether or not n remains live on its own, keeping n and np1 live
in registers simultaneously.
> * tree-ssa-loop-ivopts.c (allow_ip_end_pos_p): New function.
> (add_candidate): Add ivs with increment in latch only if
> allow_ip_end_pos_p is true.
> (determine_iv_cost): Use empty_block_p.
Ok.
r~