LLVM API Documentation

llvm::DSScalarMap Class Reference

#include <DSGraph.h>

Collaboration diagram for llvm::DSScalarMap:

Collaboration graph
[legend]
List of all members.

Public Types

typedef ValueMapTy::const_iterator const_iterator
typedef ValueMapTy::iterator iterator
typedef GlobalSetTy::const_iterator global_iterator

Public Member Functions

 DSScalarMap (EquivalenceClasses< GlobalValue * > &ECs)
EquivalenceClasses< GlobalValue * > & getGlobalECs () const
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
GlobalValuegetLeaderForGlobal (GlobalValue *GV) const
iterator find (Value *V)
const_iterator find (Value *V) const
DSNodeHandlegetRawEntryRef (Value *V)
unsigned count (Value *V) const
void erase (Value *V)
void eraseIfExists (Value *V)
void replaceScalar (Value *Old, Value *New)
void copyScalarIfExists (Value *Old, Value *New)
DSNodeHandleoperator[] (Value *V)
void erase (iterator I)
void clear ()
void spliceFrom (DSScalarMap &RHS)
global_iterator global_begin () const
global_iterator global_end () const
unsigned global_size () const
unsigned global_count (GlobalValue *GV) const

Detailed Description

DSScalarMap - An instance of this class is used to keep track of all of which DSNode each scalar in a function points to. This is specialized to keep track of globals with nodes in the function, and to keep track of the unique DSNodeHandle being used by the scalar map.

This class is crucial to the efficiency of DSA with some large SCC's. In these cases, the cost of iterating over the scalar map dominates the cost of DSA. In all of these cases, the DSA phase is really trying to identify globals or unique node handles active in the function.

Definition at line 38 of file DSGraph.h.


Member Typedef Documentation

typedef ValueMapTy::const_iterator llvm::DSScalarMap::const_iterator

Definition at line 53 of file DSGraph.h.

typedef ValueMapTy::iterator llvm::DSScalarMap::iterator

Definition at line 54 of file DSGraph.h.

typedef GlobalSetTy::const_iterator llvm::DSScalarMap::global_iterator

Definition at line 163 of file DSGraph.h.


Constructor & Destructor Documentation

llvm::DSScalarMap::DSScalarMap ( EquivalenceClasses< GlobalValue * > &  ECs  )  [inline]

Definition at line 47 of file DSGraph.h.


Member Function Documentation

EquivalenceClasses<GlobalValue*>& llvm::DSScalarMap::getGlobalECs (  )  const [inline]

Definition at line 49 of file DSGraph.h.

Referenced by BuildGlobalECs(), EliminateUsesOfECGlobals(), and llvm::DSGraph::getGlobalECs().

iterator llvm::DSScalarMap::begin (  )  [inline]

Definition at line 55 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::DSGraph::AssertGraphOK(), llvm::DSGraph::cloneInto(), llvm::DSGraph::removeDeadNodes(), and llvm::DSGraph::removeTriviallyDeadNodes().

iterator llvm::DSScalarMap::end (  )  [inline]

Definition at line 56 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::DSGraph::AssertGraphOK(), llvm::DSGraph::cloneInto(), copyScalarIfExists(), eraseIfExists(), llvm::DSGraph::getNodeForValue(), llvm::DSGraph::removeDeadNodes(), llvm::DSGraph::removeTriviallyDeadNodes(), replaceScalar(), and llvm::DSGraph::updateFromGlobalGraph().

const_iterator llvm::DSScalarMap::begin (  )  const [inline]

Definition at line 57 of file DSGraph.h.

const_iterator llvm::DSScalarMap::end (  )  const [inline]

Definition at line 58 of file DSGraph.h.

GlobalValue* llvm::DSScalarMap::getLeaderForGlobal ( GlobalValue GV  )  const [inline]

Definition at line 60 of file DSGraph.h.

References GV.

Referenced by find().

iterator llvm::DSScalarMap::find ( Value V  )  [inline]

Definition at line 67 of file DSGraph.h.

References getLeaderForGlobal(), GV, and V.

Referenced by llvm::DSNode::assertOK(), BuildGlobalECs(), copyScalarIfExists(), eraseIfExists(), llvm::DSGraph::getNodeForValue(), llvm::DSGraph::removeDeadNodes(), replaceScalar(), llvm::TDDataStructures::runOnModule(), and llvm::DSGraph::updateFromGlobalGraph().

const_iterator llvm::DSScalarMap::find ( Value V  )  const [inline]

Definition at line 80 of file DSGraph.h.

References getLeaderForGlobal(), GV, and V.

DSNodeHandle& llvm::DSScalarMap::getRawEntryRef ( Value V  )  [inline]

getRawEntryRef - This method can be used by clients that are aware of the global value equivalence class in effect.

Definition at line 96 of file DSGraph.h.

References GV, and V.

Referenced by llvm::DSGraph::cloneInto().

unsigned llvm::DSScalarMap::count ( Value V  )  const [inline]

Definition at line 105 of file DSGraph.h.

References V.

void llvm::DSScalarMap::erase ( Value V  )  [inline]

Definition at line 107 of file DSGraph.h.

References V.

Referenced by BuildGlobalECs(), EliminateUsesOfECGlobals(), eraseIfExists(), llvm::DSGraph::removeDeadNodes(), llvm::DSGraph::removeTriviallyDeadNodes(), and replaceScalar().

void llvm::DSScalarMap::eraseIfExists ( Value V  )  [inline]

Definition at line 109 of file DSGraph.h.

References end(), erase(), find(), and V.

void llvm::DSScalarMap::replaceScalar ( Value Old,
Value New 
) [inline]

replaceScalar - When an instruction needs to be modified, this method can be used to update the scalar map to remove the old and insert the new.

Definition at line 117 of file DSGraph.h.

References end(), erase(), and find().

void llvm::DSScalarMap::copyScalarIfExists ( Value Old,
Value New 
) [inline]

copyScalarIfExists - If Old exists in the scalar map, make New point to whatever Old did.

Definition at line 126 of file DSGraph.h.

References end(), and find().

DSNodeHandle& llvm::DSScalarMap::operator[] ( Value V  )  [inline]

operator[] - Return the DSNodeHandle for the specified value, creating a new null handle if there is no entry yet.

Definition at line 134 of file DSGraph.h.

References GV, and V.

void llvm::DSScalarMap::erase ( iterator  I  )  [inline]

Definition at line 145 of file DSGraph.h.

References GV.

void llvm::DSScalarMap::clear (  )  [inline]

Definition at line 152 of file DSGraph.h.

Referenced by llvm::DSGraph::~DSGraph().

void DSScalarMap::spliceFrom ( DSScalarMap RHS  ) 

spliceFrom - Copy all entries from RHS, then clear RHS.

Definition at line 1400 of file DataStructure.cpp.

References E, GlobalSet, and ValueMap.

Referenced by llvm::DSGraph::spliceFrom().

global_iterator llvm::DSScalarMap::global_begin (  )  const [inline]

Definition at line 164 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::DSGraph::computeCalleeCallerMapping(), llvm::DSGraph::computeGToGGMapping(), llvm::DSGraph::DSGraph(), EliminateUsesOfECGlobals(), getCaption(), llvm::DSGraph::markIncompleteNodes(), llvm::DSGraph::mergeInGraph(), and llvm::TDDataStructures::runOnModule().

global_iterator llvm::DSScalarMap::global_end (  )  const [inline]

Definition at line 165 of file DSGraph.h.

Referenced by llvm::DOTGraphTraits< const DSGraph * >::addCustomGraphFeatures(), llvm::DSGraph::computeCalleeCallerMapping(), llvm::DSGraph::computeGToGGMapping(), llvm::DSGraph::DSGraph(), EliminateUsesOfECGlobals(), getCaption(), llvm::DSGraph::markIncompleteNodes(), llvm::DSGraph::mergeInGraph(), and llvm::TDDataStructures::runOnModule().

unsigned llvm::DSScalarMap::global_size (  )  const [inline]

Definition at line 166 of file DSGraph.h.

Referenced by llvm::DSGraph::computeCalleeCallerMapping().

unsigned llvm::DSScalarMap::global_count ( GlobalValue GV  )  const [inline]

Definition at line 167 of file DSGraph.h.

References GV.

Referenced by llvm::DSNode::assertOK(), llvm::DSGraph::computeCalleeCallerMapping(), and EliminateUsesOfECGlobals().


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