[llvm] r339795 - [MemorySSA] Expose the verify as a debug option.

Alina Sbirlea via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 15 10:34:55 PDT 2018


Author: asbirlea
Date: Wed Aug 15 10:34:55 2018
New Revision: 339795

URL: http://llvm.org/viewvc/llvm-project?rev=339795&view=rev
Log:
[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

Modified:
    llvm/trunk/include/llvm/Support/Debug.h
    llvm/trunk/lib/Analysis/MemorySSA.cpp

Modified: llvm/trunk/include/llvm/Support/Debug.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/Debug.h?rev=339795&r1=339794&r2=339795&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/Debug.h (original)
+++ llvm/trunk/include/llvm/Support/Debug.h Wed Aug 15 10:34:55 2018
@@ -94,6 +94,10 @@ extern bool VerifyDomInfo;
 ///
 extern bool VerifyLoopInfo;
 
+/// Enables verification of MemorySSA.
+///
+extern bool VerifyMemorySSA;
+
 ///\}
 
 /// EnableDebugBuffering - This defaults to false.  If true, the debug

Modified: llvm/trunk/lib/Analysis/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/MemorySSA.cpp?rev=339795&r1=339794&r2=339795&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Analysis/MemorySSA.cpp Wed Aug 15 10:34:55 2018
@@ -77,9 +77,15 @@ static cl::opt<unsigned> MaxCheckLimit(
     cl::desc("The maximum number of stores/phis MemorySSA"
              "will consider trying to walk past (default = 100)"));
 
-static cl::opt<bool>
-    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<bool, true>
+    VerifyMemorySSAX("verify-memoryssa", cl::location(VerifyMemorySSA),
+                     cl::Hidden, cl::desc("Enable verification of MemorySSA."));
 
 namespace llvm {
 




More information about the llvm-commits mailing list