"Kurt W. Hirchert" wrote:
>
> At 07:46 PM 2/17/00 +0100, Phillip Helbig wrote:
> >
> >> There is a related question about propagating this kind of optimization
> >> through assignments. E.g., in
> >> T=B+C
> >> D=A*T
> >> should it be permissible for the processor to evaluation D as A*B+A*C.
> >
> >Can't this be done now with standard-conforming optimisation?
>
> No. The published interpretation is that the assignment to T has an effect
> similar to parentheses. (To look at it another way, the license to use
> alternative evaluation applies to single expressions and thus single
> assignment statements. No explicit license is given for this kind of
> multi-statement optimization.)
I agree that the standard doesn't have the same words about
multi-statement
optimization, but we all know it "must be allowed". Otherwise, a
compiler
would not be free to move a statement out from the following loop (no
aliasing
among x, t, y and a, of course):
do i = 1, n
x = cos (6.5*t) + y
a(i) = a(i) + x
end do
--
Walt Brainerd [log in to unmask]
Unicomp, Inc. +1-520-298-7212 298-7074 (fax)
7660 E. Broadway, Suite 308 888-330-6060
Tucson, AZ 85710 USA http://www.uni-comp.com
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|