Next: Forall Loop Interchange Up: Optimizations Previous: Code movement

Forall Dependency

A dependency implies that the compiler must generate a temporary to preserve the semantic. Temporaries are needed to store dependent expressions (mask and the rhs of assignment statements). This means two temporaries for the worst case.

The compiler checks to see if the lhs array does not appear in any of the expressions, or if it appears and it has the same subscript every where. In such a case, the compiler assumes that the is not dependent. This is very simple but effective dependency test.

Even if there is a dependency, the Fortran 90D/HPF compiler performs a dependency analysis after communication generation. Because communication phase may create temporaries, for communication. This may eliminate dependency unintentionally.

If lhs and rhs array has the same subscripts, that means no dependency and no communication. If subscripts are different, there will be communication, communication will create temporary so it eliminates dependency. This means that most of the time no temporary will be created.


zbozkus@
Thu Jul 6 21:09:19 EDT 1995