llvm-project/llvm/lib/Transforms/IPO
Teresa Johnson 4fef68cb8d [ThinLTO] Only promote exported locals as marked in index
Summary:
We have always speculatively promoted all renamable local values
(except const non-address taken variables) for both the exporting
and importing module. We would then internalize them back based on
the ThinLink results if they weren't actually exported. This is
inefficient, and results in unnecessary renames. It also meant we
had to check the non-renamability of a value in the summary, which
was already checked during function importing analysis in the ThinLink.

Made renameModuleForThinLTO (which does the promotion/renaming) instead
use the index when exporting, to avoid unnecessary renames/promotions.
For importing modules, we can simply promoted all values as any local
we import by definition is exported and needs promotion.

This required changes to the method used by the FunctionImport pass
(only invoked from 'opt' for testing) and when invoked from llvm-link,
since neither does a ThinLink. We simply conservatively mark all locals
in the index as promoted, which preserves the current aggressive
promotion behavior.

I also needed to change an llvm-lto based test where we had previously
been aggressively promoting values that weren't importable (aliasees),
but now will not promote.

Reviewers: mehdi_amini

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D26467

llvm-svn: 286871
2016-11-14 19:21:41 +00:00
..
AlwaysInliner.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ArgumentPromotion.cpp Fix typo in comment. NFC. 2016-11-08 19:10:25 +00:00
BarrierNoopPass.cpp Revert r240137 (Fixed/added namespace ending comments using clang-tidy. NFC) 2015-06-23 09:49:53 +00:00
CMakeLists.txt [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
ConstantMerge.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
CrossDSOCFI.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
DeadArgumentElimination.cpp DeadArgElim: Don't mark swifterror arguments as unused 2016-09-21 15:29:08 +00:00
ElimAvailExtern.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
ExtractGV.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
ForceFunctionAttrs.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
FunctionAttrs.cpp Fix 80-column violations. NFC. 2016-11-07 16:28:04 +00:00
FunctionImport.cpp [ThinLTO] Only promote exported locals as marked in index 2016-11-14 19:21:41 +00:00
GlobalDCE.cpp GlobalDCE: Restore a statement accidentally removed in r285048. 2016-10-25 02:57:27 +00:00
GlobalOpt.cpp [GlobalOpt] Dead Eliminate declarations 2016-09-15 20:26:27 +00:00
IPConstantPropagation.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IPO.cpp [PM] Port the always inliner to the new pass manager in a much more 2016-08-17 02:56:20 +00:00
InferFunctionAttrs.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
InlineSimple.cpp Add a new method to create SimpleInliner instance and make pre-inliner use this. 2016-08-11 18:24:08 +00:00
Inliner.cpp Fix typo 2016-11-04 03:00:52 +00:00
Internalize.cpp Consistently use ModuleAnalysisManager 2016-08-09 00:28:38 +00:00
LLVMBuild.txt [PGO] Passmanagerbuilder change that enable IR level PGO instrumentation 2016-01-21 18:28:59 +00:00
LoopExtractor.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
LowerTypeTests.cpp [cfi] Fix weak functions handling. 2016-11-11 21:39:26 +00:00
MergeFunctions.cpp Make the FunctionComparator of the MergeFunctions pass a stand-alone utility. 2016-11-11 21:15:13 +00:00
PartialInlining.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
PassManagerBuilder.cpp Add comments about why we put LoopSink pass at the very late stage. 2016-11-10 17:42:18 +00:00
PruneEH.cpp [PruneEH] Be correct in the face IPO 2016-10-03 19:35:30 +00:00
SampleProfile.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
StripDeadPrototypes.cpp [PM] Remove support for omitting the AnalysisManager argument to new 2016-06-17 00:11:01 +00:00
StripSymbols.cpp Don't create a SymbolTable in Function when the LLVMContext discards value names (NFC) 2016-09-17 06:00:02 +00:00
WholeProgramDevirt.cpp Shorten DiagnosticInfoOptimizationRemark* to OptimizationRemark*. NFC 2016-09-27 22:19:23 +00:00