OpenADFortTk (including Open64 and OpenAnalysis references)
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OA::ReachConsts::ManagerReachConstsStandard Class Reference

#include <ManagerReachConstsStandard.hpp>

Inheritance diagram for OA::ReachConsts::ManagerReachConstsStandard:
Inheritance graph
Collaboration diagram for OA::ReachConsts::ManagerReachConstsStandard:
Collaboration graph

Public Member Functions

 ManagerReachConstsStandard (OA_ptr< ReachConstsIRInterface > _ir)
 
 ~ManagerReachConstsStandard ()
 
OA_ptr< ReachConstsStandardperformAnalysis (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 Member Functions

OA_ptr< DataFlow::DataFlowSetinitializeTop ()
 Return an initialized top set. More...
 
OA_ptr< DataFlow::DataFlowSetinitializeBottom ()
 Return an initialized bottom set. More...
 
void initializeTopAndBottom ()
 helper method for initializeTop and initializeBottom More...
 
void initializeNode (OA_ptr< CFG::NodeInterface > n)
 
OA_ptr< DataFlow::DataFlowSetinitializeNodeIN (OA_ptr< CFG::NodeInterface > n)
 Should generate an in and out DataFlowSet for node. More...
 
OA_ptr< DataFlow::DataFlowSetinitializeNodeOUT (OA_ptr< CFG::NodeInterface > n)
 
OA_ptr< DataFlow::DataFlowSetmeet (OA_ptr< DataFlow::DataFlowSet > set1, OA_ptr< DataFlow::DataFlowSet > set2)
 meet routine for ReachConsts More...
 
OA_ptr< DataFlow::DataFlowSettransfer (OA_ptr< DataFlow::DataFlowSet > in, OA::StmtHandle stmt)
 Core of analysis algorithm. Transfer function for a stmt. More...
 
void setUseMemRef2Const (StmtHandle stmt, const ConstDefSet &in)
 
void setDefMemRef2Const (StmtHandle stmt, const ConstDefSet &in)
 
MeetOp getMustMeetOp (OA_ptr< ConstDef > cd1, OA_ptr< ConstDef > cd2)
 Decides meet operation for two ConstDefs that are mustLocs. More...
 
MeetOp getMayOnlyMeetOp (OA_ptr< ConstDef > cd1, OA_ptr< ConstDef > cd2)
 Decides meet operation for two ConstDefs that are may(not must)Locs. More...
 
- Private Member Functions inherited from OA::DataFlow::CFGDFProblem
 CFGDFProblem ()
 
virtual ~CFGDFProblem ()
 

Private Attributes

OA_ptr< ReachConstsIRInterfacemIR
 
ProcHandle mProc
 
OA_ptr< Alias::InterfacemAlias
 
std::map< StmtHandle, std::set
< OA_ptr< Location > > > 
mStmtMayDefMap
 
std::map< StmtHandle, std::set
< OA_ptr< Location > > > 
mStmtMustDefMap
 
OA_ptr< ConstDefSetmAllTop
 
OA_ptr< ConstDefSetmAllBottom
 
OA_ptr< CFG::CFGInterfacemCFG
 
OA_ptr
< SideEffect::InterSideEffectInterface
mInterSE
 
OA_ptr< ReachConstsStandardmRCS
 
OA_ptr< DataFlow::CFGDFSolvermSolver
 

Detailed Description

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.

Member Enumeration Documentation

Enumerator
CD1toBOTTOM 
CD2toBOTTOM 
BOTHtoBOTTOM 
CD1toVALUECD2 
CD2toVALUECD1 
NOTHING 

Definition at line 117 of file ManagerReachConstsStandard.hpp.

Constructor & Destructor Documentation

OA::ReachConsts::ManagerReachConstsStandard::ManagerReachConstsStandard ( OA_ptr< ReachConstsIRInterface _ir)
OA::ReachConsts::ManagerReachConstsStandard::~ManagerReachConstsStandard ( )
inline

Definition at line 54 of file ManagerReachConstsStandard.hpp.

Member Function Documentation

ManagerReachConstsStandard::MeetOp OA::ReachConsts::ManagerReachConstsStandard::getMayOnlyMeetOp ( OA_ptr< ConstDef cd1,
OA_ptr< ConstDef cd2 
)
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().

ManagerReachConstsStandard::MeetOp OA::ReachConsts::ManagerReachConstsStandard::getMustMeetOp ( OA_ptr< ConstDef cd1,
OA_ptr< ConstDef cd2 
)
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().

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::initializeBottom ( )
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.

Here is the call graph for this function:

void OA::ReachConsts::ManagerReachConstsStandard::initializeNode ( OA_ptr< CFG::NodeInterface n)
private
OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::initializeNodeIN ( OA_ptr< CFG::NodeInterface n)
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().

Here is the call graph for this function:

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::initializeNodeOUT ( OA_ptr< CFG::NodeInterface n)
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().

Here is the call graph for this function:

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::initializeTop ( )
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.

Here is the call graph for this function:

void OA::ReachConsts::ManagerReachConstsStandard::initializeTopAndBottom ( )
private
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().

Here is the call graph for this function:

void OA::ReachConsts::ManagerReachConstsStandard::setDefMemRef2Const ( StmtHandle  stmt,
const ConstDefSet in 
)
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().

Here is the call graph for this function:

void OA::ReachConsts::ManagerReachConstsStandard::setUseMemRef2Const ( StmtHandle  stmt,
const ConstDefSet in 
)
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().

Here is the call graph for this function:

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::transfer ( OA_ptr< DataFlow::DataFlowSet in,
OA::StmtHandle  stmt 
)
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.

Here is the call graph for this function:

Member Data Documentation

OA_ptr<Alias::Interface> OA::ReachConsts::ManagerReachConstsStandard::mAlias
private
OA_ptr<ConstDefSet> OA::ReachConsts::ManagerReachConstsStandard::mAllBottom
private
OA_ptr<ConstDefSet> OA::ReachConsts::ManagerReachConstsStandard::mAllTop
private
OA_ptr<CFG::CFGInterface> OA::ReachConsts::ManagerReachConstsStandard::mCFG
private
OA_ptr<SideEffect::InterSideEffectInterface> OA::ReachConsts::ManagerReachConstsStandard::mInterSE
private

Definition at line 137 of file ManagerReachConstsStandard.hpp.

Referenced by performAnalysis(), and transfer().

OA_ptr<ReachConstsIRInterface> OA::ReachConsts::ManagerReachConstsStandard::mIR
private
ProcHandle OA::ReachConsts::ManagerReachConstsStandard::mProc
private

Definition at line 130 of file ManagerReachConstsStandard.hpp.

Referenced by initializeTopAndBottom(), and performAnalysis().

OA_ptr<ReachConstsStandard> OA::ReachConsts::ManagerReachConstsStandard::mRCS
private
OA_ptr<DataFlow::CFGDFSolver> OA::ReachConsts::ManagerReachConstsStandard::mSolver
private

Definition at line 140 of file ManagerReachConstsStandard.hpp.

Referenced by ManagerReachConstsStandard(), and performAnalysis().

std::map<StmtHandle,std::set<OA_ptr<Location> > > OA::ReachConsts::ManagerReachConstsStandard::mStmtMayDefMap
private

Definition at line 132 of file ManagerReachConstsStandard.hpp.

std::map<StmtHandle,std::set<OA_ptr<Location> > > OA::ReachConsts::ManagerReachConstsStandard::mStmtMustDefMap
private

Definition at line 133 of file ManagerReachConstsStandard.hpp.


The documentation for this class was generated from the following files: