Re: IVF is a wonderful compiler (was IVF continues to disappoint (relatively))
- From: "Gary L. Scott" <garyscott@xxxxxxx>
- Date: Sat, 20 May 2006 12:45:51 -0500
There, that's better.
Joost wrote:
Greg Lindahl wrote:
In article <1148140178.003452.172670@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>,
Joost <jv244@xxxxxxxxx> wrote:
In my experience, for well written code, g95 will typically be within
+-30% of the fastest compilers *except* if the hot loops involve array
syntax. In quite a few of these cases g95 is still unable to detect
that these can be correctly evaluated without introducing a temporary
array.
Er, that doesn't make any sense. I can write F77 equivalent code for
array syntax. You're saying that g95 won't do well on that F77 code,
either. Lots of competing compilers rewrite all array syntax into F77
and then optimize the F77 -- so they can elimiate the temporary array
in both the array syntax case and the F77 case.
And yes, I've seen real users write F77 loops with unnecessary
temporary arrays.
well. F77 code with unnecessary temporary arrays is not what I call
well written code, and indeed, I'm rather sure that won't be optimised
by g95 (nor g77). F90 that uses array syntax can be well written code
(in particular if it is obvious to the programmer that it can be
evaluated without temporary e.g. v(:)=v(:)+f(:) where v and f can't
alias) but currently can run slowly with g95 because the front-end
might insert a temporary (which won't be removed by the backend). I'm
sure you don't need the example but g95 will translate the above array
syntax to something like
allocate(tmp(N))
DO I=1,N
tmp(I)=v(I)+f(I)
ENDDO
DO I=1,N
v(I)=tmp(I)
ENDDO
deallocate(tmp)
and the backend won't make
DO I=1,N
v(i)=v(i)+f(i)
ENDDO
out of this. I agree that it would be nice to have the backend do this
(because in badly written code this might explicitly occur) but the
choice in gcc seems (so far) to be different, and relies on the
front-end to provide a clean intermediate representation (as far as I,
as an outsider, can tell).
Joost
--
Gary Scott
mailto:garyscott@xxxxxxx
Fortran Library: http://www.fortranlib.com
Support the Original G95 Project: http://www.g95.org
-OR-
Support the GNU GFortran Project: http://gcc.gnu.org/fortran/index.html
Why are there two? God only knows.
If you want to do the impossible, don't hire an expert because he knows it can't be done.
-- Henry Ford
.
- Follow-Ups:
- References:
- IVF continues to disappoint (relatively)
- From: awgreynolds
- Re: IVF continues to disappoint (relatively)
- From: ben
- Re: IVF continues to disappoint (relatively)
- From: Joost
- Re: IVF continues to disappoint (relatively)
- From: Greg Lindahl
- Re: IVF continues to disappoint (relatively)
- From: Joost
- IVF continues to disappoint (relatively)
- Prev by Date: Re: IVF continues to disappoint (relatively)
- Next by Date: Re: Shortage of Fortran Programmers
- Previous by thread: Re: IVF continues to disappoint (relatively)
- Next by thread: Re: IVF is a wonderful compiler (was IVF continues to disappoint(relatively))
- Index(es):
Relevant Pages
|