[llvm-commits] [llvm] r98403 - in /llvm/trunk: include/llvm/Analysis/InlineCost.h lib/Analysis/InlineCost.cpp

Devang Patel dpatel at apple.com
Fri Mar 12 16:45:31 PST 2010


Author: dpatel
Date: Fri Mar 12 18:45:31 2010
New Revision: 98403

URL: http://llvm.org/viewvc/llvm-project?rev=98403&view=rev
Log:
Remove extra parameter.

Modified:
    llvm/trunk/include/llvm/Analysis/InlineCost.h
    llvm/trunk/lib/Analysis/InlineCost.cpp

Modified: llvm/trunk/include/llvm/Analysis/InlineCost.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/InlineCost.h?rev=98403&r1=98402&r2=98403&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/InlineCost.h (original)
+++ llvm/trunk/include/llvm/Analysis/InlineCost.h Fri Mar 12 18:45:31 2010
@@ -152,7 +152,7 @@
       /// CountCodeReductionForConstant - Figure out an approximation for how
       /// many instructions will be constant folded if the specified value is
       /// constant.
-      unsigned CountCodeReductionForConstant(Value *V, CodeMetrics &M);
+      unsigned CountCodeReductionForConstant(Value *V);
 
       /// CountCodeReductionForAlloca - Figure out an approximation of how much
       /// smaller the function will be if it is inlined into a context where an

Modified: llvm/trunk/lib/Analysis/InlineCost.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Analysis/InlineCost.cpp?rev=98403&r1=98402&r2=98403&view=diff
==============================================================================
--- llvm/trunk/lib/Analysis/InlineCost.cpp (original)
+++ llvm/trunk/lib/Analysis/InlineCost.cpp Fri Mar 12 18:45:31 2010
@@ -22,7 +22,7 @@
 // instructions will be constant folded if the specified value is constant.
 //
 unsigned InlineCostAnalyzer::FunctionInfo::
-CountCodeReductionForConstant(Value *V, CodeMetrics &Metrics) {
+CountCodeReductionForConstant(Value *V) {
   unsigned Reduction = 0;
   for (Value::use_iterator UI = V->use_begin(), E = V->use_end(); UI != E; ++UI)
     if (isa<BranchInst>(*UI) || isa<SwitchInst>(*UI)) {
@@ -71,7 +71,7 @@
 
         // And any other instructions that use it which become constants
         // themselves.
-        Reduction += CountCodeReductionForConstant(&Inst, Metrics);
+        Reduction += CountCodeReductionForConstant(&Inst);
       }
     }
 
@@ -242,9 +242,8 @@
   // code can be eliminated if one of the arguments is a constant.
   ArgumentWeights.reserve(F->arg_size());
   for (Function::arg_iterator I = F->arg_begin(), E = F->arg_end(); I != E; ++I)
-    ArgumentWeights.
-      push_back(ArgInfo(CountCodeReductionForConstant(I, Metrics),
-                        CountCodeReductionForAlloca(I)));
+    ArgumentWeights.push_back(ArgInfo(CountCodeReductionForConstant(I),
+                                      CountCodeReductionForAlloca(I)));
 }
 
 // getInlineCost - The heuristic used to determine if we should inline the





More information about the llvm-commits mailing list