Previous: Loop Unrolling
To eliminate complicated distributed index subscript expressions and
to hoist control variables in the inner loops, we adopted the
We call this algorithm HPJOPT2 (HPJava OPTimization
Applying Loop Unrolling is optional since it is only useful when
a nested overall loop involves the pattern, (i` + expr) % 2
such as in Figure 3.
We don't treat Step 3 of HPJOPT2 as a part of PRE. It is
feasible for control variables and control subscripts to be hoisted by
applying PRE. But using information available to the compiler,
we often know in advance they are loop invariant without applying
PRE. Thus, without requiring PRE, the compiler hoists them if they
are loop invariant.
- (Optional) Apply Loop Unrolling.
- Hoist control variables to the outermost loop by using compiler
information if loop invariant.
- Apply Partial Redundancy Elimination and Strength Reduction.
- Apply Dead Code Elimination.
In the section 5, we will see the performance of
HPJava adopting HPJOPT2 optimization strategies.