Package org.apache.sysds.parser
Class StatementBlock
- java.lang.Object
 - 
- org.apache.sysds.parser.LiveVariableAnalysis
 - 
- org.apache.sysds.parser.StatementBlock
 
 
 
- 
- All Implemented Interfaces:
 ParseInfo
- Direct Known Subclasses:
 ForStatementBlock,FunctionStatementBlock,IfStatementBlock,WhileStatementBlock
public class StatementBlock extends LiveVariableAnalysis implements ParseInfo
 
- 
- 
Field Summary
Fields Modifier and Type Field Description static doubleDEFAULT_LOOP_REPETITIONS 
- 
Constructor Summary
Constructors Constructor Description StatementBlock()StatementBlock(StatementBlock sb) 
- 
Method Summary
- 
Methods inherited from class org.apache.sysds.parser.LiveVariableAnalysis
getGen, getKill, getWarn, liveIn, liveOut, setGen, setKill, setLiveIn, setLiveOut, setReadVariables, setUpdatedVariables, updateLiveVariablesOut, variablesRead, variablesUpdated 
 - 
 
 - 
 
- 
- 
Field Detail
- 
DEFAULT_LOOP_REPETITIONS
public static final double DEFAULT_LOOP_REPETITIONS
- See Also:
 - Constant Field Values
 
 
 - 
 
- 
Constructor Detail
- 
StatementBlock
public StatementBlock()
 
- 
StatementBlock
public StatementBlock(StatementBlock sb)
 
 - 
 
- 
Method Detail
- 
setDMLProg
public void setDMLProg(DMLProgram dmlProg)
 
- 
getDMLProg
public DMLProgram getDMLProg()
 
- 
getSBID
public long getSBID()
 
- 
getName
public String getName()
 
- 
addStatement
public void addStatement(Statement s)
 
- 
addStatementBlock
public void addStatementBlock(StatementBlock s)
 
- 
getNumStatements
public int getNumStatements()
 
- 
getStatement
public Statement getStatement(int i)
 
- 
mergeable
public boolean mergeable()
 
- 
setSplitDag
public void setSplitDag(boolean flag)
 
- 
isSplitDag
public boolean isSplitDag()
 
- 
getLoopDepRatio
public double getLoopDepRatio()
 
- 
setLoopDepRatio
public void setLoopDepRatio(double dep)
 
- 
isMergeableFunctionCallBlock
public boolean isMergeableFunctionCallBlock(DMLProgram dmlProg)
 
- 
isRewritableFunctionCall
public boolean isRewritableFunctionCall(Statement stmt, DMLProgram dmlProg)
 
- 
mergeFunctionCalls
public static ArrayList<StatementBlock> mergeFunctionCalls(List<StatementBlock> body, DMLProgram dmlProg)
 
- 
getOutputsofSB
public ArrayList<DataIdentifier> getOutputsofSB()
 
- 
mergeStatementBlocks
public static ArrayList<StatementBlock> mergeStatementBlocks(List<StatementBlock> sb)
 
- 
rHoistFunctionCallsFromExpressions
public static List<StatementBlock> rHoistFunctionCallsFromExpressions(StatementBlock current, DMLProgram prog)
 
- 
rHoistFunctionCallsFromExpressions
public static List<Statement> rHoistFunctionCallsFromExpressions(Statement stmt, DMLProgram prog)
 
- 
rHoistFunctionCallsFromExpressions
public static Expression rHoistFunctionCallsFromExpressions(Expression expr, boolean root, ArrayList<Statement> tmp, DMLProgram prog)
 
- 
rewriteFunctionCallStatements
public ArrayList<Statement> rewriteFunctionCallStatements(DMLProgram dmlProg, ArrayList<Statement> statements)
 
- 
validate
public VariableSet validate(DMLProgram dmlProg, VariableSet ids, HashMap<String,ConstIdentifier> constVars, boolean conditional)
 
- 
setStatementFormatType
public void setStatementFormatType(OutputStatement s, boolean conditionalValidate)
 
- 
setStatementFormatType
public void setStatementFormatType(AssignmentStatement s, boolean conditionalValidate)
 
- 
initializeforwardLV
public VariableSet initializeforwardLV(VariableSet activeIn)
For each statement: gen rule: for each variable read in current statement but not updated in any PRIOR statement, add to gen Handles case where variable both read and updated in same statement (i = i + 1, i needs to be added to gen) kill rule: for each variable updated in current statement but not read in this or any PRIOR statement, add to kill.- Specified by:
 initializeforwardLVin classLiveVariableAnalysis
 
- 
initializebackwardLV
public VariableSet initializebackwardLV(VariableSet loPassed)
- Specified by:
 initializebackwardLVin classLiveVariableAnalysis
 
- 
getConstIn
public HashMap<String,ConstIdentifier> getConstIn()
 
- 
getConstOut
public HashMap<String,ConstIdentifier> getConstOut()
 
- 
analyze
public VariableSet analyze(VariableSet loPassed)
- Specified by:
 analyzein classLiveVariableAnalysis
 
- 
hasHops
public boolean hasHops()
 
- 
raiseValidateError
public void raiseValidateError(String msg, boolean conditional)
 
- 
raiseValidateError
public void raiseValidateError(String msg, boolean conditional, String errorCode)
 
- 
setFilename
public void setFilename(String fname)
- Specified by:
 setFilenamein interfaceParseInfo
 
- 
setBeginLine
public void setBeginLine(int passed)
- Specified by:
 setBeginLinein interfaceParseInfo
 
- 
setBeginColumn
public void setBeginColumn(int passed)
- Specified by:
 setBeginColumnin interfaceParseInfo
 
- 
setEndLine
public void setEndLine(int passed)
- Specified by:
 setEndLinein interfaceParseInfo
 
- 
setEndColumn
public void setEndColumn(int passed)
- Specified by:
 setEndColumnin interfaceParseInfo
 
- 
setParseInfo
public void setParseInfo(ParseInfo parseInfo)
Set parse information.- Parameters:
 parseInfo- parse information, such as beginning line position, beginning column position, ending line position, ending column position, text, and filename the DML filename (if it exists)
 
- 
getFilename
public String getFilename()
- Specified by:
 getFilenamein interfaceParseInfo
 
- 
getBeginLine
public int getBeginLine()
- Specified by:
 getBeginLinein interfaceParseInfo
 
- 
getBeginColumn
public int getBeginColumn()
- Specified by:
 getBeginColumnin interfaceParseInfo
 
- 
getEndLine
public int getEndLine()
- Specified by:
 getEndLinein interfaceParseInfo
 
- 
getEndColumn
public int getEndColumn()
- Specified by:
 getEndColumnin interfaceParseInfo
 
- 
printErrorLocation
public String printErrorLocation()
 
- 
printBlockErrorLocation
public String printBlockErrorLocation()
 
- 
printWarningLocation
public String printWarningLocation()
 
- 
updateRecompilationFlag
public boolean updateRecompilationFlag()
 
- 
requiresRecompilation
public boolean requiresRecompilation()
 
- 
setNondeterministic
public void setNondeterministic(boolean flag)
 
- 
isNondeterministic
public boolean isNondeterministic()
 
- 
setRecompileOnce
public void setRecompileOnce(boolean flag)
 
- 
isRecompileOnce
public boolean isRecompileOnce()
 
 - 
 
 -