#include <SSAStandard.hpp>

Classes | |
| class | Def |
| class | DefBlocksIterator |
| class | LeafDef |
| class | LeafUse |
| class | NonLocalsIterator |
| class | PhiDef |
| class | PhiNodesIterator |
| class | PhiUse |
| class | Use |
Public Member Functions | |
| SSAStandard (const SymHandle name, OA_ptr< SSAIRInterface > ir, OA_ptr< CFG::CFGInterface > cfg) | |
| virtual | ~SSAStandard () |
| void | dump (std::ostream &) |
| OA_ptr< PhiNodesIterator > | getPhiNodesIterator (OA_ptr< CFG::NodeInterface > n) |
| OA_ptr< NonLocalsIterator > | getNonLocalsIterator () |
| OA_ptr< DefBlocksIterator > | getDefBlocksIterator (SymHandle nm) |
Private Member Functions | |
| void | compute_uses_sets () |
Private Attributes | |
| SymHandle | name |
| OA_ptr< CFG::CFGInterface > | cfg |
| std::map< OA_ptr < CFG::NodeInterface > , std::set< OA_ptr< SSA::Phi > > > | phi_node_sets |
| OA_ptr< SSAIRInterface > | mIR |
| std::set< LeafHandle > | non_locals |
| std::map< SymHandle, std::set < OA_ptr< CFG::NodeInterface > > > | def_blocks_set |
Friends | |
| class | PhiNodesIterator |
| class | NonLocalsIterator |
| class | DefBlocksIterator |
CFGStandard implements the CFG::Interface using the DGraph class. FIXME -- we should have an SSAStandard, etc.
Definition at line 49 of file SSAStandard.hpp.
| OA::SSA::SSAStandard::SSAStandard | ( | const SymHandle | name_, | |
| OA_ptr< SSAIRInterface > | ir_, | |||
| OA_ptr< CFG::CFGInterface > | cfg_ | |||
| ) |
SSA constructor computes the dominator tree, and dominance frontiers from it, for the given CFG. Using the dominance frontiers, it then inserts phi functions using the following algorithm (from the book "Engineering a Compiler", by Keith D. Cooper and Linda Torczon, chapter "Data-flow Analysis"). The set NonLocals is the set of all upwardly exposed uses in each node of the CFG and is computed using the CFG method "compute_uses_sets". The map Blocks maps a variable name i to the set of CFG nodes (basic blocks) where it is defined.
for each name i in NonLocals
WorkList <-- Blocks(i)
for each block b in WorkList
for each block d in Dominance_Frontier(b)
insert a phi function for i in d
WorkList <-- WorkList + d
Definition at line 61 of file SSAStandard.cpp.
| OA::SSA::SSAStandard::~SSAStandard | ( | ) | [virtual] |
Definition at line 118 of file SSAStandard.cpp.
| void OA::SSA::SSAStandard::compute_uses_sets | ( | ) | [private] |
Compute "uses" set for each basic block (one CFG node corresponds to one basic block). The set of uses is computed by traversing the statements in each node and eliminating the uses that get killed. In other words, only upwardly exposed uses are computed. Simultaneously, for each variable, the set of blocks that defines that variable, is also built (def_blocks_set).
Definition at line 133 of file SSAStandard.cpp.
| void OA::SSA::SSAStandard::dump | ( | std::ostream & | ) |
| OA_ptr<DefBlocksIterator> OA::SSA::SSAStandard::getDefBlocksIterator | ( | SymHandle | nm | ) | [inline] |
Definition at line 210 of file SSAStandard.hpp.
References DefBlocksIterator.
| OA_ptr<NonLocalsIterator> OA::SSA::SSAStandard::getNonLocalsIterator | ( | ) | [inline] |
Definition at line 205 of file SSAStandard.hpp.
References NonLocalsIterator.
| OA_ptr<PhiNodesIterator> OA::SSA::SSAStandard::getPhiNodesIterator | ( | OA_ptr< CFG::NodeInterface > | n | ) | [inline] |
Definition at line 200 of file SSAStandard.hpp.
References PhiNodesIterator.
friend class DefBlocksIterator [friend] |
Definition at line 58 of file SSAStandard.hpp.
Referenced by getDefBlocksIterator().
friend class NonLocalsIterator [friend] |
Definition at line 57 of file SSAStandard.hpp.
Referenced by getNonLocalsIterator().
friend class PhiNodesIterator [friend] |
Definition at line 55 of file SSAStandard.hpp.
Referenced by getPhiNodesIterator().
OA_ptr<CFG::CFGInterface> OA::SSA::SSAStandard::cfg [private] |
Definition at line 221 of file SSAStandard.hpp.
std::map<SymHandle, std::set<OA_ptr<CFG::NodeInterface> > > OA::SSA::SSAStandard::def_blocks_set [private] |
Definition at line 229 of file SSAStandard.hpp.
Referenced by OA::SSA::SSAStandard::DefBlocksIterator::DefBlocksIterator().
OA_ptr<SSAIRInterface> OA::SSA::SSAStandard::mIR [private] |
Definition at line 227 of file SSAStandard.hpp.
SymHandle OA::SSA::SSAStandard::name [private] |
Definition at line 220 of file SSAStandard.hpp.
std::set<LeafHandle> OA::SSA::SSAStandard::non_locals [private] |
Definition at line 228 of file SSAStandard.hpp.
Referenced by OA::SSA::SSAStandard::NonLocalsIterator::isValid(), OA::SSA::SSAStandard::NonLocalsIterator::NonLocalsIterator(), and OA::SSA::SSAStandard::NonLocalsIterator::reset().
std::map<OA_ptr<CFG::NodeInterface>, std::set<OA_ptr<SSA::Phi> > > OA::SSA::SSAStandard::phi_node_sets [private] |
Definition at line 223 of file SSAStandard.hpp.
Referenced by OA::SSA::SSAStandard::PhiNodesIterator::PhiNodesIterator().
1.7.1