OSDN Git Service

[ThinLTO] Don't re-analyze callee at same threshold unnecessarily
authorTeresa Johnson <tejohnson@google.com>
Wed, 11 May 2016 22:56:19 +0000 (22:56 +0000)
committerTeresa Johnson <tejohnson@google.com>
Wed, 11 May 2016 22:56:19 +0000 (22:56 +0000)
This should just be a compile-time change. Correct the check for whether
we have already analyzed the callee when making summary based decisions.
There is no need to reprocess one at the same threshold as when it was
last processed.

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

lib/Transforms/IPO/FunctionImport.cpp

index 498ce5e..a089f3c 100644 (file)
@@ -288,7 +288,7 @@ static void computeImportForFunction(
     /// Since the traversal of the call graph is DFS, we can revisit a function
     /// a second time with a higher threshold. In this case, it is added back to
     /// the worklist with the new threshold.
-    if (ProcessedThreshold && ProcessedThreshold > Threshold) {
+    if (ProcessedThreshold && ProcessedThreshold >= Threshold) {
       DEBUG(dbgs() << "ignored! Target was already seen with Threshold "
                    << ProcessedThreshold << "\n");
       continue;