llvm-project/llvm/lib/Transforms/IPO
Wei Mi 5f7e822dc7 [SampleFDO] Minimize performance impact when profile-sample-accurate
is enabled.

We can save memory and reduce binary size significantly by enabling
ProfileSampleAccurate. However when ProfileSampleAccurate is true,
function without sample will be regarded as cold and this could
potentially cause performance regression.

To minimize the potential negative performance impact, we want to be
a little conservative here saying if a function shows up in the profile,
no matter as outline instance, inline instance or call targets, treat
the function as not being cold. This will handle the cases such as most
callsites of a function are inlined in sampled binary (thus outline copy
don't get any sample) but not inlined in current build (because of source
code drift, imprecise debug information, or the callsites are all cold
individually but not cold accumulatively...), so that the outline function
showing up as cold in sampled binary will actually not be cold after current
build. After the change, such function will be treated as not cold even
profile-sample-accurate is enabled.

At the same time we lower the hot criteria of callsiteIsHot check when
profile-sample-accurate is enabled. callsiteIsHot is used to determined
whether a callsite is hot and qualified for early inlining. When
profile-sample-accurate is enabled, functions without profile will be
regarded as cold and much less inlining will happen in CGSCC inlining pass,
so we can worry less about size increase and be aggressive to allow more
early inlining to happen for warm callsites and it is helpful for performance
overall.

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

llvm-svn: 372232
2019-09-18 16:06:28 +00:00
..
AlwaysInliner.cpp [clang][NewPM] Fix broken -O0 test from missing assumptions 2019-06-13 18:18:40 +00:00
ArgumentPromotion.cpp OpaquePtr: add Type parameter to Loads analysis API. 2019-07-09 11:35:35 +00:00
Attributor.cpp Hide implementation details in namespaces. 2019-09-17 12:56:29 +00:00
BarrierNoopPass.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
BlockExtractor.cpp [BlockExtractor] Avoid assert with wrong line format 2019-08-20 14:46:02 +00:00
CMakeLists.txt [Attributor] Pass infrastructure and fixpoint framework 2019-06-05 03:02:24 +00:00
CalledValuePropagation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ConstantMerge.cpp IR. Change strip* family of functions to not look through aliases. 2019-08-22 19:56:14 +00:00
CrossDSOCFI.cpp cfi-icall: Allow the jump table to be optionally made non-canonical. 2019-08-09 22:31:59 +00:00
DeadArgumentElimination.cpp [opaque pointer types] Pass function types to CallInst creation. 2019-02-01 20:43:25 +00:00
ElimAvailExtern.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ExtractGV.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ForceFunctionAttrs.cpp ARM MTE stack sanitizer. 2019-07-15 20:02:23 +00:00
FunctionAttrs.cpp LLVM: Optimization Pass: Remove conflicting attribute, if any, before 2019-09-11 14:26:22 +00:00
FunctionImport.cpp [ThinLTO] Fix handling of weak interposable symbols 2019-08-23 15:18:58 +00:00
GlobalDCE.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
GlobalOpt.cpp Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
GlobalSplit.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
HotColdSplitting.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
IPConstantPropagation.cpp [IPCP] Don't crash due to arg count/type mismatch between caller/callee 2019-01-29 10:19:44 +00:00
IPO.cpp [LLVM-C] Improve Bindings to The Internalize Pass 2019-07-23 04:56:44 +00:00
InferFunctionAttrs.cpp Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
InlineSimple.cpp [CallSite removal] move InlineCost to CallBase usage 2019-04-23 12:43:27 +00:00
Inliner.cpp Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
Internalize.cpp [Internalize] Replace uses of std::set with DenseSet 2019-04-02 09:25:31 +00:00
LLVMBuild.txt Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
LoopExtractor.cpp [CodeExtractor] Update function's assumption cache after extracting blocks from it 2019-02-08 06:55:18 +00:00
LowerTypeTests.cpp cfi-icall: Allow the jump table to be optionally made non-canonical. 2019-08-09 22:31:59 +00:00
MergeFunctions.cpp Use llvm::stable_sort 2019-04-23 14:51:27 +00:00
PartialInlining.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
PassManagerBuilder.cpp Revert "Reland "r364412 [ExpandMemCmp][MergeICmps] Move passes out of CodeGen into opt pipeline."" 2019-09-10 10:39:09 +00:00
PruneEH.cpp [CallSite removal] Move the legacy PM, call graph, and some inliner 2019-04-19 05:59:42 +00:00
SCCP.cpp Change TargetLibraryInfo analysis passes to always require Function 2019-09-07 03:09:36 +00:00
SampleProfile.cpp [SampleFDO] Minimize performance impact when profile-sample-accurate 2019-09-18 16:06:28 +00:00
StripDeadPrototypes.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
StripSymbols.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
SyntheticCountsPropagation.cpp Update the file headers across all of the LLVM projects in the monorepo 2019-01-19 08:50:56 +00:00
ThinLTOBitcodeWriter.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00
WholeProgramDevirt.cpp [llvm] Migrate llvm::make_unique to std::make_unique 2019-08-15 15:54:37 +00:00