no noalias not negligible - a difference between C and Fortran - long
Scott Denham
ssd at sugar.UUCP
Sat Jun 4 16:19:59 AEST 1988
In article <21727 at amdcad.AMD.COM>, tim at amdcad.AMD.COM (Tim Olson) writes:
> In article <7879 at alice.UUCP> ark at alice.UUCP writes:
> | I don't really think there's much here that noalias would help:
> | the object code has to fetch dy[i], add da, multiply by
> | dx[i], and store it in dy[i] and aliasing is irrelevant to
> | each of these operations.
>
> But that forces each iteration of the loop to be performed sequentially.
> I believe the original intent was to guarantee non-overlapping arrays to
> allow vector machines to compute the loop iterations in parallel.
>
> -- Tim Olson
There is a real need to be able to assure the compiler that there is no
recursion present in an expression in which it is impossible for the
compiler to decide this for itself from the information available in
the code. This is particularly true in subroutines - the designer can
know things about the values of arguments that the compile could never
guess, and in the case of any doubt, the compiler must play it "safe".
IBM made a serious misjudgement in their first attempt at a vector
Fortran compiler and included no such facility - and it took some very
nasty coding to "fool" the compiler into vectorizing code that when
written in a straightforward way left open the possiblity that the
loop would not give consistent results if pipelined or split into
parallel tasks.
More information about the Comp.lang.c
mailing list