Re: latest trends in compiler optimization research?

glen herrmannsfeldt <gah@ugcs.caltech.edu>
Sat, 11 Aug 2007 23:06:34 -0800

          From comp.compilers

Related articles
[9 earlier articles]
Re: latest trends in compiler optimization research? al407@cam.ac.uk (Anton Lokhmotov) (2007-08-07)
Re: latest trends in compiler optimization research? wyrmwif@tsoft.org (SM Ryan) (2007-08-07)
Re: latest trends in compiler optimization research? wclodius@lanl.gov (2007-08-09)
Re: latest trends in compiler optimization research? bmoses-nospam@cits1.stanford.edu (Brooks Moses) (2007-08-09)
Re: latest trends in compiler optimization research? dot@dotat.at (Tony Finch) (2007-08-08)
Re: latest trends in compiler optimization research? srimks11@gmail.com (srimks11@gmail.com) (2007-08-11)
Re: latest trends in compiler optimization research? gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-08-11)
Re: Vector assignment semantics (was Re: latest trends in compiler opt al407@cam.ac.uk (Anton Lokhmotov) (2007-08-13)
Re: Vector assignment semantics (was Re: latest trends in compiler opt gah@ugcs.caltech.edu (glen herrmannsfeldt) (2007-08-15)
Re: Vector assignment semantics (was Re: latest trends in compiler opt Peter_Flass@Yahoo.com (Peter Flass) (2007-08-15)
Re: Vector assignment semantics (was Re: latest trends in compiler opt jwkenne@attglobal.net (John W. Kennedy) (2007-08-15)
Re: Vector assignment semantics (was Re: latest trends in compiler opt bmoses-nospam@cits1.stanford.edu (Brooks Moses) (2007-08-15)
Re: Vector assignment semantics (was Re: latest trends in compiler opt mojaveg@mojaveg.lsan.mdsg-pacwest.com (2007-08-17)
[8 later articles]
| List of all articles for this month |

From: glen herrmannsfeldt <gah@ugcs.caltech.edu>
Newsgroups: comp.compilers
Date: Sat, 11 Aug 2007 23:06:34 -0800
Organization: Compilers Central
References: 07-08-01607-08-021 07-08-024
Keywords: optimize, parallel, Fortran

wclodius@lanl.gov wrote:


(snip)


>>I lost track of Fortran before 90 was standarised, but the array
>>notation of 8X was seriously broken: while theoretically letting
>>programmers express themselves at a high level, it forced serial
>>semantics whether the programmer intended that or no; thus the
>>notation could not be vectorised or parallelised any easier than if
>>explicit do loops had been used.


PL/I has the serial semantics, where, for example,


A=A+A(5);


the new value of A(5) is used in additions for elements past A(5).


Fortran instead requires the opposite, that the effect is as if the
whole right side was evaluated before any change is made to the left
side. If the compiler can't verify no side effects, a temporary is
needed.


(snip)


> FWIW Fortran 95 and 2003 have the FORALL assignment statement that
> provides the semantics you desire, however it has not been popular in
> the modern codebase for a variety of reasons.


I don't believe that FORALL does what you say, though I think it
should have done that. From Fortran 2003:


      "Execution of a forall-assignment-stmt that is an assignment-stmt
      causes the evaluation of expr and all 15 expressions within
      variable for all active combinations of index-name values.
      These evaluations may be 16 done in any order. After all these
      evaluations have been performed, each expr value is assigned to
      the 17 corresponding variable. The assignments may occur in any
      order."


The right side can be evaluated in any order, and the values assigned
in any order, but all evaluations are, in theory, done before any
assignments. Again, temporaries may be required.


(snip)


-- glen


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.