diff --git a/lib/Transforms/Utils/InlineCost.cpp b/lib/Transforms/Utils/InlineCost.cpp index 37d2c0352ac..69cd9343f8c 100644 --- a/lib/Transforms/Utils/InlineCost.cpp +++ b/lib/Transforms/Utils/InlineCost.cpp @@ -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(II)) { - for (CallSite::arg_iterator I = CS.arg_begin(), E = CS.arg_end(); - I != E; ++I) - NumInsts ++; - } + // cost to reflect this. + if (!isa(II)) + NumInsts += 5; } if (const AllocaInst *AI = dyn_cast(II)) {