llvm-project/llvm/lib/Transforms/IPO
Wei Mi 14756b70ee [SampleFDO] Don't mix up the existing indirect call value profile with the new
value profile annotated after inlining.

In https://reviews.llvm.org/D96806 and https://reviews.llvm.org/D97350, we
use the magic number -1 in the value profile to avoid repeated indirect call
promotion to the same target for an indirect call. Function updateIDTMetaData
is used to mark an target as being promoted in the value profile with the
magic number. updateIDTMetaData is also used to update the value profile
when an indirect call is inlined and new inline instance profile should be
applied. For the second case, currently updateIDTMetaData mixes up the
existing value profile of the indirect call with the new profile, leading
to the problematic senario that a target count is larger than the total count
in the value profile.

The patch fixes the problem. When updateIDTMetaData is used to update the
value profile after inlining, all the values in the existing value profile
will be dropped except the values with the magic number counts.

Differential Revision: https://reviews.llvm.org/D98835
2021-03-18 09:54:34 -07:00
..
AlwaysInliner.cpp [coroutine] should disable inline before calling coro split 2020-12-08 08:53:08 -08:00
Annotation2Metadata.cpp Add pass to add !annotate metadata from @llvm.global.annotations. 2020-11-16 14:57:11 +00:00
ArgumentPromotion.cpp [NFC][ArgumentPromotion] Clear FAM cached results of erased function. 2021-03-18 09:17:32 -07:00
Attributor.cpp [Attributor] Attributor call site specific AAValueConstantRange 2021-03-11 01:19:44 +03:00
AttributorAttributes.cpp [Attributor] Derive `willreturn` based on `mustprogress` 2021-03-11 23:31:44 -06:00
BarrierNoopPass.cpp
BlockExtractor.cpp [BlockExtract][NewPM] Port -extract-blocks to NPM 2020-10-21 12:51:11 -07:00
CMakeLists.txt [IRSim][IROutliner] Adding the extraction basics for the IROutliner. 2020-12-17 11:27:26 -06:00
CalledValuePropagation.cpp
ConstantMerge.cpp [Alignment][NFC] migrate DataLayout::getPreferredAlignment 2020-06-29 11:24:36 +00:00
CrossDSOCFI.cpp
DeadArgumentElimination.cpp Revert "[ObjC][ARC] Annotate calls with attributes instead of emitting retainRV" 2021-01-25 13:53:38 -08:00
ElimAvailExtern.cpp
ExtractGV.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
ForceFunctionAttrs.cpp Revert "[IR] add fn attr for no_stack_protector; prevent inlining on mismatch" 2020-11-17 17:27:14 -08:00
FunctionAttrs.cpp [IR] Move willReturn() to Instruction 2021-02-19 11:56:01 +01:00
FunctionImport.cpp [FunctionImport] Delete unneeded setLive. NFC 2021-03-06 14:09:54 -08:00
GlobalDCE.cpp
GlobalOpt.cpp collectUsedGlobalVariables: migrate SmallPtrSetImpl overload to SmallVecImpl overload after D97128 2021-02-23 16:09:06 -08:00
GlobalSplit.cpp
HotColdSplitting.cpp [Transforms/IPO] Use range-based for loops (NFC) 2021-02-03 20:41:20 -08:00
IPO.cpp [IRSim][IROutliner] Adding the extraction basics for the IROutliner. 2020-12-17 11:27:26 -06:00
IROutliner.cpp IROutliner.cpp - fix Wdocumentation warning. NFCI. 2021-02-05 11:38:09 +00:00
InferFunctionAttrs.cpp
InlineSimple.cpp Revert "Revert "[llvm][NFC] Cleanup uses of std::function in Inlining-related APIs"" 2020-05-15 12:29:16 -07:00
Inliner.cpp [NFC][Inliner] Debugging support to print funtion size after each inlining. 2021-03-14 22:11:53 -07:00
Internalize.cpp collectUsedGlobalVariables: migrate SmallPtrSetImpl overload to SmallVecImpl overload after D97128 2021-02-23 16:09:06 -08:00
LoopExtractor.cpp [LoopExtract][NewPM] Port -loop-extract to NPM 2020-10-13 22:55:42 -07:00
LowerTypeTests.cpp Fix unstable SmallPtrSet iteration issues due to collectUsedGlobalVariables 2021-02-23 16:09:05 -08:00
MergeFunctions.cpp [Transforms/IPO] Use range-based for loops (NFC) 2021-02-03 20:41:20 -08:00
OpenMPOpt.cpp [clang][OpenMP] Use OpenMPIRBuilder for workshare loops. 2021-03-04 22:52:59 -06:00
PartialInlining.cpp [Transforms/IPO] Use range-based for loops (NFC) 2021-02-03 20:41:20 -08:00
PassManagerBuilder.cpp [NPM] Add -enable-loopinterchange option to NPM 2021-03-07 02:39:28 +08:00
PruneEH.cpp [PruneEH][NFC] Use CallGraphUpdater in PruneEH 2020-09-14 14:43:19 -07:00
SCCP.cpp
SampleContextTracker.cpp [SampleFDO] Support enabling -funique-internal-linkage-name. 2021-03-09 21:41:40 -08:00
SampleProfile.cpp [SampleFDO] Don't mix up the existing indirect call value profile with the new 2021-03-18 09:54:34 -07:00
SampleProfileProbe.cpp [CSSPGO] Unblocking optimizations by dangling pseudo probes. 2021-03-03 22:44:42 -08:00
StripDeadPrototypes.cpp
StripSymbols.cpp [Transforms] Use range-based for loops (NFC) 2021-02-08 22:33:53 -08:00
SyntheticCountsPropagation.cpp [CallGraph] Add support for callback call sites 2020-07-01 13:44:11 -07:00
ThinLTOBitcodeWriter.cpp [ThinLTO] Make cloneUsedGlobalVariables deterministic 2021-02-23 16:09:05 -08:00
WholeProgramDevirt.cpp [WPD] Fix handling of pure virtual base class 2021-02-23 16:07:09 -08:00