This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Re-run of loop pass
- To: Michael Hayes <m dot hayes at elec dot canterbury dot ac dot nz>
- Subject: Re: Re-run of loop pass
- From: David Edelsohn <dje at watson dot ibm dot com>
- Date: Sun, 18 Oct 1998 11:13:53 -0400
- Cc: law at cygnus dot com, egcs at cygnus dot com
>>>>> Michael Hayes writes:
Michael> The first pass often eliminates the BIV associated with i and replaces
Michael> the end of loop test i < 4 with a comparison of the incremented
Michael> pointer associated with a + i with a + 4 (I think the elimination is
Michael> only performed for targets with autoincrement addressing modes). The
Michael> second pass then finds that the initial value of BIV associated with a
Michael> is not a constant and thus cannot determine the iteration count.
I think that this is addressed by the following comment in
unroll.c:loop_iterations()
/* ?? Final value and initial value do not have to be constants.
Only their difference has to be constant. When the iteration
variable
is an array address, the final value and initial value might both
be addresses with the same base but different constant offsets.
Final value must be invariant for this to work.
To do this, need some way to find the values of registers which are
invariant. */
I guess this is not yet implemented.
David