[MemorySSA] Add NDEBUG checks to verifiers; NFC

verify*() methods are intended to have no side-effects (unless we detect
broken MSSA, in which case they assert()), and all of the other verify
methods are wrapped by `#ifndef NDEBUG`.

llvm-svn: 340793
This commit is contained in:
George Burgess IV 2018-08-28 00:32:32 +00:00
parent dfa7755c52
commit 6a9aa02ff3
1 changed files with 4 additions and 0 deletions

View File

@ -1711,6 +1711,7 @@ void MemorySSA::verifyDominationNumbers(const Function &F) const {
/// Verify that the order and existence of MemoryAccesses matches the /// Verify that the order and existence of MemoryAccesses matches the
/// order and existence of memory affecting instructions. /// order and existence of memory affecting instructions.
void MemorySSA::verifyOrdering(Function &F) const { void MemorySSA::verifyOrdering(Function &F) const {
#ifndef NDEBUG
// Walk all the blocks, comparing what the lookups think and what the access // Walk all the blocks, comparing what the lookups think and what the access
// lists think, as well as the order in the blocks vs the order in the access // lists think, as well as the order in the blocks vs the order in the access
// lists. // lists.
@ -1769,6 +1770,7 @@ void MemorySSA::verifyOrdering(Function &F) const {
} }
ActualDefs.clear(); ActualDefs.clear();
} }
#endif
} }
/// Verify the domination properties of MemorySSA by checking that each /// Verify the domination properties of MemorySSA by checking that each
@ -1811,6 +1813,7 @@ void MemorySSA::verifyUseInDefs(MemoryAccess *Def, MemoryAccess *Use) const {
/// accesses and verifying that, for each use, it appears in the /// accesses and verifying that, for each use, it appears in the
/// appropriate def's use list /// appropriate def's use list
void MemorySSA::verifyDefUses(Function &F) const { void MemorySSA::verifyDefUses(Function &F) const {
#ifndef NDEBUG
for (BasicBlock &B : F) { for (BasicBlock &B : F) {
// Phi nodes are attached to basic blocks // Phi nodes are attached to basic blocks
if (MemoryPhi *Phi = getMemoryAccess(&B)) { if (MemoryPhi *Phi = getMemoryAccess(&B)) {
@ -1831,6 +1834,7 @@ void MemorySSA::verifyDefUses(Function &F) const {
} }
} }
} }
#endif
} }
/// Perform a local numbering on blocks so that instruction ordering can be /// Perform a local numbering on blocks so that instruction ordering can be