[llvm] r343086 - Run VerifyDAGDiverence in debug only
Mikael Nilsson via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 02:25:45 PDT 2018
Author: mikael
Date: Wed Sep 26 02:25:45 2018
New Revision: 343086
URL: http://llvm.org/viewvc/llvm-project?rev=343086&view=rev
Log:
Run VerifyDAGDiverence in debug only
VerifyDAGDiverence costs compilation time, avoid running it in non-debug
builds.
Differential Revision: https://reviews.llvm.org/D52454
Modified:
llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
Modified: llvm/trunk/include/llvm/CodeGen/SelectionDAG.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/SelectionDAG.h?rev=343086&r1=343085&r2=343086&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/SelectionDAG.h (original)
+++ llvm/trunk/include/llvm/CodeGen/SelectionDAG.h Wed Sep 26 02:25:45 2018
@@ -471,7 +471,9 @@ public:
return Root;
}
+#ifndef NDEBUG
void VerifyDAGDiverence();
+#endif
/// This iterates over the nodes in the SelectionDAG, folding
/// certain types of nodes together, or eliminating superfluous nodes. The
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp?rev=343086&r1=343085&r2=343086&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Wed Sep 26 02:25:45 2018
@@ -7955,6 +7955,7 @@ void SelectionDAG::CreateTopologicalOrde
}
}
+#ifndef NDEBUG
void SelectionDAG::VerifyDAGDiverence()
{
std::vector<SDNode*> TopoOrder;
@@ -7981,6 +7982,7 @@ void SelectionDAG::VerifyDAGDiverence()
"Divergence bit inconsistency detected\n");
}
}
+#endif
/// ReplaceAllUsesOfValuesWith - Replace any uses of From with To, leaving
Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=343086&r1=343085&r2=343086&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Wed Sep 26 02:25:45 2018
@@ -714,8 +714,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
int BlockNumber = -1;
(void)BlockNumber;
bool MatchFilterBB = false; (void)MatchFilterBB;
+#ifndef NDEBUG
TargetTransformInfo &TTI =
getAnalysis<TargetTransformInfoWrapperPass>().getTTI(*FuncInfo->Fn);
+#endif
// Pre-type legalization allow creation of any node types.
CurDAG->NewNodesMustHaveLegalTypes = false;
@@ -750,8 +752,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
CurDAG->Combine(BeforeLegalizeTypes, AA, OptLevel);
}
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
LLVM_DEBUG(dbgs() << "Optimized lowered selection DAG: "
<< printMBBReference(*FuncInfo->MBB) << " '" << BlockName
@@ -770,8 +774,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
Changed = CurDAG->LegalizeTypes();
}
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
LLVM_DEBUG(dbgs() << "Type-legalized selection DAG: "
<< printMBBReference(*FuncInfo->MBB) << " '" << BlockName
@@ -792,8 +798,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
CurDAG->Combine(AfterLegalizeTypes, AA, OptLevel);
}
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
LLVM_DEBUG(dbgs() << "Optimized type-legalized selection DAG: "
<< printMBBReference(*FuncInfo->MBB) << " '" << BlockName
@@ -839,8 +847,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
<< "'\n";
CurDAG->dump());
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
}
if (ViewLegalizeDAGs && MatchFilterBB)
@@ -852,8 +862,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
CurDAG->Legalize();
}
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
LLVM_DEBUG(dbgs() << "Legalized selection DAG: "
<< printMBBReference(*FuncInfo->MBB) << " '" << BlockName
@@ -870,8 +882,10 @@ void SelectionDAGISel::CodeGenAndEmitDAG
CurDAG->Combine(AfterLegalizeDAG, AA, OptLevel);
}
+#ifndef NDEBUG
if (TTI.hasBranchDivergence())
CurDAG->VerifyDAGDiverence();
+#endif
LLVM_DEBUG(dbgs() << "Optimized legalized selection DAG: "
<< printMBBReference(*FuncInfo->MBB) << " '" << BlockName
More information about the llvm-commits
mailing list