public final class Loop
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
extractBody(NestedDoStatement nest)
Extract the body of the inner do statement and place it directly after the
outer do statement.
|
static void |
extractBody(Xnode loop)
Extract the body of a do statement and place it directly after it.
|
static void |
extractBody(Xnode loop,
Xnode ref)
Extract the body of a do statement and place it after the reference node.
|
static java.lang.String |
extractInductionVariable(Xnode doStatement)
Get the string representation of the induction variable of a do statement.
|
static boolean |
hasSameIndexRange(Xnode l1,
Xnode l2)
Compare the iteration range of two do statements.
|
static boolean |
hasSameIndexRangeBesidesLower(Xnode l1,
Xnode l2)
Compare the iteration range of two do statements.
|
static HoistedNestedDoStatement |
hoist(java.util.List<HoistedNestedDoStatement> hoistedGroups,
Xnode start,
Xnode end,
XcodeML xcodeml)
Perform a loop hoisting on the given nested do statements.
|
static void |
merge(NestedDoStatement master,
NestedDoStatement slave)
Merge two nested do statements group together.
|
static void |
merge(Xnode masterDoStmt,
Xnode slaveDoStmt)
Merge two do statements together.
|
static void |
reorder(NestedDoStatement nestedGroup,
java.util.List<java.lang.String> newInductionVarOrder)
Perform a do statements reordering based on the new order specified by
induction variables.
|
public static void merge(Xnode masterDoStmt, Xnode slaveDoStmt) throws IllegalTransformationException
masterDoStmt
- Master do statement for the merge operation. Stay in
place. Other do statement will be merged into it.slaveDoStmt
- Slave do statement for the merge operation. Will be
merged into the master do statement.IllegalTransformationException
- If given node are null or not
FdoStatement nodes.public static void merge(NestedDoStatement master, NestedDoStatement slave) throws IllegalTransformationException
master
- Master nested do statements group for the merge operation.slave
- Slave nested do statements group for the merge operation.IllegalTransformationException
- If given node are null or not
FdoStatement nodes.public static void reorder(NestedDoStatement nestedGroup, java.util.List<java.lang.String> newInductionVarOrder) throws IllegalTransformationException
nestedGroup
- The nested group of do statements to be
reordered.newInductionVarOrder
- New order of the induction variables.
E.g. k,j,i.IllegalTransformationException
- If reordering acton is not
supported.public static HoistedNestedDoStatement hoist(java.util.List<HoistedNestedDoStatement> hoistedGroups, Xnode start, Xnode end, XcodeML xcodeml) throws IllegalTransformationException
hoistedGroups
- List of groups that will be hoisted.start
- Starting point of the hoisted loop.end
- Ending point of the hoisted loop.xcodeml
- Current XcodeML translation unit for node creation.IllegalTransformationException
- If underlying methods throw
exception.public static void extractBody(Xnode loop, Xnode ref) throws IllegalTransformationException
loop
- The do statement containing the body to be extracted.ref
- Element after which statement are shifted.IllegalTransformationException
- If node passed as arguments are
incompatible with the
transformation.public static void extractBody(Xnode loop) throws IllegalTransformationException
loop
- The do statement containing the body to be extracted.IllegalTransformationException
- If node passed as arguments are
incompatible with the
transformation.public static void extractBody(NestedDoStatement nest) throws IllegalTransformationException
nest
- Nest do statement group.IllegalTransformationException
- If node passed as arguments are
incompatible with the
transformation.public static java.lang.String extractInductionVariable(Xnode doStatement)
doStatement
- Do statement to extract the induction variable.public static boolean hasSameIndexRange(Xnode l1, Xnode l2)
l1
- First do statement.l2
- Second do statement.