OpenADFortTk (including Open64 and OpenAnalysis references)
|
#include <ManagerReachConstsStandard.hpp>
Public Member Functions | |
ManagerReachConstsStandard (OA_ptr< ReachConstsIRInterface > _ir) | |
~ManagerReachConstsStandard () | |
OA_ptr< ReachConstsStandard > | performAnalysis (ProcHandle, OA_ptr< CFG::CFGInterface > cfg, OA_ptr< Alias::Interface > alias, OA_ptr< SideEffect::InterSideEffectInterface > interSE, DataFlow::DFPImplement algorithm) |
Private Types | |
enum | MeetOp { CD1toBOTTOM, CD2toBOTTOM, BOTHtoBOTTOM, CD1toVALUECD2, CD2toVALUECD1, NOTHING } |
Private Attributes | |
OA_ptr< ReachConstsIRInterface > | mIR |
ProcHandle | mProc |
OA_ptr< Alias::Interface > | mAlias |
std::map< StmtHandle, std::set < OA_ptr< Location > > > | mStmtMayDefMap |
std::map< StmtHandle, std::set < OA_ptr< Location > > > | mStmtMustDefMap |
OA_ptr< ConstDefSet > | mAllTop |
OA_ptr< ConstDefSet > | mAllBottom |
OA_ptr< CFG::CFGInterface > | mCFG |
OA_ptr < SideEffect::InterSideEffectInterface > | mInterSE |
OA_ptr< ReachConstsStandard > | mRCS |
OA_ptr< DataFlow::CFGDFSolver > | mSolver |
The AnnotationManager for ReachConstsStandard. This class can build an ReachConstsStandard, (eventually) read one in from a file, and write one out to a file.
Definition at line 49 of file ManagerReachConstsStandard.hpp.
|
private |
Enumerator | |
---|---|
CD1toBOTTOM | |
CD2toBOTTOM | |
BOTHtoBOTTOM | |
CD1toVALUECD2 | |
CD2toVALUECD1 | |
NOTHING |
Definition at line 117 of file ManagerReachConstsStandard.hpp.
OA::ReachConsts::ManagerReachConstsStandard::ManagerReachConstsStandard | ( | OA_ptr< ReachConstsIRInterface > | _ir) |
Definition at line 38 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::debug, OA::DataFlow::CFGDFSolver::Forward, mSolver, and OA_DEBUG_CTRL_MACRO.
|
inline |
Definition at line 54 of file ManagerReachConstsStandard.hpp.
|
private |
Decides meet operation for two ConstDefs that are may(not must)Locs.
Definition at line 738 of file ManagerReachConstsStandard.cpp.
References BOTHtoBOTTOM, OA::ReachConsts::BOTTOM, CD1toBOTTOM, CD2toBOTTOM, NOTHING, OA::ReachConsts::TOP, and OA::ReachConsts::VALUE.
Referenced by meet().
|
private |
Decides meet operation for two ConstDefs that are mustLocs.
Definition at line 675 of file ManagerReachConstsStandard.cpp.
References BOTHtoBOTTOM, OA::ReachConsts::BOTTOM, CD1toBOTTOM, CD1toVALUECD2, CD2toBOTTOM, CD2toVALUECD1, NOTHING, OA::ReachConsts::TOP, and OA::ReachConsts::VALUE.
Referenced by meet().
|
privatevirtual |
Return an initialized bottom set.
Implements OA::DataFlow::CFGDFProblem.
Definition at line 109 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::debug, initializeTopAndBottom(), mAllBottom, mIR, and NULL.
|
private |
|
privatevirtual |
Should generate an in and out DataFlowSet for node.
Implements OA::DataFlow::CFGDFProblem.
Definition at line 235 of file ManagerReachConstsStandard.cpp.
References OA::CFG::CFGInterface::getEntry(), initializeTopAndBottom(), mAllBottom, mAllTop, mCFG, NULL, and OA::OA_ptr< T >::ptrEqual().
|
privatevirtual |
Implements OA::DataFlow::CFGDFProblem.
Definition at line 249 of file ManagerReachConstsStandard.cpp.
References OA::CFG::CFGInterface::getEntry(), initializeTopAndBottom(), mAllBottom, mAllTop, mCFG, NULL, and OA::OA_ptr< T >::ptrEqual().
|
privatevirtual |
Return an initialized top set.
Implements OA::DataFlow::CFGDFProblem.
Definition at line 97 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::debug, initializeTopAndBottom(), mAllTop, mIR, and NULL.
|
private |
helper method for initializeTop and initializeBottom
Definition at line 45 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::BOTTOM, OA::StmtHandleIterator::current(), OA::ReachConsts::debug, OA::Location::dump(), OA::Alias::Interface::getMustLocs(), OA::StmtHandleIterator::isValid(), mAlias, mAllBottom, mAllTop, mIR, mProc, and OA::ReachConsts::TOP.
Referenced by initializeBottom(), initializeNodeIN(), initializeNodeOUT(), and initializeTop().
|
privatevirtual |
meet routine for ReachConsts
Implements OA::DataFlow::CFGDFProblem.
Definition at line 290 of file ManagerReachConstsStandard.cpp.
References BOTHtoBOTTOM, OA::ReachConsts::BOTTOM, CD1toBOTTOM, CD1toVALUECD2, CD2toBOTTOM, CD2toVALUECD1, OA::OA_ptr< T >::convert(), OA::ReachConsts::ConstDefSetIterator::current(), OA::OA_ptr< T >::dump(), getMayOnlyMeetOp(), getMustMeetOp(), OA::ReachConsts::ConstDefSet::insert(), OA::ReachConsts::ConstDefSetIterator::isValid(), OA::Location::mayOverlap(), OA::ReachConsts::meet_debug, mIR, OA::Location::mustOverlap(), NOTHING, OA::ReachConsts::ConstDefSetIterator::reset(), and OA::ReachConsts::VALUE.
OA_ptr< ReachConstsStandard > OA::ReachConsts::ManagerReachConstsStandard::performAnalysis | ( | ProcHandle | proc, |
OA_ptr< CFG::CFGInterface > | cfg, | ||
OA_ptr< Alias::Interface > | alias, | ||
OA_ptr< SideEffect::InterSideEffectInterface > | interSE, | ||
DataFlow::DFPImplement | algorithm | ||
) |
Uses the CFGDFProblem::solve functionality to get In and Out constant definition sets for each basic block. Then uses the statement transfer function to get an In set for each stmt.
Definition at line 126 of file ManagerReachConstsStandard.cpp.
References mAlias, mCFG, mInterSE, mProc, mRCS, mSolver, and OA::DataFlow::CFGDFSolver::solve().
|
private |
Sets mMemRef2ReachConst[defMemRef] for defMemRefs in given statement ConstDefSet, in, should not be changed
Definition at line 869 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::ConstDefSet::find(), OA::Alias::Interface::getMayLocs(), mAlias, mIR, mRCS, NULL, OA::OA_ptr< T >::ptrEqual(), OA::Location::toString(), OA::ReachConsts::transfer_debug, and OA::ReachConsts::VALUE.
Referenced by transfer().
|
private |
Sets mMemRef2ReachConst[useMemRef] for useMemRefs in given statement ConstDefSet, in, should not be changed
Definition at line 795 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::ConstDefSet::find(), OA::Alias::Interface::getMayLocs(), mAlias, mIR, mRCS, NULL, OA::OA_ptr< T >::ptrEqual(), OA::Location::toString(), OA::ReachConsts::transfer_debug, and OA::ReachConsts::VALUE.
Referenced by transfer().
|
privatevirtual |
Core of analysis algorithm. Transfer function for a stmt.
KILL is the set of reaching const definitions <Loc,Const> where Loc MayOverlap a MayLoc for this statement (remember that MustOverlap is a subset of MayOverlap and that MustLoc is a subset of MayLoc) killREPLACE is the new ConstDef definition for the ConstDef in the KILL set These replace the reaching ConstDef with a ConstDefType of BOTTOM.
GEN: When statement expression evaluates to a non-null ConstValBasic, GEN is the set of const definitions <Loc,Const> where Loc is a MustLoc and MustOverlap for targets of this statement (The loc doesn't have to be in the inSet and it has to be a MustLoc. Loop through all the MustLocs for the MemRefExpr and pair them up with the ConstValBasic for the expression. Insert these into the inSet, replacing any existing ConstDef for that MustLoc.
Update inSet = inSet ( - KILLS + killREPLACE) + GENTransfer function for ReachConsts, inReachConsts->stmt->outReachConsts
Implements OA::DataFlow::CFGDFProblem.
Definition at line 505 of file ManagerReachConstsStandard.cpp.
References OA::ReachConsts::BOTTOM, OA::OA_ptr< T >::convert(), OA::ReachConsts::debug, OA::OA_ptr< T >::dump(), OA::EvalToConstVisitor::getConstVal(), OA::Alias::Interface::getMayLocs(), OA::SideEffect::InterSideEffectInterface::getMODIterator(), OA::Alias::Interface::getMustLocs(), OA::IRHandle::hval(), mAlias, OA::Location::mayOverlap(), mInterSE, mIR, mRCS, NULL, OA::OA_ptr< T >::ptrEqual(), setDefMemRef2Const(), setUseMemRef2Const(), OA::ReachConsts::transfer_debug, and OA::ReachConsts::VALUE.
|
private |
Definition at line 131 of file ManagerReachConstsStandard.hpp.
Referenced by initializeTopAndBottom(), performAnalysis(), setDefMemRef2Const(), setUseMemRef2Const(), and transfer().
|
private |
Definition at line 135 of file ManagerReachConstsStandard.hpp.
Referenced by initializeBottom(), initializeNodeIN(), initializeNodeOUT(), and initializeTopAndBottom().
|
private |
Definition at line 134 of file ManagerReachConstsStandard.hpp.
Referenced by initializeNodeIN(), initializeNodeOUT(), initializeTop(), and initializeTopAndBottom().
|
private |
Definition at line 136 of file ManagerReachConstsStandard.hpp.
Referenced by initializeNodeIN(), initializeNodeOUT(), and performAnalysis().
|
private |
Definition at line 137 of file ManagerReachConstsStandard.hpp.
Referenced by performAnalysis(), and transfer().
|
private |
Definition at line 129 of file ManagerReachConstsStandard.hpp.
Referenced by initializeBottom(), initializeTop(), initializeTopAndBottom(), meet(), setDefMemRef2Const(), setUseMemRef2Const(), and transfer().
|
private |
Definition at line 130 of file ManagerReachConstsStandard.hpp.
Referenced by initializeTopAndBottom(), and performAnalysis().
|
private |
Definition at line 138 of file ManagerReachConstsStandard.hpp.
Referenced by performAnalysis(), setDefMemRef2Const(), setUseMemRef2Const(), and transfer().
|
private |
Definition at line 140 of file ManagerReachConstsStandard.hpp.
Referenced by ManagerReachConstsStandard(), and performAnalysis().
|
private |
Definition at line 132 of file ManagerReachConstsStandard.hpp.
|
private |
Definition at line 133 of file ManagerReachConstsStandard.hpp.