aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-12-08 21:03:56 +0000
committerChris Lattner <sabre@nondot.org>2004-12-08 21:03:56 +0000
commitb29dd0ff2bfbe78e1478a27acbf82ca284011ec6 (patch)
tree7a72f909194a1ae2de1f080e0a434e9b4f996f5c /lib/Analysis/DataStructure/DataStructure.cpp
parent2c20ef506f65f649fd9fb8823f8c7b0086b1ba5c (diff)
Move method out of line for better ICC support
Add some ifdefs for some stuff I like to be able to toggle easily git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18665 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 179f286378..be53dab3b8 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -27,6 +27,8 @@
#include <algorithm>
using namespace llvm;
+#define COLLAPSE_ARRAYS_AGGRESSIVELY 0
+
namespace {
Statistic<> NumFolds ("dsa", "Number of nodes completely folded");
Statistic<> NumCallNodesMerged("dsa", "Number of call nodes merged");
@@ -651,12 +653,14 @@ void DSNode::MergeNodes(DSNodeHandle& CurNodeH, DSNodeHandle& NH) {
// If the two nodes are of different size, and the smaller node has the array
// bit set, collapse!
if (NSize != CurNodeH.getNode()->getSize()) {
+#if COLLAPSE_ARRAYS_AGGRESSIVELY
if (NSize < CurNodeH.getNode()->getSize()) {
if (NH.getNode()->isArray())
NH.getNode()->foldNodeCompletely();
} else if (CurNodeH.getNode()->isArray()) {
NH.getNode()->foldNodeCompletely();
}
+#endif
}
// Merge the type entries of the two nodes together...
@@ -895,6 +899,7 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
} else if (SN->getSize() != DN->getSize()) {
// If the two nodes are of different size, and the smaller node has the
// array bit set, collapse!
+#if COLLAPSE_ARRAYS_AGGRESSIVELY
if (SN->getSize() < DN->getSize()) {
if (SN->isArray()) {
DN->foldNodeCompletely();
@@ -904,6 +909,7 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
DN->foldNodeCompletely();
DN = NH.getNode();
}
+#endif
}
// Merge the type entries of the two nodes together...
@@ -1934,6 +1940,11 @@ void DSGraph::removeDeadNodes(unsigned Flags) {
DEBUG(AssertGraphOK(); GlobalsGraph->AssertGraphOK());
}
+void DSGraph::AssertNodeContainsGlobal(const DSNode *N, GlobalValue *GV) const {
+ assert(std::find(N->getGlobals().begin(), N->getGlobals().end(), GV) !=
+ N->getGlobals().end() && "Global value not in node!");
+}
+
void DSGraph::AssertCallSiteInGraph(const DSCallSite &CS) const {
if (CS.isIndirectCall()) {
AssertNodeInGraph(CS.getCalleeNode());