Package org.apache.sysds.hops.rewrite
Class StatementBlockRewriteRule
- java.lang.Object
-
- org.apache.sysds.hops.rewrite.StatementBlockRewriteRule
-
- Direct Known Subclasses:
MarkForLineageReuse
,RewriteCompressedReblock
,RewriteForLoopVectorization
,RewriteHoistLoopInvariantOperations
,RewriteInjectSparkLoopCheckpointing
,RewriteMarkLoopVariablesUpdateInPlace
,RewriteMergeBlockSequence
,RewriteRemoveEmptyBasicBlocks
,RewriteRemoveForLoopEmptySequence
,RewriteRemoveUnnecessaryBranches
,RewriteSplitDagDataDependentOperators
,RewriteSplitDagUnknownCSVRead
public abstract class StatementBlockRewriteRule extends Object
Base class for all hop rewrites in order to enable generic application of all rules.
-
-
Constructor Summary
Constructors Constructor Description StatementBlockRewriteRule()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description static String
createCutVarName(boolean fun)
abstract boolean
createsSplitDag()
Indicates if the rewrite potentially splits dags, which is used for phase ordering of rewrites.abstract List<StatementBlock>
rewriteStatementBlock(StatementBlock sb, ProgramRewriteStatus state)
Handle an arbitrary statement block.abstract List<StatementBlock>
rewriteStatementBlocks(List<StatementBlock> sbs, ProgramRewriteStatus state)
Handle a list of statement blocks.
-
-
-
Method Detail
-
createCutVarName
public static String createCutVarName(boolean fun)
-
createsSplitDag
public abstract boolean createsSplitDag()
Indicates if the rewrite potentially splits dags, which is used for phase ordering of rewrites.- Returns:
- true if dag splits are possible.
-
rewriteStatementBlock
public abstract List<StatementBlock> rewriteStatementBlock(StatementBlock sb, ProgramRewriteStatus state)
Handle an arbitrary statement block. Specific type constraints have to be ensured within the individual rewrites. If a rewrite does not apply to individual blocks, it should simply return the input block.- Parameters:
sb
- statement blockstate
- program rewrite status- Returns:
- list of statement blocks
-
rewriteStatementBlocks
public abstract List<StatementBlock> rewriteStatementBlocks(List<StatementBlock> sbs, ProgramRewriteStatus state)
Handle a list of statement blocks. Specific type constraints have to be ensured within the individual rewrites. If a rewrite does not require sequence access, it should simply return the input list of statement blocks.- Parameters:
sbs
- list of statement blocksstate
- program rewrite status- Returns:
- list of statement blocks
-
-