LLVM  4.0.0
Public Member Functions | List of all members
llvm::GVN::ValueTable Class Reference

This class holds the mapping between values and value numbers. More...

#include <GVN.h>

Public Member Functions

 ValueTable ()
 
 ValueTable (const ValueTable &Arg)
 
 ValueTable (ValueTable &&Arg)
 
 ~ValueTable ()
 
uint32_t lookupOrAdd (Value *V)
 lookup_or_add - Returns the value number for the specified value, assigning it a new number if it did not have one before. More...
 
uint32_t lookup (Value *V) const
 Returns the value number of the specified value. More...
 
uint32_t lookupOrAddCmp (unsigned Opcode, CmpInst::Predicate Pred, Value *LHS, Value *RHS)
 Returns the value number of the given comparison, assigning it a new number if it did not have one before. More...
 
bool exists (Value *V) const
 Returns true if a value number exists for the specified value. More...
 
void add (Value *V, uint32_t num)
 add - Insert a value into the table with a specified value number. More...
 
void clear ()
 Remove all entries from the ValueTable. More...
 
void erase (Value *v)
 Remove a value from the value numbering. More...
 
void setAliasAnalysis (AliasAnalysis *A)
 
AliasAnalysisgetAliasAnalysis () const
 
void setMemDep (MemoryDependenceResults *M)
 
void setDomTree (DominatorTree *D)
 
uint32_t getNextUnusedValueNumber ()
 
void verifyRemoved (const Value *) const
 verifyRemoved - Verify that the value is removed from all internal data structures. More...
 

Detailed Description

This class holds the mapping between values and value numbers.

It is used as an efficient mechanism to determine the expression-wise equivalence of two values.

Definition at line 68 of file GVN.h.

Constructor & Destructor Documentation

GVN::ValueTable::ValueTable ( )

Definition at line 341 of file GVN.cpp.

GVN::ValueTable::ValueTable ( const ValueTable Arg)
default
GVN::ValueTable::ValueTable ( ValueTable &&  Arg)
default
GVN::ValueTable::~ValueTable ( )
default

Member Function Documentation

void GVN::ValueTable::add ( Value V,
uint32_t  num 
)

add - Insert a value into the table with a specified value number.

Definition at line 347 of file GVN.cpp.

void GVN::ValueTable::clear ( )

Remove all entries from the ValueTable.

Definition at line 556 of file GVN.cpp.

void GVN::ValueTable::erase ( Value v)

Remove a value from the value numbering.

Definition at line 563 of file GVN.cpp.

Referenced by llvm::GVN::markInstructionForDeletion().

bool GVN::ValueTable::exists ( Value V) const

Returns true if a value number exists for the specified value.

Definition at line 461 of file GVN.cpp.

AliasAnalysis* llvm::GVN::ValueTable::getAliasAnalysis ( ) const
inline

Definition at line 98 of file GVN.h.

Referenced by llvm::GVN::getAliasAnalysis().

uint32_t llvm::GVN::ValueTable::getNextUnusedValueNumber ( )
inline

Definition at line 101 of file GVN.h.

uint32_t GVN::ValueTable::lookup ( Value V) const

Returns the value number of the specified value.

Fails if the value has not yet been numbered.

Definition at line 536 of file GVN.cpp.

References assert(), and VI.

uint32_t GVN::ValueTable::lookupOrAdd ( Value V)

lookup_or_add - Returns the value number for the specified value, assigning it a new number if it did not have one before.

Definition at line 465 of file GVN.cpp.

References llvm::MCID::Add, llvm::APIntOps::And(), llvm::Call, llvm::Instruction::getOpcode(), if(), llvm::APIntOps::Or(), llvm::MCID::Select, VI, and llvm::APIntOps::Xor().

uint32_t GVN::ValueTable::lookupOrAddCmp ( unsigned  Opcode,
CmpInst::Predicate  Predicate,
Value LHS,
Value RHS 
)

Returns the value number of the given comparison, assigning it a new number if it did not have one before.

Useful when we deduced the result of a comparison, but don't immediately have an instruction realizing that comparison to hand.

Definition at line 546 of file GVN.cpp.

void llvm::GVN::ValueTable::setAliasAnalysis ( AliasAnalysis A)
inline

Definition at line 97 of file GVN.h.

References A.

void llvm::GVN::ValueTable::setDomTree ( DominatorTree D)
inline

Definition at line 100 of file GVN.h.

References D.

void llvm::GVN::ValueTable::setMemDep ( MemoryDependenceResults M)
inline

Definition at line 99 of file GVN.h.

void GVN::ValueTable::verifyRemoved ( const Value V) const

verifyRemoved - Verify that the value is removed from all internal data structures.

Definition at line 569 of file GVN.cpp.

References assert(), E, and I.


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