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.

llvm-svn: 11695
This commit is contained in:
Chris Lattner 2004-02-22 00:53:54 +00:00
parent f3e2a6360c
commit a376aae246
1 changed files with 11 additions and 6 deletions

View File

@ -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();
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 = CN->getLink(MergeOffset);
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.