Reduce the number of functions we look at in the first pass, and preallocate
authorNick Lewycky <nicholas@mxc.ca>
Fri, 28 Jan 2011 05:48:15 +0000 (05:48 +0000)
committerNick Lewycky <nicholas@mxc.ca>
Fri, 28 Jan 2011 05:48:15 +0000 (05:48 +0000)
the function equality set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124475 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/IPO/MergeFunctions.cpp

index d4ecd55d033f5556c229ff4708d361570c0fbf9a..30afaab47cf60c8e5880a95792380bd601d0cde8 100644 (file)
@@ -798,8 +798,10 @@ bool MergeFunctions::runOnModule(Module &M) {
   TD = getAnalysisIfAvailable<TargetData>();
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) {
-    Deferred.push_back(WeakVH(I));
+    if (!I->isDeclaration() && !I->hasAvailableExternallyLinkage())
+      Deferred.push_back(WeakVH(I));
   }
+  FnSet.resize(Deferred.size());
 
   do {
     std::vector<WeakVH> Worklist;