Skip to content
This repository was archived by the owner on Mar 28, 2020. It is now read-only.

Commit 41df26a

Browse files
committed
[MemorySSA] Expose the verify as a debug option.
Summary: Expose VerifyMemorySSA as a debug option. If set, passes will call the MSSA->verifyMemorySSA() after calling into the updater's APIs when MemorySSA should be valid. Reviewers: george.burgess.iv Subscribers: sanjoy, jlebar, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D50749 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@339795 91177308-0d34-0410-b5e6-96231b3b80d8
1 parent 8529a08 commit 41df26a

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

include/llvm/Support/Debug.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,10 @@ extern bool VerifyDomInfo;
9494
///
9595
extern bool VerifyLoopInfo;
9696

97+
/// Enables verification of MemorySSA.
98+
///
99+
extern bool VerifyMemorySSA;
100+
97101
///\}
98102

99103
/// EnableDebugBuffering - This defaults to false. If true, the debug

lib/Analysis/MemorySSA.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,15 @@ static cl::opt<unsigned> MaxCheckLimit(
7777
cl::desc("The maximum number of stores/phis MemorySSA"
7878
"will consider trying to walk past (default = 100)"));
7979

80-
static cl::opt<bool>
81-
VerifyMemorySSA("verify-memoryssa", cl::init(false), cl::Hidden,
82-
cl::desc("Verify MemorySSA in legacy printer pass."));
80+
// Always verify MemorySSA if expensive checking is enabled.
81+
#ifdef EXPENSIVE_CHECKS
82+
bool llvm::VerifyMemorySSA = true;
83+
#else
84+
bool llvm::VerifyMemorySSA = false;
85+
#endif
86+
static cl::opt<bool, true>
87+
VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA),
88+
cl::Hidden, cl::desc("Enable verification of MemorySSA."));
8389

8490
namespace llvm {
8591

0 commit comments

Comments
 (0)