From: | Brooks Moses <bmoses-nospam@cits1.stanford.edu> |
Newsgroups: | comp.compilers,comp.lang.pl1 |
Date: | Wed, 15 Aug 2007 22:52:27 -0700 |
Organization: | Stanford University |
References: | 07-08-01607-08-021 07-08-024 07-08-034 07-08-037 07-08-040 07-08-041 |
Keywords: | parallel, PL/I |
Posted-Date: | 17 Aug 2007 11:53:37 EDT |
Peter Flass wrote:
> None yet, but many thanks for the "heads up." I'm not sure I
> understand serial vs. parallel, but if I do understand I wa going to
> do parallel, and create an array temporary to hold the result of the
> expression. Now I don't know what I'll do.
My suggestion (from a language-design standpoint; I don't know if
you're writing from that direction or as a PL/I implementor, since
this is crossposted) would be to do neither. The point of such a
construction is to allow the compiler to make the fastest possible
code. If the language _guarantees_ either serial or parallel
semantics, there will necessarily be cases where the compiler will
have to pessimize the code due to things that it cannot prove are
independent.
Furthermore, if a person _wants_ serial semantics, they can write a
for-loop, and if they want parallel semantics for a case that requires
a temporary, they can write their own array temporary (which means
they won't be surprised by its existence).
Thus, I would recommend that the language standard say that array
assignments where the right-hand side depends on data which is aliased
with the left-hand side are simply illegal code, and in those cases the
result is undefined.
(It may be useful to relax this, and allow the right-hand side for a
given element to depend on data that is aliased with its own left-hand
side element, but not with other elements in the left-hand side.)
Once you've done that, it _might_ be useful to also include a related
syntax for doing things with parallel semantics and generation of
temporaries as necessary. But I think that's of secondary use.
- Brooks
--
The "bmoses-nospam" address is valid; no unmunging needed.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.