HP Fortran v2.9 for HP-UX 11i v2 Release Note*5991-0697*
HP Fortran for HP-UX v2.9
What’s in This Version
Chapter 1 9
The IVDEP directive is applied to a DO loop in which the user knows that dependences are in
lexical order. For example, if two memory references in the loop touch the same memory
location and one of them modifies the memory location, then the first reference to touch the
location has to be the one that appears earlier lexically in the program source code. This
assumes that the right-hand side of an assignment statement is earlier than the left-hand
side.
The IVDEP directive informs the compiler that the program would behave correctly if the
statements were executed in certain orders other than the sequential execution order, such as
executing the first statement or block to completion of all iterations, then the next statement
or block for all iterations, and so forth. The optimizer can use this information, along with
whatever else it can prove about the dependences, to choose other execution orders.
Example
In the following example, the IVDEP directive provides more information about the
dependences within the loop, which may enable loop transformations to occur:
C$DIR IVDEP
DO I+1, N
A(INDARR(I)) = A(INDARR(I)) + B(I)
END DO
In this case, the scalar execution order follows:
1. Retrieve INDARR(I);
2. Use the result from Step 1 to retrieve A(INDARR(I));
3. Retrieve B(I);
4. Add the results from Steps 2 and 3 ;
5. Store the results from Step 4 into the location indicated by A(INDARR(I)) from Step 1.
IVDEP directs the compiler to initially assume that when Steps 1 and 5 access a common
memory location, Step 1 always accesses the location first because Step 1 occurs earlier in the
execution sequence. This approach lets the compiler reorder instructions, as long as it chooses
an instruction schedule that maintains the relative order of the array references.
+Ofaster
For Itanium
-based systems only: Selects the +Ofast option at optimization level +O4.
Equivalent to +Ofast +O3 -ipo.
For PA-RISC systems only: +Ofaster drops to +O3.