Revert previous change; even this mild and clearly
authorDale Johannesen <dalej@apple.com>
Sat, 24 Jan 2009 21:49:34 +0000 (21:49 +0000)
committerDale Johannesen <dalej@apple.com>
Sat, 24 Jan 2009 21:49:34 +0000 (21:49 +0000)
more accurate change loses more than it gains on
benchmarks.

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

lib/Transforms/Utils/InlineCost.cpp

index 37d2c0352aced657671422157cc12ecc25e0d238..69cd9343f8c7d712e1868dc8e62201cc58460ee4 100644 (file)
@@ -119,14 +119,11 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
             NeverInline = true;
             return;
           }
-        
+
         // Calls often compile into many machine instructions.  Bump up their
-        // cost to reflect this.  Allow an extra instruction per parameter.
-        if (!isa<IntrinsicInst>(II)) {
-          for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end();
-               I != E; ++I)
-            NumInsts ++;
-        }
+        // cost to reflect this.
+        if (!isa<IntrinsicInst>(II))
+          NumInsts += 5;
       }
       
       if (const AllocaInst *AI = dyn_cast<AllocaInst>(II)) {