Skip to content

Commit 593a0dd

Browse files
nikiczmodem
authored andcommitted
[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 (cherry picked from commit f0b57d8)
1 parent 00f4618 commit 593a0dd

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Analysis/MemorySSA.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2298,7 +2298,10 @@ bool MemorySSAWrapperPass::runOnFunction(Function &F) {
22982298
return false;
22992299
}
23002300

2301-
void MemorySSAWrapperPass::verifyAnalysis() const { MSSA->verifyMemorySSA(); }
2301+
void MemorySSAWrapperPass::verifyAnalysis() const {
2302+
if (VerifyMemorySSA)
2303+
MSSA->verifyMemorySSA();
2304+
}
23022305

23032306
void MemorySSAWrapperPass::print(raw_ostream &OS, const Module *M) const {
23042307
MSSA->print(OS);

0 commit comments

Comments
 (0)