aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-02-22 00:53:54 +0000
committerChris Lattner <sabre@nondot.org>2004-02-22 00:53:54 +0000
commit0ad91703274b57f98a08baa545712b64c4b89987 (patch)
tree21b7f472945ea27028f6070356c476fbf2140d9b
parentd85645f526df19696664398c1d36ae12f6e0da71 (diff)
downloadexternal_llvm-0ad91703274b57f98a08baa545712b64c4b89987.zip
external_llvm-0ad91703274b57f98a08baa545712b64c4b89987.tar.gz
external_llvm-0ad91703274b57f98a08baa545712b64c4b89987.tar.bz2
Use isNull instead of getNode() to test for existence of a node, this is cheaper.
FIX MAJOR BUG, whereby we didn't merge null edges correctly. Correcting this fixes poolallocation on 175.vpr, and possibly others. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11695 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/Analysis/DataStructure/DataStructure.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/lib/Analysis/DataStructure/DataStructure.cpp b/lib/Analysis/DataStructure/DataStructure.cpp
index 528a622..5ea414e 100644
--- a/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/lib/Analysis/DataStructure/DataStructure.cpp
@@ -845,7 +845,7 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
// been cloned.
const DSNode *SN = SrcNH.getNode();
DSNodeHandle &SCNH = NodeMap[SN]; // SourceClonedNodeHandle
- if (SCNH.getNode()) { // Node already cloned?
+ if (!SCNH.isNull()) { // Node already cloned?
NH.mergeWith(DSNodeHandle(SCNH.getNode(),
SCNH.getOffset()+SrcNH.getOffset()));
@@ -971,10 +971,15 @@ void ReachabilityCloner::merge(const DSNodeHandle &NH,
if (CN->getSize() != 1)
MergeOffset = ((i << DS::PointerShift)+SCNH.getOffset()) %CN->getSize();
- // Perform the recursive merging. Make sure to create a temporary NH,
- // because the Link can disappear in the process of recursive merging.
- DSNodeHandle Tmp = CN->getLink(MergeOffset);
- merge(Tmp, SrcEdge);
+ DSNodeHandle &Link = CN->getLink(MergeOffset);
+ if (!Link.isNull()) {
+ // Perform the recursive merging. Make sure to create a temporary NH,
+ // because the Link can disappear in the process of recursive merging.
+ DSNodeHandle Tmp = Link;
+ merge(Tmp, SrcEdge);
+ } else {
+ merge(Link, SrcEdge);
+ }
}
}
}
@@ -1214,7 +1219,7 @@ void DSGraph::mergeInGraph(const DSCallSite &CS, Function &F,
}
// Map the return node pointer over.
- if (CS.getRetVal().getNode())
+ if (!CS.getRetVal().isNull())
RC.merge(CS.getRetVal(), Graph.getReturnNodeFor(F));
// If requested, copy the calls or aux-calls lists.