LLVM  6.0.0svn
Public Member Functions | List of all members
llvm::MemorySSAUpdater Class Reference

#include "llvm/Analysis/MemorySSAUpdater.h"

Public Member Functions

 MemorySSAUpdater (MemorySSA *MSSA)
 
void insertDef (MemoryDef *Def, bool RenameUses=false)
 Insert a definition into the MemorySSA IR. More...
 
void insertUse (MemoryUse *Use)
 
void moveBefore (MemoryUseOrDef *What, MemoryUseOrDef *Where)
 
void moveAfter (MemoryUseOrDef *What, MemoryUseOrDef *Where)
 
void moveToPlace (MemoryUseOrDef *What, BasicBlock *BB, MemorySSA::InsertionPlace Where)
 
MemoryAccesscreateMemoryAccessInBB (Instruction *I, MemoryAccess *Definition, const BasicBlock *BB, MemorySSA::InsertionPlace Point)
 Create a MemoryAccess in MemorySSA at a specified point in a block, with a specified clobbering definition. More...
 
MemoryUseOrDefcreateMemoryAccessBefore (Instruction *I, MemoryAccess *Definition, MemoryUseOrDef *InsertPt)
 Create a MemoryAccess in MemorySSA before or after an existing MemoryAccess. More...
 
MemoryUseOrDefcreateMemoryAccessAfter (Instruction *I, MemoryAccess *Definition, MemoryAccess *InsertPt)
 
void removeMemoryAccess (MemoryAccess *)
 Remove a MemoryAccess from MemorySSA, including updating all definitions and uses. More...
 

Detailed Description

Definition at line 58 of file MemorySSAUpdater.h.

Constructor & Destructor Documentation

◆ MemorySSAUpdater()

llvm::MemorySSAUpdater::MemorySSAUpdater ( MemorySSA MSSA)
inline

Member Function Documentation

◆ createMemoryAccessAfter()

MemoryUseOrDef * MemorySSAUpdater::createMemoryAccessAfter ( Instruction I,
MemoryAccess Definition,
MemoryAccess InsertPt 
)

◆ createMemoryAccessBefore()

MemoryUseOrDef * MemorySSAUpdater::createMemoryAccessBefore ( Instruction I,
MemoryAccess Definition,
MemoryUseOrDef InsertPt 
)

Create a MemoryAccess in MemorySSA before or after an existing MemoryAccess.

Returns the new MemoryAccess. This should be called when a memory instruction is created that is being used to replace an existing memory instruction. It will not create PHI nodes, or verify the clobbering definition.

Note: If a MemoryAccess already exists for I, this function will make it inaccessible and it must have removeMemoryAccess called on it.

Definition at line 467 of file MemorySSAUpdater.cpp.

References assert(), llvm::MemorySSA::createDefinedAccess(), llvm::MemoryAccess::getBlock(), llvm::MemoryAccess::getIterator(), llvm::Instruction::getParent(), and llvm::MemorySSA::insertIntoListsBefore().

Referenced by MemorySSAUpdater().

◆ createMemoryAccessInBB()

MemoryAccess * MemorySSAUpdater::createMemoryAccessInBB ( Instruction I,
MemoryAccess Definition,
const BasicBlock BB,
MemorySSA::InsertionPlace  Point 
)

Create a MemoryAccess in MemorySSA at a specified point in a block, with a specified clobbering definition.

Returns the new MemoryAccess. This should be called when a memory instruction is created that is being used to replace an existing memory instruction. It will not create PHI nodes, or verify the clobbering definition. The insertion place is used solely to determine where in the memoryssa access lists the instruction will be placed. The caller is expected to keep ordering the same as instructions. It will return the new MemoryAccess. Note: If a MemoryAccess already exists for I, this function will make it inaccessible and it must have removeMemoryAccess called on it.

Definition at line 459 of file MemorySSAUpdater.cpp.

References llvm::MemorySSA::createDefinedAccess(), and llvm::MemorySSA::insertIntoListsForBlock().

Referenced by MemorySSAUpdater().

◆ insertDef()

void MemorySSAUpdater::insertDef ( MemoryDef Def,
bool  RenameUses = false 
)

Insert a definition into the MemorySSA IR.

RenameUses will rename any use below the new def block (and any inserted phis). RenameUses should be set to true if the definition may cause new aliases for loads below it. This is not the case for hoisting or sinking or other forms of code movement. It is the case for straight code insertion. For example: store a if (foo) { } load a

Moving the store into the if block, and calling insertDef, does not require RenameUses. However, changing it to: store a if (foo) { store b } load a Where a mayalias b, does require RenameUses be set to true.

Definition at line 229 of file MemorySSAUpdater.cpp.

References assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::simple_ilist< T, Options >::begin(), llvm::MemorySSA::dominates(), llvm::SmallVectorBase::empty(), llvm::MemoryAccess::getBlock(), llvm::MemoryUseOrDef::getDefiningAccess(), llvm::MemorySSA::getMemoryAccess(), llvm::Use::getUser(), llvm::MemorySSA::getWritableBlockDefs(), llvm::SmallPtrSetImpl< PtrType >::insert(), insertUse(), llvm::MemorySSA::moveTo(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::pop_back(), llvm::SmallVectorTemplateBase< T, isPodLike >::push_back(), llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back(), llvm::MemorySSA::renamePass(), llvm::Value::replaceAllUsesWith(), llvm::Use::set(), llvm::MemoryUseOrDef::setDefiningAccess(), setMemoryPhiValueForBlock(), llvm::successors(), llvm::Value::use_begin(), and llvm::Value::use_end().

Referenced by MemorySSAUpdater().

◆ insertUse()

void MemorySSAUpdater::insertUse ( MemoryUse Use)

Definition at line 192 of file MemorySSAUpdater.cpp.

References llvm::MemoryUseOrDef::setDefiningAccess().

Referenced by insertDef(), and MemorySSAUpdater().

◆ moveAfter()

void MemorySSAUpdater::moveAfter ( MemoryUseOrDef What,
MemoryUseOrDef Where 
)

◆ moveBefore()

void MemorySSAUpdater::moveBefore ( MemoryUseOrDef What,
MemoryUseOrDef Where 
)

◆ moveToPlace()

void MemorySSAUpdater::moveToPlace ( MemoryUseOrDef What,
BasicBlock BB,
MemorySSA::InsertionPlace  Where 
)

Definition at line 392 of file MemorySSAUpdater.cpp.

Referenced by MemorySSAUpdater().

◆ removeMemoryAccess()

void MemorySSAUpdater::removeMemoryAccess ( MemoryAccess MA)

Remove a MemoryAccess from MemorySSA, including updating all definitions and uses.

This should be called when a memory instruction that has a MemoryAccess associated with it is erased from the program. For example, if a store or load is simply erased (not replaced), removeMemoryAccess should be called on the MemoryAccess for that store/load.

Definition at line 411 of file MemorySSAUpdater.cpp.

References assert(), llvm::Use::getUser(), llvm::Value::hasValueHandle(), llvm::MemorySSA::isLiveOnEntryDef(), onlySingleValue(), llvm::MemorySSA::removeFromLists(), llvm::MemorySSA::removeFromLookups(), llvm::Use::set(), llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::ValueHandleBase::ValueIsRAUWd().

Referenced by MemorySSAUpdater().


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