Package org.apache.sysds.hops.rewrite
Class StatementBlockRewriteRule
java.lang.Object
org.apache.sysds.hops.rewrite.StatementBlockRewriteRule
- Direct Known Subclasses:
MarkForLineageReuse,RewriteCompressedReblock,RewriteForLoopVectorization,RewriteHoistLoopInvariantOperations,RewriteInjectOOCTee,RewriteInjectSparkLoopCheckpointing,RewriteJoinReordering,RewriteMarkLoopVariablesUpdateInPlace,RewriteMergeBlockSequence,RewriteRaPushdown,RewriteRemoveEmptyBasicBlocks,RewriteRemoveEmptyForLoops,RewriteRemoveForLoopEmptySequence,RewriteRemoveTransformEncodeMeta,RewriteRemoveUnnecessaryBranches,RewriteSplitDagDataDependentOperators,RewriteSplitDagUnknownCSVRead
Base class for all hop rewrites in order to enable generic
application of all rules.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringcreateCutVarName(boolean fun) abstract booleanIndicates if the rewrite potentially splits dags, which is used for phase ordering of rewrites.abstract List<StatementBlock>Handle an arbitrary statement block.abstract List<StatementBlock>rewriteStatementBlocks(List<StatementBlock> sbs, ProgramRewriteStatus state) Handle a list of statement blocks.
-
Constructor Details
-
StatementBlockRewriteRule
public StatementBlockRewriteRule()
-
-
Method Details
-
createCutVarName
-
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
-