Lines Matching defs:MemorySSA

1 //===- MemorySSA.cpp - Memory SSA Builder ---------------------------------===//
9 // This file implements the MemorySSA class.
13 #include "llvm/Analysis/MemorySSA.h"
77 cl::desc("The maximum number of stores/phis MemorySSA"
80 // Always verify MemorySSA if expensive checking is enabled.
89 cl::Hidden, cl::desc("Enable verification of MemorySSA."));
98 const MemorySSA *MSSA;
101 MemorySSAAnnotatedWriter(const MemorySSA *M) : MSSA(M) {}
119 MemorySSA *MSSA;
124 MemorySSAWalkerAnnotatedWriter(MemorySSA *M)
253 /// This assumes that, for the purposes of MemorySSA, Use comes directly after
291 // FIXME: We probably don't actually want MemorySSA to model these at all
391 /// \param MSSA The MemorySSA instance that Start and ClobberAt belong to.
398 const MemoryLocation &StartLoc, const MemorySSA &MSSA,
513 const MemorySSA &MSSA;
925 ClobberWalker(const MemorySSA &MSSA, DominatorTree &DT)
988 class MemorySSA::ClobberWalkerBase {
990 MemorySSA *MSSA;
993 ClobberWalkerBase(MemorySSA *M, DominatorTree *D) : Walker(*M, *D), MSSA(M) {}
1012 class MemorySSA::CachingWalker final : public MemorySSAWalker {
1016 CachingWalker(MemorySSA *M, ClobberWalkerBase *W)
1055 class MemorySSA::SkipSelfWalker final : public MemorySSAWalker {
1059 SkipSelfWalker(MemorySSA *M, ClobberWalkerBase *W)
1095 void MemorySSA::renameSuccessorPhis(BasicBlock *BB, MemoryAccess *IncomingVal,
1119 /// Rename a single basic block into MemorySSA form.
1122 MemoryAccess *MemorySSA::renameBlock(BasicBlock *BB, MemoryAccess *IncomingVal,
1146 void MemorySSA::renamePass(DomTreeNode *Root, MemoryAccess *IncomingVal,
1196 void MemorySSA::markUnreachableAsLiveOnEntry(BasicBlock *BB) {
1233 MemorySSA::MemorySSA(Function &Func, AliasAnalysis *AA, DominatorTree *DT)
1236 // Build MemorySSA using a batch alias analysis. This reuses the internal
1238 // safe because there are no CFG changes while building MemorySSA and can
1251 MemorySSA::MemorySSA(Loop &L, AliasAnalysis *AA, DominatorTree *DT)
1254 // Build MemorySSA using a batch alias analysis. This reuses the internal
1256 // safe because there are no CFG changes while building MemorySSA and can
1272 MemorySSA::~MemorySSA() {
1279 MemorySSA::AccessList *MemorySSA::getOrCreateAccessList(const BasicBlock *BB) {
1287 MemorySSA::DefsList *MemorySSA::getOrCreateDefsList(const BasicBlock *BB) {
1304 class MemorySSA::OptimizeUses {
1306 OptimizeUses(MemorySSA *MSSA, CachingWalker *Walker, BatchAAResults *BAA,
1334 MemorySSA *MSSA;
1354 void MemorySSA::OptimizeUses::optimizeUsesInBlock(
1360 MemorySSA::AccessList *Accesses = MSSA->getWritableBlockAccesses(BB);
1439 LLVM_DEBUG(dbgs() << "MemorySSA skipping optimization of " << *MU << " ("
1454 // The invariant.group handling in MemorySSA is ad-hoc and doesn't
1492 void MemorySSA::OptimizeUses::optimizeUses() {
1505 void MemorySSA::placePHINodes(
1519 void MemorySSA::buildMemorySSA(BatchAAResults &BAA, IterT Blocks) {
1564 // Only building MemorySSA for a single loop. placePHINodes may have
1590 MemorySSAWalker *MemorySSA::getWalker() { return getWalkerImpl(); }
1592 MemorySSA::CachingWalker *MemorySSA::getWalkerImpl() {
1603 MemorySSAWalker *MemorySSA::getSkipSelfWalker() {
1618 void MemorySSA::insertIntoListsForBlock(MemoryAccess *NewAccess,
1650 void MemorySSA::insertIntoListsBefore(MemoryAccess *What, const BasicBlock *BB,
1678 void MemorySSA::prepareForMoveTo(MemoryAccess *What, BasicBlock *BB) {
1694 void MemorySSA::moveTo(MemoryUseOrDef *What, BasicBlock *BB,
1700 void MemorySSA::moveTo(MemoryAccess *What, BasicBlock *BB,
1716 MemoryPhi *MemorySSA::createMemoryPhi(BasicBlock *BB) {
1725 MemoryUseOrDef *MemorySSA::createDefinedAccess(Instruction *I,
1758 MemoryUseOrDef *MemorySSA::createNewAccess(Instruction *I,
1838 /// Properly remove \p MA from all of MemorySSA's lookup tables.
1839 void MemorySSA::removeFromLookups(MemoryAccess *MA) {
1860 /// Properly remove \p MA from all of MemorySSA's lists.
1866 void MemorySSA::removeFromLists(MemoryAccess *MA, bool ShouldDelete) {
1893 void MemorySSA::print(raw_ostream &OS) const {
1902 LLVM_DUMP_METHOD void MemorySSA::dump() const { print(dbgs()); }
1905 void MemorySSA::verifyMemorySSA(VerificationLevel VL) const {
1930 // cached by MemorySSA is the same as the clobberingAccess found at a later
1935 // Invalidating MemorySSA is not an option, as the results in BasicAA can be so
1936 // random, in the worst case we'd need to rebuild MemorySSA from scratch after
1942 void MemorySSA::verifyPrevDefInPhis(IterT Blocks) const {
1979 void MemorySSA::verifyDominationNumbers(IterT Blocks) const {
2021 void MemorySSA::verifyOrderingDominationAndDefUses(IterT Blocks,
2111 /// Verify the def-use lists in MemorySSA, by verifying that \p Use
2113 void MemorySSA::verifyUseInDefs(MemoryAccess *Def, MemoryAccess *Use) const {
2129 void MemorySSA::renumberBlock(const BasicBlock *B) const {
2142 bool MemorySSA::locallyDominates(const MemoryAccess *Dominator,
2173 bool MemorySSA::dominates(const MemoryAccess *Dominator,
2186 bool MemorySSA::dominates(const MemoryAccess *Dominator,
2200 void MemorySSA::ensureOptimizedUses() {
2286 DOTFuncMSSAInfo(const Function &F, MemorySSA &MSSA)
2370 return MemorySSAAnalysis::Result(std::make_unique<MemorySSA>(F, &AA, &DT));
2391 OS << "MemorySSA for function: " << F.getName() << "\n";
2401 OS << "MemorySSA (walker) for function: " << F.getName() << "\n";
2432 MSSA.reset(new MemorySSA(F, &AA, &DT));
2445 MemorySSAWalker::MemorySSAWalker(MemorySSA *M) : MSSA(M) {}
2451 MemoryAccess *MemorySSA::ClobberWalkerBase::getClobberingMemoryAccessBase(
2529 MemoryAccess *MemorySSA::ClobberWalkerBase::getClobberingMemoryAccessBase(