[llvm-commits] [llvm] r102824 - in /llvm/trunk: include/llvm/Transforms/Utils/Cloning.h lib/Transforms/IPO/Inliner.cpp lib/Transforms/Utils/InlineFunction.cpp

Chris Lattner sabre at nondot.org
Fri Apr 30 18:26:13 PDT 2010


Author: lattner
Date: Fri Apr 30 20:26:13 2010
New Revision: 102824

URL: http://llvm.org/viewvc/llvm-project?rev=102824&view=rev
Log:
rename InlineInfo.DevirtualizedCalls -> InlinedCalls to
reflect that it includes all inlined calls now, not just
devirtualized ones.

Modified:
    llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
    llvm/trunk/lib/Transforms/IPO/Inliner.cpp
    llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp

Modified: llvm/trunk/include/llvm/Transforms/Utils/Cloning.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Transforms/Utils/Cloning.h?rev=102824&r1=102823&r2=102824&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Transforms/Utils/Cloning.h (original)
+++ llvm/trunk/include/llvm/Transforms/Utils/Cloning.h Fri Apr 30 20:26:13 2010
@@ -176,14 +176,13 @@
   /// get copied into the caller.
   SmallVector<AllocaInst*, 4> StaticAllocas;
 
-  /// DevirtualizedCalls - InlineFunction fills this in with callsites that were
-  /// inlined from the callee that went from being indirect calls to direct
-  /// calls due to inlining.  This is only filled in if CG is non-null.
-  SmallVector<WeakVH, 2> DevirtualizedCalls;
+  /// InlinedCalls - InlineFunction fills this in with callsites that were
+  /// inlined from the callee.  This is only filled in if CG is non-null.
+  SmallVector<WeakVH, 8> InlinedCalls;
   
   void reset() {
     StaticAllocas.clear();
-    DevirtualizedCalls.clear();
+    InlinedCalls.clear();
   }
 };
   

Modified: llvm/trunk/lib/Transforms/IPO/Inliner.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/IPO/Inliner.cpp?rev=102824&r1=102823&r2=102824&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/IPO/Inliner.cpp (original)
+++ llvm/trunk/lib/Transforms/IPO/Inliner.cpp Fri Apr 30 20:26:13 2010
@@ -420,17 +420,17 @@
           continue;
         ++NumInlined;
         
-        // If inlining this function devirtualized any call sites, throw them
+        // If inlining this function gave us any new call sites, throw them
         // onto our worklist to process.  They are useful inline candidates.
-        if (!InlineInfo.DevirtualizedCalls.empty()) {
+        if (!InlineInfo.InlinedCalls.empty()) {
           // Create a new inline history entry for this, so that we remember
           // that these new callsites came about due to inlining Callee.
           int NewHistoryID = InlineHistory.size();
           InlineHistory.push_back(std::make_pair(Callee, InlineHistoryID));
 
-          for (unsigned i = 0, e = InlineInfo.DevirtualizedCalls.size();
+          for (unsigned i = 0, e = InlineInfo.InlinedCalls.size();
                i != e; ++i) {
-            Value *Ptr = InlineInfo.DevirtualizedCalls[i];
+            Value *Ptr = InlineInfo.InlinedCalls[i];
             CallSites.push_back(std::make_pair(CallSite(Ptr), NewHistoryID));
           }
         }

Modified: llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp?rev=102824&r1=102823&r2=102824&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp (original)
+++ llvm/trunk/lib/Transforms/Utils/InlineFunction.cpp Fri Apr 30 20:26:13 2010
@@ -201,7 +201,11 @@
     // add.  Check for this case.
     Instruction *NewCall = dyn_cast<Instruction>(VMI->second);
     if (NewCall == 0) continue;
-    
+
+    // Remember that this call site got inlined for the client of
+    // InlineFunction.
+    IFI.InlinedCalls.push_back(NewCall);
+
     // It's possible that inlining the callsite will cause it to go from an
     // indirect to a direct call by resolving a function pointer.  If this
     // happens, set the callee of the new call site to a more precise
@@ -212,14 +216,10 @@
         // Indirect call site resolved to direct call.
         CallerNode->addCalledFunction(CallSite::get(NewCall), CG[F]);
         
-        // Remember that this callsite got devirtualized for the client of
-        // InlineFunction.
-        IFI.DevirtualizedCalls.push_back(NewCall);
         continue;
       }
     
     CallerNode->addCalledFunction(CallSite::get(NewCall), I->second);
-    IFI.DevirtualizedCalls.push_back(NewCall);
   }
   
   // Update the call graph by deleting the edge from Callee to Caller.  We must





More information about the llvm-commits mailing list