This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Re-run of loop pass


>>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]