|
LLVM
10.0.0
|
#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, bool RenameUses=false) |
| void | removeEdge (BasicBlock *From, BasicBlock *To) |
Update the MemoryPhi in To following an edge deletion between From and To. More... | |
| void | removeDuplicatePhiEdgesBetween (const BasicBlock *From, const BasicBlock *To) |
Update the MemoryPhi in To to have a single incoming edge from From, following a CFG change that replaced multiple edges (switch) with a direct branch. More... | |
| void | updatePhisWhenInsertingUniqueBackedgeBlock (BasicBlock *LoopHeader, BasicBlock *LoopPreheader, BasicBlock *BackedgeBlock) |
| Update MemorySSA when inserting a unique backedge block for a loop. More... | |
| void | updateForClonedLoop (const LoopBlocksRPO &LoopBlocks, ArrayRef< BasicBlock *> ExitBlocks, const ValueToValueMapTy &VM, bool IgnoreIncomingWithNoClones=false) |
| Update MemorySSA after a loop was cloned, given the blocks in RPO order, the exit blocks and a 1:1 mapping of all blocks and instructions cloned. More... | |
| void | updateForClonedBlockIntoPred (BasicBlock *BB, BasicBlock *P1, const ValueToValueMapTy &VM) |
| void | updateExitBlocksForClonedLoop (ArrayRef< BasicBlock *> ExitBlocks, const ValueToValueMapTy &VMap, DominatorTree &DT) |
| Update phi nodes in exit block successors following cloning. More... | |
| void | updateExitBlocksForClonedLoop (ArrayRef< BasicBlock *> ExitBlocks, ArrayRef< std::unique_ptr< ValueToValueMapTy >> VMaps, DominatorTree &DT) |
| void | applyUpdates (ArrayRef< CFGUpdate > Updates, DominatorTree &DT) |
| Apply CFG updates, analogous with the DT edge updates. More... | |
| void | applyInsertUpdates (ArrayRef< CFGUpdate > Updates, DominatorTree &DT) |
| Apply CFG insert updates, analogous with the DT edge updates. More... | |
| void | moveBefore (MemoryUseOrDef *What, MemoryUseOrDef *Where) |
| void | moveAfter (MemoryUseOrDef *What, MemoryUseOrDef *Where) |
| void | moveToPlace (MemoryUseOrDef *What, BasicBlock *BB, MemorySSA::InsertionPlace Where) |
| void | moveAllAfterSpliceBlocks (BasicBlock *From, BasicBlock *To, Instruction *Start) |
From block was spliced into From and To. More... | |
| void | moveAllAfterMergeBlocks (BasicBlock *From, BasicBlock *To, Instruction *Start) |
From block was merged into To. More... | |
| void | wireOldPredecessorsToNewImmediatePredecessor (BasicBlock *Old, BasicBlock *New, ArrayRef< BasicBlock *> Preds, bool IdenticalEdgesWereMerged=true) |
| A new empty BasicBlock (New) now branches directly to Old. More... | |
| MemoryAccess * | 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. More... | |
| MemoryUseOrDef * | createMemoryAccessBefore (Instruction *I, MemoryAccess *Definition, MemoryUseOrDef *InsertPt) |
| Create a MemoryAccess in MemorySSA before or after an existing MemoryAccess. More... | |
| MemoryUseOrDef * | createMemoryAccessAfter (Instruction *I, MemoryAccess *Definition, MemoryAccess *InsertPt) |
| void | removeMemoryAccess (MemoryAccess *, bool OptimizePhis=false) |
| Remove a MemoryAccess from MemorySSA, including updating all definitions and uses. More... | |
| void | removeMemoryAccess (const Instruction *I, bool OptimizePhis=false) |
| Remove MemoryAccess for a given instruction, if a MemoryAccess exists. More... | |
| void | removeBlocks (const SmallSetVector< BasicBlock *, 8 > &DeadBlocks) |
| Remove all MemoryAcceses in a set of BasicBlocks about to be deleted. More... | |
| void | changeToUnreachable (const Instruction *I) |
| Instruction I will be changed to an unreachable. More... | |
| void | changeCondBranchToUnconditionalTo (const BranchInst *BI, const BasicBlock *To) |
Conditional branch BI is changed or replaced with an unconditional branch to To. More... | |
| MemorySSA * | getMemorySSA () const |
| Get handle on MemorySSA. More... | |
Definition at line 70 of file MemorySSAUpdater.h.
|
inline |
Definition at line 82 of file MemorySSAUpdater.h.
References applyInsertUpdates(), applyUpdates(), llvm::tgtok::Def, From, insertDef(), insertUse(), moveAfter(), moveAllAfterSpliceBlocks(), moveBefore(), moveToPlace(), removeDuplicatePhiEdgesBetween(), removeEdge(), updateExitBlocksForClonedLoop(), updateForClonedBlockIntoPred(), updateForClonedLoop(), and updatePhisWhenInsertingUniqueBackedgeBlock().
| void MemorySSAUpdater::applyInsertUpdates | ( | ArrayRef< CFGUpdate > | Updates, |
| DominatorTree & | DT | ||
| ) |
Apply CFG insert updates, analogous with the DT edge updates.
Definition at line 813 of file MemorySSAUpdater.cpp.
References llvm::MemoryPhi::addIncoming(), assert(), llvm::SmallVectorTemplateCommon< T >::begin(), llvm::BasicBlock::begin(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::calculate(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::count(), llvm::dbgs(), llvm::DominatorTree::dominates(), E, llvm::SmallVectorBase::empty(), llvm::simple_ilist< T, Options >::end(), llvm::SmallVectorTemplateCommon< T >::end(), llvm::DominatorTreeBase< NodeT, IsPostDom >::findNearestCommonDominator(), llvm::DomTreeNodeBase< NodeT >::getBlock(), llvm::MemoryAccess::getBlock(), llvm::MemoryUseOrDef::getDefiningAccess(), llvm::DomTreeNodeBase< NodeT >::getIDom(), llvm::MemorySSA::getLiveOnEntryDef(), llvm::DominatorTreeBase< NodeT, IsPostDom >::getNode(), llvm::User::getNumOperands(), llvm::Use::getUser(), llvm::MemorySSA::getWritableBlockDefs(), I, llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), llvm::DenseMapBase< SmallDenseMap< KeyT, ValueT, InlineBuckets, KeyInfoT, BucketT >, KeyT, ValueT, KeyInfoT, BucketT >::insert(), llvm::SmallPtrSetImpl< PtrType >::insert(), insertDef(), insertUse(), LLVM_DEBUG, llvm_unreachable, llvm::pred_size(), llvm::SmallVectorTemplateBase< T >::push_back(), removeMemoryAccess(), llvm::Value::replaceAllUsesWith(), llvm::Use::set(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setDefiningBlocks(), llvm::Value::use_begin(), and llvm::Value::users().
Referenced by applyUpdates(), getMemorySSA(), MemorySSAUpdater(), unswitchTrivialBranch(), and updateForClonedBlockIntoPred().
| void MemorySSAUpdater::applyUpdates | ( | ArrayRef< CFGUpdate > | Updates, |
| DominatorTree & | DT | ||
| ) |
Apply CFG updates, analogous with the DT edge updates.
Definition at line 782 of file MemorySSAUpdater.cpp.
References applyInsertUpdates(), llvm::SmallVectorBase::empty(), llvm::DominatorTreeBase< NodeT, IsPostDom >::Insert, llvm::SmallVectorTemplateBase< T >::push_back(), and removeEdge().
Referenced by getInnermostLoopFor(), MemorySSAUpdater(), and unswitchTrivialSwitch().
| void MemorySSAUpdater::changeCondBranchToUnconditionalTo | ( | const BranchInst * | BI, |
| const BasicBlock * | To | ||
| ) |
Conditional branch BI is changed or replaced with an unconditional branch to To.
Update Phis in BI's successors to remove BI's BB.
Definition at line 1404 of file MemorySSAUpdater.cpp.
References llvm::Instruction::getParent(), llvm::SmallVectorTemplateBase< T >::push_back(), removeDuplicatePhiEdgesBetween(), and llvm::successors().
Referenced by removeMemoryAccess().
| void MemorySSAUpdater::changeToUnreachable | ( | const Instruction * | I | ) |
Instruction I will be changed to an unreachable.
Remove all accesses in I's block that follow I (inclusive), and update the Phis in the blocks' successors.
Definition at line 1383 of file MemorySSAUpdater.cpp.
References llvm::BasicBlock::end(), llvm::ilist_node_impl< OptionsT >::getIterator(), llvm::Instruction::getParent(), llvm::SmallVectorTemplateBase< T >::push_back(), removeDuplicatePhiEdgesBetween(), removeMemoryAccess(), llvm::Successor, and llvm::successors().
Referenced by llvm::changeToUnreachable(), and removeMemoryAccess().
| MemoryUseOrDef * MemorySSAUpdater::createMemoryAccessAfter | ( | Instruction * | I, |
| MemoryAccess * | Definition, | ||
| MemoryAccess * | InsertPt | ||
| ) |
Definition at line 1438 of file MemorySSAUpdater.cpp.
References assert(), llvm::MemoryAccess::getBlock(), llvm::MemoryAccess::getIterator(), and llvm::Instruction::getParent().
Referenced by isSafeToExecuteUnconditionally().
| 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 1428 of file MemorySSAUpdater.cpp.
References assert(), llvm::MemoryAccess::getBlock(), llvm::MemoryAccess::getIterator(), and llvm::Instruction::getParent().
| 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 1420 of file MemorySSAUpdater.cpp.
Referenced by CloneInstructionInExitBlock(), isSafeToExecuteUnconditionally(), and llvm::promoteLoopAccessesToScalars().
|
inline |
Get handle on MemorySSA.
Definition at line 260 of file MemorySSAUpdater.h.
References applyInsertUpdates(), and Operands.
Referenced by llvm::canSinkOrHoistInst(), CloneInstructionInExitBlock(), getInnermostLoopFor(), llvm::hoistRegion(), isLoadInvariantInLoop(), llvm::LoopRotation(), llvm::Loop::makeLoopInvariant(), mergeBlocksIntoPredecessors(), moveInstructionBefore(), llvm::promoteLoopAccessesToScalars(), simplifyLoopInst(), simplifyOneLoop(), llvm::sinkRegion(), turnGuardIntoBranch(), unswitchAllTrivialConditions(), unswitchNontrivialInvariants(), unswitchTrivialBranch(), and unswitchTrivialSwitch().
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 312 of file MemorySSAUpdater.cpp.
References assert(), llvm::SmallVectorTemplateCommon< T >::back(), llvm::simple_ilist< T, Options >::begin(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::calculate(), llvm::MemorySSA::dominates(), llvm::SmallVectorBase::empty(), llvm::sys::path::end(), llvm::find(), llvm::MemoryAccess::getBlock(), llvm::MemorySSA::getBlockDefs(), llvm::MemoryUseOrDef::getDefiningAccess(), llvm::MemoryAccess::getDefsIterator(), llvm::MemorySSA::getMemoryAccess(), llvm::Use::getUser(), llvm::MemorySSA::getWritableBlockDefs(), llvm::SmallPtrSetImpl< PtrType >::insert(), llvm::SmallVectorTemplateBase< T >::pop_back(), llvm::predecessors(), llvm::SmallVectorTemplateBase< T >::push_back(), llvm::MemorySSA::renamePass(), llvm::Value::replaceUsesWithIf(), llvm::MemoryUseOrDef::setDefiningAccess(), llvm::IDFCalculatorBase< NodeTy, IsPostDom >::setDefiningBlocks(), setMemoryPhiValueForBlock(), llvm::SmallVectorBase::size(), and llvm::successors().
Referenced by applyInsertUpdates(), CloneInstructionInExitBlock(), isSafeToExecuteUnconditionally(), and MemorySSAUpdater().
Definition at line 243 of file MemorySSAUpdater.cpp.
References assert(), llvm::MemoryAccess::getBlock(), llvm::MemorySSA::getBlockDefs(), llvm::MemorySSA::getWritableBlockDefs(), llvm::MemorySSA::renamePass(), and llvm::MemoryUseOrDef::setDefiningAccess().
Referenced by applyInsertUpdates(), CloneInstructionInExitBlock(), MemorySSAUpdater(), and llvm::promoteLoopAccessesToScalars().
| void MemorySSAUpdater::moveAfter | ( | MemoryUseOrDef * | What, |
| MemoryUseOrDef * | Where | ||
| ) |
Definition at line 1156 of file MemorySSAUpdater.cpp.
References llvm::MemoryAccess::getBlock(), and llvm::MemoryAccess::getIterator().
Referenced by MemorySSAUpdater().
| void MemorySSAUpdater::moveAllAfterMergeBlocks | ( | BasicBlock * | From, |
| BasicBlock * | To, | ||
| Instruction * | Start | ||
| ) |
From block was merged into To.
There is a CFG edge from To to From.To still branches to From, but all instructions were moved and From is now an empty block; From is about to be deleted. Move all accesses from From to To starting at instruction Start. To may have multiple successors, From has a single predecessor. From may have successors with MPhi nodes, replace their incoming block with To. |---—| |---—|
| To | To | |
|---|---|---|
| => |
\/ | | |---—| | | <- Start | From | | | |---—| |---—|
Definition at line 1218 of file MemorySSAUpdater.cpp.
References assert(), llvm::BasicBlock::getUniquePredecessor(), and llvm::successors().
| void MemorySSAUpdater::moveAllAfterSpliceBlocks | ( | BasicBlock * | From, |
| BasicBlock * | To, | ||
| Instruction * | Start | ||
| ) |
From block was spliced into From and To.
There is a CFG edge from From to To. Move all accesses from From to To starting at instruction Start. To is newly created BB, so empty of MemorySSA::MemoryAccesses. Edges are already updated, so successors of To with MPhi nodes need to update incoming block. |---—| |---—|
| From | From | |
|---|---|---|
| | => \/ | | |---—| <- Start | | | To | |---—| |---—|
Definition at line 1207 of file MemorySSAUpdater.cpp.
References assert(), and llvm::successors().
Referenced by MemorySSAUpdater(), llvm::SplitBlock(), and turnGuardIntoBranch().
| void MemorySSAUpdater::moveBefore | ( | MemoryUseOrDef * | What, |
| MemoryUseOrDef * | Where | ||
| ) |
Definition at line 1151 of file MemorySSAUpdater.cpp.
References llvm::MemoryAccess::getBlock(), and llvm::MemoryAccess::getIterator().
Referenced by MemorySSAUpdater(), and moveToPlace().
| void MemorySSAUpdater::moveToPlace | ( | MemoryUseOrDef * | What, |
| BasicBlock * | BB, | ||
| MemorySSA::InsertionPlace | Where | ||
| ) |
Definition at line 1160 of file MemorySSAUpdater.cpp.
References llvm::BasicBlock::getTerminator(), and moveBefore().
Referenced by llvm::Loop::makeLoopInvariant(), MemorySSAUpdater(), moveInstructionBefore(), and turnGuardIntoBranch().
| void MemorySSAUpdater::removeBlocks | ( | const SmallSetVector< BasicBlock *, 8 > & | DeadBlocks | ) |
Remove all MemoryAcceses in a set of BasicBlocks about to be deleted.
Assumption we make here: all uses of deleted defs and phi must either occur in blocks about to be deleted (thus will be deleted as well), or they occur in phis that will simply lose an incoming value. Deleted blocks still have successor info, but their predecessor edges and Phi nodes may already be updated. Instructions in DeadBlocks should be deleted after this call.
Definition at line 1345 of file MemorySSAUpdater.cpp.
References assert(), llvm::User::dropAllReferences(), llvm::BasicBlock::getTerminator(), and llvm::successors().
Referenced by deleteDeadBlocksFromLoop(), deleteDeadClonedBlocks(), getInnermostLoopFor(), removeMemoryAccess(), and llvm::removeUnreachableBlocks().
| void MemorySSAUpdater::removeDuplicatePhiEdgesBetween | ( | const BasicBlock * | From, |
| const BasicBlock * | To | ||
| ) |
Update the MemoryPhi in To to have a single incoming edge from From, following a CFG change that replaced multiple edges (switch) with a direct branch.
Definition at line 529 of file MemorySSAUpdater.cpp.
References B, and llvm::MemorySSA::getMemoryAccess().
Referenced by changeCondBranchToUnconditionalTo(), changeToUnreachable(), getInnermostLoopFor(), MemorySSAUpdater(), and unswitchNontrivialInvariants().
| void MemorySSAUpdater::removeEdge | ( | BasicBlock * | From, |
| BasicBlock * | To | ||
| ) |
Update the MemoryPhi in To following an edge deletion between From and To.
If To becomes unreachable, a call to removeBlocks should be made.
Definition at line 522 of file MemorySSAUpdater.cpp.
References llvm::MemorySSA::getMemoryAccess().
Referenced by applyUpdates(), getInnermostLoopFor(), MemorySSAUpdater(), unswitchNontrivialInvariants(), and unswitchTrivialBranch().
| void MemorySSAUpdater::removeMemoryAccess | ( | MemoryAccess * | MA, |
| bool | OptimizePhis = false |
||
| ) |
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 1279 of file MemorySSAUpdater.cpp.
References assert(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::begin(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::clear(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::empty(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::end(), llvm::Use::getUser(), llvm::Value::hasValueHandle(), llvm::SetVector< T, SmallVector< T, N >, SmallDenseSet< T, N > >::insert(), onlySingleValue(), llvm::Use::set(), llvm::Value::use_begin(), llvm::Value::use_empty(), and llvm::ValueHandleBase::ValueIsRAUWd().
Referenced by applyInsertUpdates(), changeToUnreachable(), eraseInstruction(), isSafeToExecuteUnconditionally(), llvm::RecursivelyDeleteTriviallyDeadInstructions(), removeMemoryAccess(), and ReplaceUsesOfWith().
|
inline |
Remove MemoryAccess for a given instruction, if a MemoryAccess exists.
This should be called when an instruction (load/store) is deleted from the program.
Definition at line 235 of file MemorySSAUpdater.h.
References changeCondBranchToUnconditionalTo(), changeToUnreachable(), llvm::MemorySSA::getMemoryAccess(), removeBlocks(), and removeMemoryAccess().
| void MemorySSAUpdater::updateExitBlocksForClonedLoop | ( | ArrayRef< BasicBlock *> | ExitBlocks, |
| const ValueToValueMapTy & | VMap, | ||
| DominatorTree & | DT | ||
| ) |
Update phi nodes in exit block successors following cloning.
Exit blocks that were not cloned don't have additional predecessors added.
Definition at line 760 of file MemorySSAUpdater.cpp.
References llvm::sys::path::begin(), and llvm::sys::path::end().
Referenced by MemorySSAUpdater(), and unswitchNontrivialInvariants().
| void MemorySSAUpdater::updateExitBlocksForClonedLoop | ( | ArrayRef< BasicBlock *> | ExitBlocks, |
| ArrayRef< std::unique_ptr< ValueToValueMapTy >> | VMaps, | ||
| DominatorTree & | DT | ||
| ) |
Definition at line 768 of file MemorySSAUpdater.cpp.
References I.
| void MemorySSAUpdater::updateForClonedBlockIntoPred | ( | BasicBlock * | BB, |
| BasicBlock * | P1, | ||
| const ValueToValueMapTy & | VM | ||
| ) |
Definition at line 729 of file MemorySSAUpdater.cpp.
References applyInsertUpdates(), llvm::MemorySSA::getMemoryAccess(), llvm::Instruction::getSuccessor(), llvm::BasicBlock::getTerminator(), llvm::DominatorTreeBase< NodeT, IsPostDom >::Insert, llvm::ValueMap< KeyT, ValueT, Config >::lookup(), llvm::make_range(), and llvm::SmallVectorTemplateBase< T >::push_back().
Referenced by MemorySSAUpdater().
| void MemorySSAUpdater::updateForClonedLoop | ( | const LoopBlocksRPO & | LoopBlocks, |
| ArrayRef< BasicBlock *> | ExitBlocks, | ||
| const ValueToValueMapTy & | VM, | ||
| bool | IgnoreIncomingWithNoClones = false |
||
| ) |
Update MemorySSA after a loop was cloned, given the blocks in RPO order, the exit blocks and a 1:1 mapping of all blocks and instructions cloned.
This involves duplicating all defs and uses in the cloned blocks Updating phi nodes in exit block successors is done separately.
Definition at line 653 of file MemorySSAUpdater.cpp.
References llvm::MemoryPhi::addIncoming(), assert(), llvm::SmallPtrSetImpl< PtrType >::count(), E, llvm::MemoryPhi::getIncomingBlock(), llvm::MemoryPhi::getIncomingValue(), llvm::MemorySSA::getMemoryAccess(), llvm::MemoryPhi::getNumIncomingValues(), llvm::MemorySSA::getWritableBlockAccesses(), llvm::MemorySSA::isLiveOnEntryDef(), llvm::ValueMap< KeyT, ValueT, Config >::lookup(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT, BucketT >::lookup(), llvm::pred_begin(), llvm::pred_end(), and ProcessBlock().
Referenced by MemorySSAUpdater(), and unswitchNontrivialInvariants().
| void MemorySSAUpdater::updatePhisWhenInsertingUniqueBackedgeBlock | ( | BasicBlock * | LoopHeader, |
| BasicBlock * | LoopPreheader, | ||
| BasicBlock * | BackedgeBlock | ||
| ) |
Update MemorySSA when inserting a unique backedge block for a loop.
Definition at line 614 of file MemorySSAUpdater.cpp.
References E, llvm::MemorySSA::getMemoryAccess(), and I.
Referenced by insertUniqueBackedgeBlock(), and MemorySSAUpdater().
| void MemorySSAUpdater::wireOldPredecessorsToNewImmediatePredecessor | ( | BasicBlock * | Old, |
| BasicBlock * | New, | ||
| ArrayRef< BasicBlock *> | Preds, | ||
| bool | IdenticalEdgesWereMerged = true |
||
| ) |
A new empty BasicBlock (New) now branches directly to Old.
Some of Old's predecessors (Preds) are now branching to New instead of Old. If New is the only predecessor, move Old's Phi, if present, to New. Otherwise, add a new Phi in New with appropriate incoming values, and update the incoming values in Old's Phi node too, if present.
Definition at line 1242 of file MemorySSAUpdater.cpp.
References assert(), B, llvm::ArrayRef< T >::begin(), llvm::MemorySSA::Beginning, llvm::ArrayRef< T >::empty(), llvm::ArrayRef< T >::end(), llvm::BasicBlock::hasNPredecessors(), llvm::pred_size(), and llvm::ArrayRef< T >::size().
Referenced by llvm::sinkRegion(), llvm::SplitCriticalEdge(), and UpdateAnalysisInformation().
1.8.13