LLVM: llvm::MemorySSA Class Reference (original) (raw)

Encapsulates MemorySSA, including all data associated with memory accesses. More...

#include "[llvm/Analysis/MemorySSA.h](MemorySSA%5F8h%5Fsource.html)"

Classes
class CachingWalker
A MemorySSAWalker that does AA walks to disambiguate accesses. More...
class ClobberWalkerBase
class OptimizeUses
This class is a batch walker of all MemoryUse's in the program, and points their defining access at the thing that actually clobbers them. More...
class SkipSelfWalker
Public Types
enum class VerificationLevel { Fast, Full }
enum InsertionPlace { Beginning, End, BeforeTerminator }
Used in various insertion functions to specify whether we are talking about the beginning or end of a block. More...
using AccessList = iplist<MemoryAccess, ilist_tag<MSSAHelpers::AllAccessTag>>
using DefsList
Public Member Functions
LLVM_ABI MemorySSA (Function &, AliasAnalysis *, DominatorTree *)
LLVM_ABI MemorySSA (Loop &, AliasAnalysis *, DominatorTree *)
MemorySSA (MemorySSA &&)=delete
LLVM_ABI ~MemorySSA ()
LLVM_ABI MemorySSAWalker * getWalker ()
LLVM_ABI MemorySSAWalker * getSkipSelfWalker ()
MemoryUseOrDef * getMemoryAccess (const Instruction *I) const
Given a memory Mod/Ref'ing instruction, get the MemorySSA access associated with it.
MemoryPhi * getMemoryAccess (const BasicBlock *BB) const
DominatorTree & getDomTree () const
LLVM_ABI void dump () const
LLVM_ABI void print (raw_ostream &) const
bool isLiveOnEntryDef (const MemoryAccess *MA) const
Return true if MA represents the live on entry value.
MemoryAccess * getLiveOnEntryDef () const
const AccessList * getBlockAccesses (const BasicBlock *BB) const
Return the list of MemoryAccess's for a given basic block.
const DefsList * getBlockDefs (const BasicBlock *BB) const
Return the list of MemoryDef's and MemoryPhi's for a given basic block.
LLVM_ABI bool locallyDominates (const MemoryAccess *A, const MemoryAccess *B) const
Given two memory accesses in the same basic block, determine whether MemoryAccess A dominates MemoryAccess B.
LLVM_ABI bool dominates (const MemoryAccess *A, const MemoryAccess *B) const
Given two memory accesses in potentially different blocks, determine whether MemoryAccess A dominates MemoryAccess B.
LLVM_ABI bool dominates (const MemoryAccess *A, const Use &B) const
Given a MemoryAccess and a Use, determine whether MemoryAccess A dominates Use B.
LLVM_ABI void verifyMemorySSA (VerificationLevel=VerificationLevel::Fast) const
Verify that MemorySSA is self consistent (IE definitions dominate all uses, uses appear in the right places).
LLVM_ABI void ensureOptimizedUses ()
By default, uses are not optimized during MemorySSA construction.
AliasAnalysis & getAA ()
Protected Member Functions
template
void verifyOrderingDominationAndDefUses (IterT Blocks, VerificationLevel=VerificationLevel::Fast) const
Verify ordering: the order and existence of MemoryAccesses matches the order and existence of memory affecting instructions.
template
void verifyDominationNumbers (IterT Blocks) const
Verify that all of the blocks we believe to have valid domination numbers actually have valid domination numbers.
template
void verifyPrevDefInPhis (IterT Blocks) const
AccessList * getWritableBlockAccesses (const BasicBlock *BB) const
DefsList * getWritableBlockDefs (const BasicBlock *BB) const
LLVM_ABI void moveTo (MemoryUseOrDef *What, BasicBlock *BB, AccessList::iterator Where)
LLVM_ABI void moveTo (MemoryAccess *What, BasicBlock *BB, InsertionPlace Point)
void renamePass (BasicBlock *BB, MemoryAccess *IncomingVal, SmallPtrSetImpl< BasicBlock * > &Visited)
LLVM_ABI void removeFromLookups (MemoryAccess *)
Properly remove MA from all of MemorySSA's lookup tables.
LLVM_ABI void removeFromLists (MemoryAccess *, bool ShouldDelete=true)
Properly remove MA from all of MemorySSA's lists.
LLVM_ABI void insertIntoListsForBlock (MemoryAccess *, const BasicBlock *, InsertionPlace)
LLVM_ABI void insertIntoListsBefore (MemoryAccess *, const BasicBlock *, AccessList::iterator)
LLVM_ABI MemoryUseOrDef * createDefinedAccess (Instruction *, MemoryAccess *, const MemoryUseOrDef *Template=nullptr, bool CreationMustSucceed=true)
Friends
class MemorySSAUpdater

Encapsulates MemorySSA, including all data associated with memory accesses.

Definition at line 702 of file MemorySSA.h.

AccessList

DefsList

Initial value:

A simple intrusive list implementation.

Definition at line 754 of file MemorySSA.h.

InsertionPlace

Used in various insertion functions to specify whether we are talking about the beginning or end of a block.

Enumerator
Beginning
End
BeforeTerminator

Definition at line 793 of file MemorySSA.h.

VerificationLevel

MemorySSA() [2/3]

MemorySSA() [3/3]

llvm::MemorySSA::MemorySSA ( MemorySSA && ) delete

~MemorySSA()

MemorySSA::~MemorySSA ( )

createDefinedAccess()

dominates() [1/2]

dominates() [2/2]

dump()

ensureOptimizedUses()

void MemorySSA::ensureOptimizedUses ( )

getAA()

getBlockAccesses()

getBlockDefs()

getDomTree()

getLiveOnEntryDef()

MemoryAccess * llvm::MemorySSA::getLiveOnEntryDef ( ) const inline

getMemoryAccess() [1/2]

getMemoryAccess() [2/2]

Given a memory Mod/Ref'ing instruction, get the MemorySSA access associated with it.

If passed a basic block gets the memory phi node that exists for that block, if there is one. Otherwise, this will get a MemoryUseOrDef.

Definition at line 720 of file MemorySSA.h.

References llvm::cast_or_null(), and I.

Referenced by buildPartialInvariantUnswitchConditionalBranch(), llvm::canSinkOrHoistInst(), cloneInstructionInExitBlock(), getMatchingValue(), getNewDefiningAccessForClone(), llvm::hasPartialIVCondition(), llvm::Loop::makeLoopInvariant(), llvm::MergeBlockIntoPredecessor(), moveInstructionBefore(), noConflictingReadWrites(), overreadUndefContents(), runMoveAutoInit(), simplifyLoopInst(), sinkInstruction(), turnGuardIntoBranch(), usersDominator(), verifyOrderingDominationAndDefUses(), and verifyPrevDefInPhis().

getSkipSelfWalker()

getWalker()

getWritableBlockAccesses()

AccessList * llvm::MemorySSA::getWritableBlockAccesses ( const BasicBlock * BB) const inlineprotected

getWritableBlockDefs()

DefsList * llvm::MemorySSA::getWritableBlockDefs ( const BasicBlock * BB) const inlineprotected

insertIntoListsBefore()

insertIntoListsForBlock()

isLiveOnEntryDef()

locallyDominates()

moveTo() [1/2]

moveTo() [2/2]

print()

removeFromLists()

Properly remove MA from all of MemorySSA's lists.

Because of the way the intrusive list and use lists work, it is important to do removal in the right order. ShouldDelete defaults to true, and will cause the memory access to also be deleted, not just removed.

Definition at line 1866 of file MemorySSA.cpp.

References Accesses, llvm::MemoryAccess::getBlock(), and llvm::isa().

removeFromLookups()

void MemorySSA::removeFromLookups ( MemoryAccess * MA) protected

renamePass()

verifyDominationNumbers()

template

void MemorySSA::verifyDominationNumbers ( IterT Blocks) const protected

verifyMemorySSA()

void MemorySSA::verifyMemorySSA ( VerificationLevel VL = VerificationLevel::Fast ) const

Verify that MemorySSA is self consistent (IE definitions dominate all uses, uses appear in the right places).

This is used by unit tests.

Definition at line 1905 of file MemorySSA.cpp.

References assert(), Full, llvm::iterator_range(), llvm::map_range(), verifyDominationNumbers(), verifyOrderingDominationAndDefUses(), and verifyPrevDefInPhis().

Referenced by llvm::deleteDeadLoop(), llvm::hoistRegion(), injectPendingInvariantConditions(), mergeBlocksIntoPredecessors(), llvm::promoteLoopAccessesToScalars(), llvm::FunctionToLoopPassAdaptor::run(), llvm::LoopFlattenPass::run(), llvm::LoopInstSimplifyPass::run(), llvm::LoopRotatePass::run(), llvm::SimpleLoopUnswitchPass::run(), llvm::MemCpyOptPass::runImpl(), runMoveAutoInit(), simplifyLoopInst(), simplifyOneLoop(), llvm::sinkRegion(), llvm::splitBlockBefore(), turnGuardIntoBranch(), turnSelectIntoBranch(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), and unswitchTrivialSwitch().

verifyOrderingDominationAndDefUses()

template

void MemorySSA::verifyOrderingDominationAndDefUses ( IterT Blocks, VerificationLevel VL = VerificationLevel::Fast ) const protected

Verify ordering: the order and existence of MemoryAccesses matches the order and existence of memory affecting instructions.

Verify domination: each definition dominates all of its uses. Verify def-uses: the immediate use information - walk all the memory accesses and verifying that, for each use, it appears in the appropriate def's use list

Definition at line 2021 of file MemorySSA.cpp.

References assert(), B(), llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::clear(), DL, dominates(), llvm::dyn_cast(), llvm::SmallVectorTemplateCommon< T, typename >::end(), Full, getBlockAccesses(), getBlockDefs(), llvm::MemoryUseOrDef::getDefiningAccess(), getMemoryAccess(), I, llvm::is_contained(), llvm::isa(), llvm::pred_size(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T, bool >::push_back(), llvm::SmallVectorTemplateCommon< T, typename >::size(), and llvm::Value::uses().

Referenced by MemorySSAUpdater, and verifyMemorySSA().

verifyPrevDefInPhis()

template

void MemorySSA::verifyPrevDefInPhis ( IterT Blocks) const protected

MemorySSAUpdater


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