OSDN Git Service

Remove cold callsite heuristic that is not necessary because of cold callee heuristic.
authorDehao Chen <dehao@google.com>
Fri, 5 Aug 2016 20:49:04 +0000 (20:49 +0000)
committerDehao Chen <dehao@google.com>
Fri, 5 Aug 2016 20:49:04 +0000 (20:49 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@277863 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/InlineCost.cpp

index 9f648df..eba905f 100644 (file)
@@ -640,13 +640,11 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
   }
 
   bool HotCallsite = false;
-  bool ColdCallsite = false;
   uint64_t TotalWeight;
-  if (CS.getInstruction()->extractProfTotalWeight(TotalWeight))
-    if (PSI->isHotCount(TotalWeight))
-      HotCallsite = true;
-    else if (PSI->isColdCount(TotalWeight))
-      ColdCallsite = true;
+  if (CS.getInstruction()->extractProfTotalWeight(TotalWeight) &&
+      PSI->isHotCount(TotalWeight)) {
+    HotCallsite = true;
+  }
 
   // Listen to the inlinehint attribute or profile based hotness information
   // when it would increase the threshold and the caller does not need to
@@ -666,7 +664,7 @@ void CallAnalyzer::updateThreshold(CallSite CS, Function &Callee) {
   // do not use the default cold threshold even if it is smaller.
   if ((DefaultInlineThreshold.getNumOccurrences() == 0 ||
        ColdThreshold.getNumOccurrences() > 0) &&
-      (ColdCallee || ColdCallsite) && ColdThreshold < Threshold)
+       ColdCallee && ColdThreshold < Threshold)
     Threshold = ColdThreshold;
 
   // Finally, take the target-specific inlining threshold multiplier into