diff options
| author | Teresa Johnson <tejohnson@google.com> | 2018-11-06 19:41:35 +0000 | 
|---|---|---|
| committer | Teresa Johnson <tejohnson@google.com> | 2018-11-06 19:41:35 +0000 | 
| commit | cb397461e1b5d99072931a309cc8903faac6db26 (patch) | |
| tree | 6c1666bef906e0da6128ad8169a6fc06709de100 /llvm/lib/Transforms/IPO | |
| parent | d768ecf5a7a88c5ea7dc7201447742e9c8624b3b (diff) | |
| download | bcm5719-llvm-cb397461e1b5d99072931a309cc8903faac6db26.tar.gz bcm5719-llvm-cb397461e1b5d99072931a309cc8903faac6db26.zip  | |
[ThinLTO] Split NotEligibleToImport into legality and inlinability flags
Summary:
The NotEligibleToImport flag on the GlobalValueSummary was set if it
isn't legal to import (e.g. because it references unpromotable locals)
and when it can't be inlined (in which case importing is pointless).
I split out the inlinable piece into a separate flag on the
FunctionSummary (doesn't make sense for aliases or global variables),
because in the future we may want to import for reasons other than
inlining.
Reviewers: davidxl
Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, arphaman, llvm-commits
Differential Revision: https://reviews.llvm.org/D53345
llvm-svn: 346261
Diffstat (limited to 'llvm/lib/Transforms/IPO')
| -rw-r--r-- | llvm/lib/Transforms/IPO/FunctionImport.cpp | 10 | 
1 files changed, 10 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/IPO/FunctionImport.cpp b/llvm/lib/Transforms/IPO/FunctionImport.cpp index 16a3d112b29..31531beea5e 100644 --- a/llvm/lib/Transforms/IPO/FunctionImport.cpp +++ b/llvm/lib/Transforms/IPO/FunctionImport.cpp @@ -237,11 +237,19 @@ selectCallee(const ModuleSummaryIndex &Index,            return false;          } +        // Skip if it isn't legal to import (e.g. may reference unpromotable +        // locals).          if (Summary->notEligibleToImport()) {            Reason = FunctionImporter::ImportFailureReason::NotEligible;            return false;          } +        // Don't bother importing if we can't inline it anyway. +        if (Summary->fflags().NoInline) { +          Reason = FunctionImporter::ImportFailureReason::NoInline; +          return false; +        } +          return true;        });    if (It == CalleeSummaryList.end()) @@ -318,6 +326,8 @@ getFailureName(FunctionImporter::ImportFailureReason Reason) {      return "LocalLinkageNotInModule";    case FunctionImporter::ImportFailureReason::NotEligible:      return "NotEligible"; +  case FunctionImporter::ImportFailureReason::NoInline: +    return "NoInline";    }    llvm_unreachable("invalid reason");  }  | 

