loop optimizations mark 6
Richard Henderson
rth@cygnus.com
Fri Jan 23 11:15:00 GMT 1998
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
More information about the Gcc
mailing list