Remove premature optimization that avoided calculating argument weights
authorEric Christopher <echristo@apple.com>
Sun, 6 Feb 2011 21:27:46 +0000 (21:27 +0000)
committerEric Christopher <echristo@apple.com>
Sun, 6 Feb 2011 21:27:46 +0000 (21:27 +0000)
if we weren't going to inline the function. The rest of the code using
this was removed.

Fixes PR9154.

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

lib/Analysis/InlineCost.cpp

index 58f38afc6e909c5939fbd9dcd981c787dcc76e16..47f91cfc3bedb6100b7f863a47773aada8d74937 100644 (file)
@@ -242,11 +242,6 @@ void InlineCostAnalyzer::FunctionInfo::analyzeFunction(Function *F) {
   if (Metrics.NumRets==1)
     --Metrics.NumInsts;
 
-  // Don't bother calculating argument weights if we are never going to inline
-  // the function anyway.
-  if (NeverInline())
-    return;
-
   // Check out all of the arguments to the function, figuring out how much
   // code can be eliminated if one of the arguments is a constant.
   ArgumentWeights.reserve(F->arg_size());