[MSSA] Delete move ctor; remove dynamic never-moved verification

Code archaeology in D59315 revealed that MSSA should never be moved.
Rather than trying to check dynamically that this hasn't happened in the
verify() functions of Walkers, it's likely best to just delete its move
constructor.

Since all these verify() functions did is check that MSSA hasn't moved,
this allows us to remove these verify functions.

I can readd the verification checks if someone's super concerned about
us trying to `memcpy` MemorySSA or something somewhere, but I imagine we
have other problems if we're trying anything like that...

llvm-svn: 356641
This commit is contained in:
George Burgess IV 2019-03-21 03:11:34 +00:00
parent c9f4cbf7a6
commit ae84e9ab49
2 changed files with 5 additions and 16 deletions

View File

@ -700,6 +700,11 @@ DEFINE_TRANSPARENT_OPERAND_ACCESSORS(MemoryPhi, MemoryAccess)
class MemorySSA {
public:
MemorySSA(Function &, AliasAnalysis *, DominatorTree *);
// MemorySSA must remain where it's constructed; Walkers it creates store
// pointers to it.
MemorySSA(MemorySSA &&) = delete;
~MemorySSA();
MemorySSAWalker *getWalker();
@ -1039,8 +1044,6 @@ public:
/// the walker it uses or returns.
virtual void invalidateInfo(MemoryAccess *) {}
virtual void verify(const MemorySSA *MSSA) { assert(MSSA == this->MSSA); }
protected:
friend class MemorySSA; // For updating MSSA pointer in MemorySSA move
// constructor.

View File

@ -922,8 +922,6 @@ public:
#endif
return Result;
}
void verify(const MemorySSA *MSSA) { assert(MSSA == &this->MSSA); }
};
struct RenamePassData {
@ -963,7 +961,6 @@ public:
// additional query becomes heavily used we may decide to cache the result.
// Walker instantiations will decide how to set the SkipSelf bool.
MemoryAccess *getClobberingMemoryAccessBase(MemoryAccess *, bool);
void verify(const MemorySSA *MSSA) { Walker.verify(MSSA); }
};
/// A MemorySSAWalker that does AA walks to disambiguate accesses. It no
@ -987,11 +984,6 @@ public:
if (auto *MUD = dyn_cast<MemoryUseOrDef>(MA))
MUD->resetOptimized();
}
void verify(const MemorySSA *MSSA) override {
MemorySSAWalker::verify(MSSA);
Walker->verify(MSSA);
}
};
class MemorySSA::SkipSelfWalker final : public MemorySSAWalker {
@ -1012,11 +1004,6 @@ public:
if (auto *MUD = dyn_cast<MemoryUseOrDef>(MA))
MUD->resetOptimized();
}
void verify(const MemorySSA *MSSA) override {
MemorySSAWalker::verify(MSSA);
Walker->verify(MSSA);
}
};
} // end namespace llvm
@ -1775,7 +1762,6 @@ void MemorySSA::verifyMemorySSA() const {
verifyDomination(F);
verifyOrdering(F);
verifyDominationNumbers(F);
Walker->verify(this);
// Previously, the verification used to also verify that the clobberingAccess
// cached by MemorySSA is the same as the clobberingAccess found at a later
// query to AA. This does not hold true in general due to the current fragility