[MemorySSA] Don't verify MemorySSA unless VerifyMemorySSA enabled

MemorySSA is often taking up an unreasonable fraction of runtime in
assertion enabled builds. Turns out that there is one code-path that
runs verifyMemorySSA() even if VerifyMemorySSA is not enabled. This
patch makes it conditional as well.

Differential Revision: https://reviews.llvm.org/D74505
This commit is contained in:
Nikita Popov 2020-02-12 22:25:27 +01:00
parent bfe3779459
commit f0b57d8071
1 changed files with 4 additions and 1 deletions

View File

@ -2298,7 +2298,10 @@ bool MemorySSAWrapperPass::runOnFunction(Function &F) {
return false;
}
void MemorySSAWrapperPass::verifyAnalysis() const { MSSA->verifyMemorySSA(); }
void MemorySSAWrapperPass::verifyAnalysis() const {
if (VerifyMemorySSA)
MSSA->verifyMemorySSA();
}
void MemorySSAWrapperPass::print(raw_ostream &OS, const Module *M) const {
MSSA->print(OS);