llvm-project/llvm/test/Transforms/SampleProfile
Wei Mi c67ccf5faf [SampleFDO] Enhance profile remapping support for searching inline instance
and indirect call promotion candidate.

Profile remapping is a feature to match a function in the module with its
profile in sample profile if the function name and the name in profile look
different but are equivalent using given remapping rules. This is a useful
feature to keep the performance stable by specifying some remapping rules
when sampleFDO targets are going through some large scale function signature
change.

However, currently profile remapping support is only valid for outline
function profile in SampleFDO. It cannot match a callee with an inline
instance profile if they have different but equivalent names. We found
that without the support for inline instance profile, remapping is less
effective for some large scale change.

To add that support, before any remapping lookup happens, all the names
in the profile will be inserted into remapper and the Key to the name
mapping will be recorded in a map called NameMap in the remapper. During
name lookup, a Key will be returned for the given name and it will be used
to extract an equivalent name in the profile from NameMap. So with the help
of the NameMap, we can translate any given name to an equivalent name in
the profile if it exists. Whenever we try to match a name in the module to
a name in the profile, we will try the match with the original name first,
and if it doesn't match, we will use the equivalent name got from remapper
to try the match for another time. In this way, the patch can enhance the
profile remapping support for searching inline instance and searching
indirect call promotion candidate.

In a planned large scale change of int64 type (long long) to int64_t (long),
we found the performance of a google internal benchmark degraded by 2% if
nothing was done. If existing profile remapping was enabled, the performance
degradation dropped to 1.2%. If the profile remapping with the current patch
was enabled, the performance degradation further dropped to 0.14% (Note the
experiment was done before searching indirect call promotion candidate was
added. We hope with the remapping support of searching indirect call promotion
candidate, the degradation can drop to 0% in the end. It will be evaluated
post commit).

Differential Revision: https://reviews.llvm.org/D86332
2020-08-26 11:07:35 -07:00
..
Inputs [SampleFDO] Enhance profile remapping support for searching inline instance 2020-08-26 11:07:35 -07:00
branch.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
calls.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
cold-indirect-call.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
compressed-profile-symbol-list.ll
cov-zero-samples.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
coverage-warning.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
discriminator.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
early-inline.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
entry_counts.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
entry_counts_cold.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
entry_counts_missing_dbginfo.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
flattened.ll
fnptr.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
function_metadata.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
gcc-simple.ll [gcov] Delete XFAIL: host-byteorder-big-endian 2020-06-03 19:58:28 -07:00
indirect-call-gcc.ll [gcov] Delete XFAIL: host-byteorder-big-endian 2020-06-03 19:58:28 -07:00
indirect-call.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-act.ll
inline-callee-update.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-cold-callsite-samplepgo.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-cold.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-combine.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-coverage.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-mergeprof-dup.ll [AutoFDO] Avoid merging inlinee samples multiple times 2020-07-31 09:30:05 -07:00
inline-mergeprof.ll Fix a crash when the sample profile uses md5 and -sample-profile-merge-inlinee 2020-07-30 21:21:06 -07:00
inline-replay.ll [InlineAdvisor] New inliner advisor to replay inlining from optimization remarks 2020-08-15 20:17:21 -07:00
inline-stats.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
inline-topdown.ll [SampleFDO] Enable sample-profile-top-down-load and sample-profile-merge-inlinee 2020-07-08 09:23:18 -07:00
inline.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
nodebug-error.ll [SampleFDO] Stop letting findCalleeFunctionSamples return unrelated profiles 2020-08-10 12:41:09 -07:00
nodebug.ll
nolocinfo.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
offset.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
profile-format-compress.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
profile-format.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
profile-sample-accurate.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
propagate.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
remap-2.ll [SampleFDO] Enhance profile remapping support for searching inline instance 2020-08-26 11:07:35 -07:00
remap.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
remarks.ll [Remarks] Add callsite locations to inline remarks 2020-06-20 23:32:10 -07:00
section-accurate-samplepgo.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
summary.ll
syntax.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
uncompressed-profile-symbol-list.ll
use-sample-profile-attr.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00
warm-inline-instance.ll [SampleFDO] Add use-sample-profile function attribute. 2020-06-02 17:23:17 -07:00