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: loop optimizations mark 6


On Fri, Jan 23, 1998 at 10:42:38AM -0500, John Carr wrote:
> That's what record_base_value is for.  Is it not working right?
> Did I miss some places where it should have been called?

Ah hah.  The only place in loop.c that I see record_base_value 
is in emit_iv_add_mult, but there are many other places where
instructions are emitted, so I can only assume many places were
missed.

I have a test case for at least the one particular problem I
found.  There is a reference to N (through a mem since it is
fortran) in the inner loop, and on the Alpha at least it was
not hoisted out, because the address was in a pseudo > 
reg_known_value_size.


r~


      subroutine resid(res,u,rhs,n)
      implicit none
      integer n
      double precision res(n,n),rhs(n,n),u(n,n)
      integer i,j
      double precision h, h2i
      h=1.d0/(n-1)
      h2i=1.d0/(h*h)
      do j = 2, n-1
         do i = 2, n-1
            res(i,j)=-h2i*(u(i+1,j)+u(i-1,j)+u(i,j+1)+u(i,j-1)-
     ,          4.d0*u(i,j))+rhs(i,j)
         enddo
      enddo
      end


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