llvm-project/llvm/lib/Transforms/Utils
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
..
ASanStackFrameLayout.cpp [asan] Replace std::to_string with llvm::to_string 2016-10-19 00:16:56 +00:00
AddDiscriminators.cpp Use the last 7 bits to represent the discriminator to fit it in 1 byte ULEB128 (NFC). 2016-11-08 16:32:32 +00:00
BasicBlockUtils.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
BreakCriticalEdges.cpp [PM] Port BreakCriticalEdges to the new PM. 2016-07-22 18:04:25 +00:00
BuildLibCalls.cpp Recommitting r275284: add support to inline __builtin_mempcpy 2016-07-29 18:23:18 +00:00
BypassSlowDivision.cpp Don't leave unused divs/rems sitting around in BypassSlowDivision. 2016-10-28 21:43:54 +00:00
CMakeLists.txt Make the FunctionComparator of the MergeFunctions pass a stand-alone utility. 2016-11-11 21:15:13 +00:00
CloneFunction.cpp [CloneFunction] Don't remove unrelated nodes from the CGSSC 2016-08-19 16:37:40 +00:00
CloneModule.cpp Cloning: Also clone global variable attached metadata. 2016-10-26 02:57:33 +00:00
CmpInstAnalysis.cpp move decomposeBitTestICmp() to Transforms/Utils; NFC 2016-07-20 17:18:45 +00:00
CodeExtractor.cpp CodeExtractor : Add ability to preserve profile data. 2016-08-02 02:15:45 +00:00
CtorUtils.cpp [CtorUtils] Modernize. No functional changes intended. 2016-10-22 01:21:24 +00:00
DemoteRegToStack.cpp TransformUtils: Remove implicit ilist iterator conversions, NFC 2015-10-13 02:39:05 +00:00
Evaluator.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
FlattenCFG.cpp [FlattenCFG] Simplify + remove unused variable. NFCI. 2016-08-05 20:53:35 +00:00
FunctionComparator.cpp FunctionComparator: don't rely on argument evaluation order. 2016-11-11 22:21:39 +00:00
FunctionImportUtils.cpp [ThinLTO] Only promote exported locals as marked in index 2016-11-14 19:21:41 +00:00
GlobalStatus.cpp Merge two if conditions into one. NFCI. 2016-10-24 19:41:47 +00:00
ImportedFunctionsInliningStatistics.cpp Imported statistics types changes 2016-08-02 22:18:47 +00:00
InlineFunction.cpp Inliner: Don't mark swifterror allocas with lifetime markers 2016-09-09 22:40:27 +00:00
InstructionNamer.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
IntegerDivision.cpp TransformUtils: Avoid getNodePtrUnchecked() in integer division, NFC 2016-02-21 20:14:29 +00:00
LCSSA.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LLVMBuild.txt
LibCallsShrinkWrap.cpp [LibcallsShrinkWrap] This pass doesn't preserve the CFG. 2016-11-08 19:18:20 +00:00
Local.cpp DCE math library calls with a constant operand. 2016-11-02 20:48:11 +00:00
LoopSimplify.cpp [LCSSA] Implement linear algorithm for the isRecursivelyLCSSAForm 2016-10-11 13:37:22 +00:00
LoopUnroll.cpp [LoopUnroll] Keep the loop test only on the first iteration of max-or-zero loops 2016-10-21 11:08:48 +00:00
LoopUnrollRuntime.cpp Revert "[LoopUnroll] Properly update loop-info when cloning prologues and epilogues." 2016-09-08 03:51:30 +00:00
LoopUtils.cpp [LCSSA] Perform LCSSA verification only for the current loop nest. 2016-10-28 12:57:20 +00:00
LoopVersioning.cpp Rename LoopAccessAnalysis to LoopAccessLegacyAnalysis /NFC 2016-07-08 20:55:26 +00:00
LowerInvoke.cpp [PM] Port LowerInvoke to the new pass manager 2016-08-12 17:28:27 +00:00
LowerSwitch.cpp Use the range variant of remove_if instead of unpacking begin/end 2016-08-12 04:32:37 +00:00
Mem2Reg.cpp Consistently use FunctionAnalysisManager 2016-08-09 00:28:15 +00:00
MemorySSA.cpp [MemorySSA] Tighten up types to make our API prettier. NFC. 2016-11-01 21:17:46 +00:00
MetaRenamer.cpp
ModuleUtils.cpp Fix a typo. 2016-10-31 22:42:39 +00:00
NameAnonGlobals.cpp Use StringRef in Pass/PassManager APIs (NFC) 2016-10-01 02:56:57 +00:00
PromoteMemoryToRegister.cpp Reapplying r281895 (and follow-up r281964) after fixing pr30468. 2016-09-22 14:13:25 +00:00
SSAUpdater.cpp Use the range variant of find instead of unpacking begin/end 2016-08-11 22:21:41 +00:00
SanitizerStats.cpp Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes. 2016-01-26 18:48:36 +00:00
SimplifyCFG.cpp Ignore debug info when making optimization decisions in SimplifyCFG. 2016-10-17 19:28:44 +00:00
SimplifyIndVar.cpp [IndVars] Remove -liv-reduce 2016-06-05 18:01:12 +00:00
SimplifyInstructions.cpp Explicitly require DominatorTreeAnalysis pass for instsimplify pass. 2016-09-06 22:17:16 +00:00
SimplifyLibCalls.cpp Enable simplify libcalls for ARM PCS 2016-09-13 12:10:14 +00:00
SplitModule.cpp Move instances of std::function. 2016-06-12 16:13:55 +00:00
StripGCRelocates.cpp [StripGCRelocates] New pass to remove gc.relocates added by RS4GC 2016-10-21 18:43:16 +00:00
StripNonLineTableDebugInfo.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
SymbolRewriter.cpp [PM] Port SymbolRewriter to the new PM 2016-07-25 20:52:00 +00:00
UnifyFunctionExitNodes.cpp Apply clang-tidy's modernize-loop-convert to most of lib/Transforms. 2016-06-26 12:28:59 +00:00
Utils.cpp Add -strip-nonlinetable-debuginfo capability 2016-10-25 18:44:13 +00:00
ValueMapper.cpp Do a sweep over move ctors and remove those that are identical to the default. 2016-10-20 12:20:28 +00:00