OA::ReachConsts::ManagerReachConstsStandard Class Reference

#include <ManagerReachConstsStandard.hpp>

Inheritance diagram for OA::ReachConsts::ManagerReachConstsStandard:
Inheritance graph
[legend]
Collaboration diagram for OA::ReachConsts::ManagerReachConstsStandard:
Collaboration graph
[legend]

List of all members.

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.
OA_ptr< DataFlow::DataFlowSetinitializeBottom ()
 Return an initialized bottom set.
void initializeTopAndBottom ()
 helper method for initializeTop and initializeBottom
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.
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
OA_ptr< DataFlow::DataFlowSettransfer (OA_ptr< DataFlow::DataFlowSet > in, OA::StmtHandle stmt)
 Core of analysis algorithm. Transfer function for a stmt.
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.
MeetOp getMayOnlyMeetOp (OA_ptr< ConstDef > cd1, OA_ptr< ConstDef > cd2)
 Decides meet operation for two ConstDefs that are may(not must)Locs.

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 (  )  [private, virtual]

Return an initialized bottom set.

Implements OA::DataFlow::CFGDFProblem.

Definition at line 109 of file ManagerReachConstsStandard.cpp.

References OA::ReachConsts::debug, OA::OA_ptr< T >::dump(), initializeTopAndBottom(), mAllBottom, mIR, and OA::OA_ptr< T >::ptrEqual().

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  )  [private, virtual]

Should generate an in and out DataFlowSet for node.

Implements OA::DataFlow::CFGDFProblem.

Definition at line 235 of file ManagerReachConstsStandard.cpp.

References initializeTopAndBottom(), mAllBottom, mAllTop, mCFG, 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  )  [private, virtual]

Implements OA::DataFlow::CFGDFProblem.

Definition at line 249 of file ManagerReachConstsStandard.cpp.

References initializeTopAndBottom(), mAllBottom, mAllTop, mCFG, and OA::OA_ptr< T >::ptrEqual().

Here is the call graph for this function:

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::initializeTop (  )  [private, virtual]

Return an initialized top set.

Implements OA::DataFlow::CFGDFProblem.

Definition at line 97 of file ManagerReachConstsStandard.cpp.

References OA::ReachConsts::debug, OA::OA_ptr< T >::dump(), initializeTopAndBottom(), mAllTop, mIR, and OA::OA_ptr< T >::ptrEqual().

Here is the call graph for this function:

void OA::ReachConsts::ManagerReachConstsStandard::initializeTopAndBottom (  )  [private]

helper method for initializeTop and initializeBottom

Definition at line 45 of file ManagerReachConstsStandard.cpp.

References OA::ReachConsts::BOTTOM, OA::ReachConsts::debug, OA::OA_ptr< T >::dump(), mAlias, mAllBottom, mAllTop, mIR, mProc, and OA::ReachConsts::TOP.

Referenced by initializeBottom(), initializeNodeIN(), initializeNodeOUT(), and initializeTop().

Here is the call graph for this function:

OA_ptr< DataFlow::DataFlowSet > OA::ReachConsts::ManagerReachConstsStandard::meet ( OA_ptr< DataFlow::DataFlowSet set1,
OA_ptr< DataFlow::DataFlowSet set2 
) [private, virtual]
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, and mSolver.

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(), mAlias, mIR, mRCS, OA::OA_ptr< T >::ptrEqual(), 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(), mAlias, mIR, mRCS, OA::OA_ptr< T >::ptrEqual(), 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 
) [private, virtual]

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) + GEN Transfer 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::IRHandle::hval(), mAlias, mInterSE, mIR, mRCS, 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

Definition at line 137 of file ManagerReachConstsStandard.hpp.

Referenced by performAnalysis(), and transfer().

Definition at line 130 of file ManagerReachConstsStandard.hpp.

Referenced by initializeTopAndBottom(), and performAnalysis().

Definition at line 140 of file ManagerReachConstsStandard.hpp.

Referenced by ManagerReachConstsStandard(), and performAnalysis().

Definition at line 132 of file ManagerReachConstsStandard.hpp.

Definition at line 133 of file ManagerReachConstsStandard.hpp.


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

Generated on Sat Oct 31 05:32:42 2009 for OpenAnalysis by  doxygen 1.6.1