[llvm-commits] [poolalloc] r124979 - /poolalloc/trunk/lib/DSA/StdLibPass.cpp
Arushi Aggarwal
aggarwa4 at illinois.edu
Sat Feb 5 21:11:56 PST 2011
Author: aggarwa4
Date: Sat Feb 5 23:11:56 2011
New Revision: 124979
URL: http://llvm.org/viewvc/llvm-project?rev=124979&view=rev
Log:
Make sure that a node exists for the return value,
before merging or folding.
Modified:
poolalloc/trunk/lib/DSA/StdLibPass.cpp
Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=124979&r1=124978&r2=124979&view=diff
==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Sat Feb 5 23:11:56 2011
@@ -394,6 +394,8 @@
//
std::vector<DSNodeHandle> toMerge;
if (recFuncs[x].action.mergeWithRet)
+ if (isa<PointerType>(CI->getType()))
+ if (Graph->hasNodeForValue(CI))
toMerge.push_back(Graph->getNodeForValue(CI));
if (recFuncs[x].action.mergeAllArgs || recFuncs[x].action.mergeWithRet)
for (unsigned y = 1; y < CI->getNumOperands(); ++y)
@@ -409,7 +411,8 @@
//
if (!noStdLibFold && recFuncs[x].action.collapse) {
if (isa<PointerType>(CI->getType())){
- Graph->getNodeForValue(CI).getNode()->foldNodeCompletely();
+ if (Graph->hasNodeForValue(CI))
+ Graph->getNodeForValue(CI).getNode()->foldNodeCompletely();
NumNodesFoldedInStdLib++;
}
for (unsigned y = 1; y < CI->getNumOperands(); ++y){
@@ -467,7 +470,9 @@
//
std::vector<DSNodeHandle> toMerge;
if (recFuncs[x].action.mergeWithRet)
- toMerge.push_back(Graph->getNodeForValue(CI));
+ if (isa<PointerType>(CI->getType()))
+ if (Graph->hasNodeForValue(CI))
+ toMerge.push_back(Graph->getNodeForValue(CI));
if (recFuncs[x].action.mergeAllArgs || recFuncs[x].action.mergeWithRet)
for (unsigned y = 1; y < CI->getNumOperands(); ++y)
if (isa<PointerType>(CI->getOperand(y)->getType()))
@@ -482,7 +487,8 @@
//
if (!noStdLibFold && recFuncs[x].action.collapse) {
if (isa<PointerType>(CI->getType())){
- Graph->getNodeForValue(CI).getNode()->foldNodeCompletely();
+ if (Graph->hasNodeForValue(CI))
+ Graph->getNodeForValue(CI).getNode()->foldNodeCompletely();
NumNodesFoldedInStdLib++;
}
for (unsigned y = 1; y < CI->getNumOperands(); ++y)
More information about the llvm-commits
mailing list