Index: llvm/trunk/include/llvm/Support/Debug.h =================================================================== --- llvm/trunk/include/llvm/Support/Debug.h +++ llvm/trunk/include/llvm/Support/Debug.h @@ -94,6 +94,10 @@ /// extern bool VerifyLoopInfo; +/// Enables verification of MemorySSA. +/// +extern bool VerifyMemorySSA; + ///\} /// EnableDebugBuffering - This defaults to false. If true, the debug Index: llvm/trunk/lib/Analysis/MemorySSA.cpp =================================================================== --- llvm/trunk/lib/Analysis/MemorySSA.cpp +++ llvm/trunk/lib/Analysis/MemorySSA.cpp @@ -77,9 +77,15 @@ cl::desc("The maximum number of stores/phis MemorySSA" "will consider trying to walk past (default = 100)")); -static cl::opt - VerifyMemorySSA("verify-memoryssa", cl::init(false), cl::Hidden, - cl::desc("Verify MemorySSA in legacy printer pass.")); +// Always verify MemorySSA if expensive checking is enabled. +#ifdef EXPENSIVE_CHECKS +bool llvm::VerifyMemorySSA = true; +#else +bool llvm::VerifyMemorySSA = false; +#endif +static cl::opt + VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA), + cl::Hidden, cl::desc("Enable verification of MemorySSA.")); namespace llvm {