cetus.transforms
Class IVSubstitution
java.lang.Object
cetus.transforms.TransformPass
cetus.transforms.IVSubstitution
public class IVSubstitution
- extends TransformPass
IVSubstitution performs induction variable substitution for additive
induction variables. The transformation proceeds in two steps, analysis and
transformation. The analysis phase detects potential induction variables
by matching the statement type that have the following structure.
iv = iv+expr, iv = iv-expr
iv += expr, iv -= expr
iv++, iv--, ++iv, --iv
, where expr is either loop-invariant or another induction variable.
iv, of course, cannot appear as a defined variable in the loop except for
the induction statement. After this matching process, comes a feasibility
test that removes any cases where substitution cannot proceed.
The transformation phase performs substitution and statement removal
depending on the type of each statement. The key enabling functionality of
this phase is symbolic summation operation which is provided as a external
tool implemented in Symbolic class.
TODOs:
incorporation with live variable analysis.
Algorithms in the CPC09 paper.
|
Constructor Summary |
IVSubstitution(Program program)
Constructs an induction variable transformation pass with the given
program object. |
|
Method Summary |
java.lang.String |
getPassName()
Returns the pass name for the transformation. |
void |
start()
Performs the induction variable substitution transformation in two phases. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
IVSubstitution
public IVSubstitution(Program program)
- Constructs an induction variable transformation pass with the given
program object.
- Parameters:
program - the input program.
getPassName
public java.lang.String getPassName()
- Returns the pass name for the transformation.
- Specified by:
getPassName in class TransformPass
- Returns:
- the pass name.
start
public void start()
- Performs the induction variable substitution transformation in two phases.
First phase performs analysis to check if the loop is eligible for
transformation, and the second phase performs actual transformation if
it is allowed.
- Specified by:
start in class TransformPass