Yet Another Opportunity to Optimize by the Front End.
Steve Kargl
sgk@troutmask.apl.washington.edu
Sat Oct 28 20:41:00 GMT 2006
On Sat, Oct 28, 2006 at 02:14:23PM +0200, Toon Moene wrote:
>
> One of the peculiarities of this set up is that the "correct" entry in
> the linked list is found by performing the following test:
>
> SUBROUTINE AAP(M,N,...,WIM,....)
> ...
> REAL WIM(M,N)
> ...
> IF ( ALL(CURRENT % WIM == WIM) ) THEN
> ...
>
> IOW, the check for matching is ALL("The stored array equals the array
> passed as an argument").
>
> Now this idiom would be greatly sped up if the front end didn't compile
> this the obvious way:
>
> allocate (temp (m,n))
> loop over n
> loop over m
> temp (...) = x(...) == y(...)
> loop over n
> loop over m
> all = all .and. temp(...)
>
> and evaluated the reduction operator "all" directly into a register.
>
> Is this already considered by some on their to-do list ?
>
There is a famous qoute about premature optimization, which
I'm too lazy to look up at the moment. There is a 4.3 projects
list on the gfortran wiki. Micro-optimizations isn't listed.
--
Steve
More information about the Fortran
mailing list