[llvm] r268050 - Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Filipe Cabecinhas via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 29 08:22:49 PDT 2016
Author: filcab
Date: Fri Apr 29 10:22:48 2016
New Revision: 268050
URL: http://llvm.org/viewvc/llvm-project?rev=268050&view=rev
Log:
Unify XDEBUG and EXPENSIVE_CHECKS (into the latter), and add an option to the cmake build to enable them.
Summary:
Historically, we had a switch in the Makefiles for turning on "expensive
checks". This has never been ported to the cmake build, but the
(dead-ish) code is still around.
This will also make it easier to turn it on in buildbots.
Reviewers: chandlerc
Subscribers: jyknight, mzolotukhin, RKSimon, gberry, llvm-commits
Differential Revision: http://reviews.llvm.org/D19723
Modified:
llvm/trunk/CMakeLists.txt
llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
llvm/trunk/include/llvm/Analysis/RegionInfoImpl.h
llvm/trunk/include/llvm/Support/GenericDomTree.h
llvm/trunk/lib/Analysis/LoopInfo.cpp
llvm/trunk/lib/Analysis/ScalarEvolution.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/IR/Dominators.cpp
llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp
llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp
llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
llvm/trunk/lib/Transforms/ObjCARC/BlotMapVector.h
llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
Modified: llvm/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/CMakeLists.txt?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/CMakeLists.txt (original)
+++ llvm/trunk/CMakeLists.txt Fri Apr 29 10:22:48 2016
@@ -304,6 +304,8 @@ else()
option(LLVM_ENABLE_ASSERTIONS "Enable assertions" ON)
endif()
+option(LLVM_ENABLE_EXPENSIVE_CHECKS "Enable expensive checks" OFF)
+
set(LLVM_ABI_BREAKING_CHECKS "WITH_ASSERTS" CACHE STRING
"Enable abi-breaking checks. Can be WITH_ASSERTS, FORCE_ON or FORCE_OFF.")
Modified: llvm/trunk/cmake/modules/HandleLLVMOptions.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/HandleLLVMOptions.cmake?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/HandleLLVMOptions.cmake (original)
+++ llvm/trunk/cmake/modules/HandleLLVMOptions.cmake Fri Apr 29 10:22:48 2016
@@ -44,6 +44,11 @@ if( LLVM_ENABLE_ASSERTIONS )
endif()
endif()
+if(LLVM_ENABLE_EXPENSIVE_CHECKS)
+ add_definitions(-DEXPENSIVE_CHECKS)
+ add_definitions(-D_GLIBCXX_DEBUG)
+endif()
+
string(TOUPPER "${LLVM_ABI_BREAKING_CHECKS}" uppercase_LLVM_ABI_BREAKING_CHECKS)
if( uppercase_LLVM_ABI_BREAKING_CHECKS STREQUAL "WITH_ASSERTS" )
Modified: llvm/trunk/include/llvm/Analysis/RegionInfoImpl.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/RegionInfoImpl.h?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/RegionInfoImpl.h (original)
+++ llvm/trunk/include/llvm/Analysis/RegionInfoImpl.h Fri Apr 29 10:22:48 2016
@@ -665,7 +665,7 @@ typename Tr::RegionT *RegionInfoBase<Tr>
new RegionT(entry, exit, static_cast<RegionInfoT *>(this), DT);
BBtoRegion.insert(std::make_pair(entry, region));
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
region->verifyRegion();
#else
DEBUG(region->verifyRegion());
@@ -764,7 +764,7 @@ void RegionInfoBase<Tr>::buildRegionsTre
}
}
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
template <class Tr>
bool RegionInfoBase<Tr>::VerifyRegionInfo = true;
#else
@@ -798,7 +798,7 @@ void RegionInfoBase<Tr>::releaseMemory()
template <class Tr>
void RegionInfoBase<Tr>::verifyAnalysis() const {
- // Do only verify regions if explicitely activated using XDEBUG or
+ // Do only verify regions if explicitely activated using EXPENSIVE_CHECKS or
// -verify-region-info
if (!RegionInfoBase<Tr>::VerifyRegionInfo)
return;
Modified: llvm/trunk/include/llvm/Support/GenericDomTree.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Support/GenericDomTree.h?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Support/GenericDomTree.h (original)
+++ llvm/trunk/include/llvm/Support/GenericDomTree.h Fri Apr 29 10:22:48 2016
@@ -453,7 +453,7 @@ public:
// Compare the result of the tree walk and the dfs numbers, if expensive
// checks are enabled.
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
assert((!DFSInfoValid ||
(dominatedBySlowTreeWalk(A, B) == B->DominatedBy(A))) &&
"Tree walk disagrees with dfs numbers!");
Modified: llvm/trunk/lib/Analysis/LoopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/LoopInfo.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/LoopInfo.cpp (original)
+++ llvm/trunk/lib/Analysis/LoopInfo.cpp Fri Apr 29 10:22:48 2016
@@ -38,7 +38,7 @@ template class llvm::LoopBase<BasicBlock
template class llvm::LoopInfoBase<BasicBlock, Loop>;
// Always verify loopinfo if expensive checking is enabled.
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
static bool VerifyLoopInfo = true;
#else
static bool VerifyLoopInfo = false;
Modified: llvm/trunk/lib/Analysis/ScalarEvolution.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/ScalarEvolution.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/ScalarEvolution.cpp (original)
+++ llvm/trunk/lib/Analysis/ScalarEvolution.cpp Fri Apr 29 10:22:48 2016
@@ -111,7 +111,7 @@ MaxBruteForceIterations("scalar-evolutio
"derived loop"),
cl::init(100));
-// FIXME: Enable this with XDEBUG when the test suite is clean.
+// FIXME: Enable this with EXPENSIVE_CHECKS when the test suite is clean.
static cl::opt<bool>
VerifySCEV("verify-scev",
cl::desc("Verify ScalarEvolution's backedge taken counts (slow)"));
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/LegalizeTypes.cpp Fri Apr 29 10:22:48 2016
@@ -204,7 +204,7 @@ bool DAGTypeLegalizer::run() {
// Now that we have a set of nodes to process, handle them all.
while (!Worklist.empty()) {
-#ifndef XDEBUG
+#ifndef EXPENSIVE_CHECKS
if (EnableExpensiveChecks)
#endif
PerformExpensiveChecks();
@@ -394,7 +394,7 @@ NodeDone:
}
}
-#ifndef XDEBUG
+#ifndef EXPENSIVE_CHECKS
if (EnableExpensiveChecks)
#endif
PerformExpensiveChecks();
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Fri Apr 29 10:22:48 2016
@@ -7294,9 +7294,9 @@ void llvm::checkForCycles(const llvm::SD
bool force) {
#ifndef NDEBUG
bool check = force;
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
check = true;
-#endif // XDEBUG
+#endif // EXPENSIVE_CHECKS
if (check) {
assert(N && "Checking nonexistent SDNode");
SmallPtrSet<const SDNode*, 32> visited;
Modified: llvm/trunk/lib/IR/Dominators.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Dominators.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Dominators.cpp (original)
+++ llvm/trunk/lib/IR/Dominators.cpp Fri Apr 29 10:22:48 2016
@@ -28,7 +28,7 @@
using namespace llvm;
// Always verify dominfo if expensive checking is enabled.
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
static bool VerifyDomInfo = true;
#else
static bool VerifyDomInfo = false;
Modified: llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMFrameLowering.cpp Fri Apr 29 10:22:48 2016
@@ -2155,7 +2155,7 @@ void ARMFrameLowering::adjustForSegmente
PrevStackMBB->addSuccessor(McrMBB);
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
MF.verify();
#endif
}
Modified: llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp (original)
+++ llvm/trunk/lib/Target/Hexagon/HexagonCommonGEP.cpp Fri Apr 29 10:22:48 2016
@@ -1298,7 +1298,7 @@ bool HexagonCommonGEP::runOnFunction(Fun
materialize(Loc);
removeDeadCode();
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
// Run this only when expensive checks are enabled.
verifyFunction(F);
#endif
Modified: llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcFrameLowering.cpp Fri Apr 29 10:22:48 2016
@@ -350,7 +350,7 @@ void SparcFrameLowering::remapRegsForLea
}
assert(verifyLeafProcRegUse(&MRI));
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
MF.verify(0, "After LeafProc Remapping");
#endif
}
Modified: llvm/trunk/lib/Target/X86/X86FrameLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/X86/X86FrameLowering.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Target/X86/X86FrameLowering.cpp (original)
+++ llvm/trunk/lib/Target/X86/X86FrameLowering.cpp Fri Apr 29 10:22:48 2016
@@ -2279,7 +2279,7 @@ void X86FrameLowering::adjustForSegmente
checkMBB->addSuccessor(allocMBB);
checkMBB->addSuccessor(&PrologueMBB);
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
MF.verify();
#endif
}
@@ -2423,7 +2423,7 @@ void X86FrameLowering::adjustForHiPEProl
incStackMBB->addSuccessor(&PrologueMBB, {99, 100});
incStackMBB->addSuccessor(incStackMBB, {1, 100});
}
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
MF.verify();
#endif
}
Modified: llvm/trunk/lib/Transforms/ObjCARC/BlotMapVector.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/ObjCARC/BlotMapVector.h?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/ObjCARC/BlotMapVector.h (original)
+++ llvm/trunk/lib/Transforms/ObjCARC/BlotMapVector.h Fri Apr 29 10:22:48 2016
@@ -31,7 +31,7 @@ public:
const_iterator begin() const { return Vector.begin(); }
const_iterator end() const { return Vector.end(); }
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
~BlotMapVector() {
assert(Vector.size() >= Map.size()); // May differ due to blotting.
for (typename MapTy::const_iterator I = Map.begin(), E = Map.end(); I != E;
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Fri Apr 29 10:22:48 2016
@@ -62,7 +62,7 @@ static cl::opt<unsigned>
RematerializationThreshold("spp-rematerialization-threshold", cl::Hidden,
cl::init(6));
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
static bool ClobberNonLive = true;
#else
static bool ClobberNonLive = false;
Modified: llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp?rev=268050&r1=268049&r2=268050&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/MemorySSA.cpp Fri Apr 29 10:22:48 2016
@@ -805,7 +805,7 @@ void CachingMemorySSAWalker::invalidateI
CachedUpwardsClobberingAccess.clear();
}
-#ifdef XDEBUG
+#ifdef EXPENSIVE_CHECKS
// Run this only when expensive checks are enabled.
verifyRemoved(MA);
#endif
More information about the llvm-commits
mailing list