|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Object | +--coins.opt.CommonSubexpElim | +--coins.opt.CommonSubexpElimHir | +--coins.opt.CommonSubexpElimHirE
This class performs common subexpresssion elimination operations that are specific to HIR.
フィールドの概要 | |
protected AliasAnal |
fAlias
|
protected java.util.Set |
fAvailableExps
fAvailable Set of ExpId's for currently available expressions in BBlock . |
protected java.util.Set |
fAvailableTemps
fAssigned: Set of available temporal variables in BBlock. |
protected boolean |
fBeforePRE
|
protected int[] |
fExpCost
|
protected int |
fIndexMax
|
protected int |
fIndexMin
|
protected java.util.Map |
fLatestNodeForExpId
|
protected RecordAlias |
fRecordAlias
|
protected java.util.Set |
fReplacedNodes
|
protected int |
fThreshold
fThreshold Replacement threshold. |
クラス coins.opt.CommonSubexpElimHir から継承したフィールド |
fGlobalExpTempMap, fGlobalTempExpMap, hir |
クラス coins.opt.CommonSubexpElim から継承したフィールド |
fDbgLevel, fFunctionsWithoutSideEffect, flowRoot, fSubpFlow, sym, symRoot |
コンストラクタの概要 | |
CommonSubexpElimHirE(FlowRoot pFlowRoot,
int pThreshold)
|
|
CommonSubexpElimHirE(FlowRoot pFlowRoot,
int pThreshold,
boolean pBeforePRE)
Constructor CommonSubexpElimHirE |
メソッドの概要 | |
protected void |
adjustAvailability(HIR pExp,
Stmt pStmt,
BBlock pBBlock)
adjustAvailability Add pExp and all its subexpressions to fAvailableExps. |
boolean |
containsCall(HIR pHir)
|
(パッケージプライベート) void |
dbg(int level,
java.lang.Object pObject)
|
(パッケージプライベート) void |
dbg(int level,
java.lang.String pHeader,
java.lang.Object pObject)
|
boolean |
doBBlockLocal(BBlock pBBlock)
Performs the common subexpression elimination within the given BBlock. |
void |
estimateExpCost(SubpDefinition pSubpDef)
estimateExpCost Estimate the approximate cost of subexpressions in the HIR body of pSubpDef by formula (Exp cost) = (node cost) + (cost of subexpressions) The costs of VarNode and contents node are machineParam.costOfInstruction(MachineParam.COST_INDEX_TEMP_LOAD). |
protected HIR |
getLatestCall(HIR pExp,
BBlock pBBlock)
|
protected HIR |
getLatestNodeOfExp(HIR pExp,
BBlock pBBlock)
getLatestNodeOfExp Get the latest node having maximum node index among the nodes whose node index is less than that of pExp. |
protected void |
insertTheStatement(Stmt pInsertionPoint,
Stmt pStmtToBeInserted)
|
protected boolean |
replaceAvailableExp(HIR pExp,
BBlock pBBlock,
Stmt pStmt)
replaceAvailableExp Replace the computation of pExp by a temporal variable if all of its operands are in fAvailableExps. |
protected boolean |
replaceExp(HIR pExp,
BBlock pBBlock,
Stmt pStmt)
replaceExp Replace the computation of pExp by a temporal variable. |
protected boolean |
replaceTheExpression(HIR pOldExp,
HIR pNewExp,
BBlock pBBlock)
replaceTheExpression Replace pOldExp with pNewExp after recording all nodes of pOldExp to fReplacedNodes so that they should not be replaced in later processing. |
(パッケージプライベート) boolean |
toBeExcluded(HIR pHir)
Expressions to be excluded from replacement are FunctionExp, List, comparison expression, undecay, BlockStmt, left hand side of AssignStmt, and expressions whose type is vector/struct/union/Subp. |
protected boolean |
tryToEliminateExp(HIR pExp,
BBlock pBBlock,
Stmt pStmt)
tryToEliminateExp //##25 Try to eliminate pExp or its subexpressions if their values are already computed in pBBlock. |
protected boolean |
tryToEliminateSubexp(HIR pExp,
BBlock pBBlock,
Stmt pStmt)
tryToEliminateSubexp //##25 Try to eliminate subexpressions of pExp if their values are already computed in pBBlock. |
protected boolean |
tryToReplaceSubexp(HIR pExp,
BBlock pBBlock,
Stmt pStmt)
tryToReplaceSubexp Try to replace subexpressions of pExp which is to be replaced. |
クラス coins.opt.CommonSubexpElimHir から継承したメソッド |
eliminateComplex, eliminateSimple, operandSet, recordTempExpCorrespondence, registerUseSyms, reregisterSubexps |
クラス coins.opt.CommonSubexpElim から継承したメソッド |
doBBlockLocal |
クラス java.lang.Object から継承したメソッド |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
フィールドの詳細 |
protected AliasAnal fAlias
protected RecordAlias fRecordAlias
protected java.util.Set fAvailableExps
protected java.util.Set fAvailableTemps
protected java.util.Set fReplacedNodes
protected java.util.Map fLatestNodeForExpId
protected int[] fExpCost
protected int fIndexMin
protected int fIndexMax
protected boolean fBeforePRE
protected int fThreshold
コンストラクタの詳細 |
public CommonSubexpElimHirE(FlowRoot pFlowRoot, int pThreshold)
public CommonSubexpElimHirE(FlowRoot pFlowRoot, int pThreshold, boolean pBeforePRE)
pBeforePRE
- true if invoked as the preparatory optimization
for partial redundancy elimination, false otherwise.メソッドの詳細 |
public boolean doBBlockLocal(BBlock pBBlock)
CommonSubexpElim
内の doBBlockLocal
protected boolean tryToEliminateExp(HIR pExp, BBlock pBBlock, Stmt pStmt)
pExp
- expression to be examined for elimination.pBBlock
- basic block containing pExp.pStmt
- statement containing pExp.
protected boolean tryToEliminateSubexp(HIR pExp, BBlock pBBlock, Stmt pStmt)
pExp
- expression whose subexpression are to be
examined for elimination.pBBlock
- basic block containing pExp.pStmt
- statement containing pExp.
boolean toBeExcluded(HIR pHir)
public boolean containsCall(HIR pHir)
protected void adjustAvailability(HIR pExp, Stmt pStmt, BBlock pBBlock)
pExp
- Expression to be adjusted.pStmt
- Statement including pExp. //##65protected boolean replaceAvailableExp(HIR pExp, BBlock pBBlock, Stmt pStmt)
pExp
- expression to be examined for replacement.pBBlock
- basic block containing pExp.pStmt
- statement containing pExp.
protected boolean replaceExp(HIR pExp, BBlock pBBlock, Stmt pStmt)
pExp
- expression to be replaced.pBBlock
- basic block containing pExp.pStmt
- statement containing pExp.
protected boolean tryToReplaceSubexp(HIR pExp, BBlock pBBlock, Stmt pStmt)
pExp
- expression whose subexpression are to be
examined for relacement.pBBlock
- basic block containing pExp.pStmt
- statement containing pExp.protected boolean replaceTheExpression(HIR pOldExp, HIR pNewExp, BBlock pBBlock)
pOldExp
- expression to be replaced.pNewExp
- expression to be used in replacement.pBBlock
- basic block containing pOldExp.protected void insertTheStatement(Stmt pInsertionPoint, Stmt pStmtToBeInserted)
protected HIR getLatestNodeOfExp(HIR pExp, BBlock pBBlock)
pExp
- expression to be replaced.pBBlock
- basic block containing pExp.
protected HIR getLatestCall(HIR pExp, BBlock pBBlock)
public void estimateExpCost(SubpDefinition pSubpDef)
pSubpDef
- Subprogram definition.void dbg(int level, java.lang.Object pObject)
void dbg(int level, java.lang.String pHeader, java.lang.Object pObject)
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |