llvm-project/llvm/test/Transforms/PGOProfile
Fangrui Song e56626e438 [PGO] Move __profc_ and __profvp_ from their own comdat groups to __profd_'s comdat group
D68041 placed `__profc_`,  `__profd_` and (if exists) `__profvp_` in different comdat groups.
There are some issues:

* Cost: one or two additional section headers (`.group` section(s)): 64 or 128 bytes on ELF64.
* `__profc_`,  `__profd_` and (if exists) `__profvp_` should be retained or
  discarded. Placing them into separate comdat groups is conceptually inferior.
* If the prevailing group does not include `__profvp_` (value profiling not
  used) but a non-prevailing group from another translation unit has `__profvp_`
  (the function is inlined into another and triggers value profiling), there
  will be a stray `__profvp_` if --gc-sections is not enabled.
  This has been fixed by 3d6f53018f.

Actually, we can reuse an existing symbol (we choose `__profd_`) as the group
signature to avoid a string in the string table (the sole reason that D68041
could improve code size is that `__profv_` was an otherwise unused symbol which
wasted string table space). This saves one or two section headers.

For a -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_INSTRUMENTED=IR build, `ninja
clang lld`, the patch has saved 10.5MiB (2.2%) for the total .o size.

Reviewed By: davidxl

Differential Revision: https://reviews.llvm.org/D84723
2020-08-03 20:35:50 -07:00
..
Inputs [PGO] Include the mem ops into the function hash. 2020-07-30 09:26:20 -07:00
X86
PR28219.ll
PR41279.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
PR41279_2.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
branch1.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
branch2.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
callbr.ll [CallSite Removal] a CallBase is never an IndirectCall for isInlineAsm 2020-04-06 16:14:46 -07:00
chr.ll [SimplifyCFG][LoopRotate] SimplifyCFG: disable common instruction hoisting by default, enable late in pipeline 2020-07-29 20:05:30 +03:00
comdat_internal.ll [PGO] Move __profc_ and __profvp_ from their own comdat groups to __profd_'s comdat group 2020-08-03 20:35:50 -07:00
comdat_rename.ll
counter_promo.ll [PGO][InstrProf] Do not promote count if the exit blocks contains ret instruction 2020-07-24 17:38:31 -07:00
counter_promo_exit_catchswitch.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
counter_promo_exit_merge.ll
counter_promo_mexits.ll Revert "[InstrProfiling] Use !associated metadata for counters, data and values" 2020-06-10 02:32:50 -07:00
counter_promo_nest.ll
criticaledge.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
cspgo_profile_summary.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
diag_FE_profile.ll
diag_mismatch.ll
diag_no_funcprofdata.ll
diag_no_profile.ll
diag_no_value_sites.ll
do-not-instrument.ll
fix_entry_count.ll [PGO] Fix incorrect function entry count 2020-07-24 17:39:55 -07:00
func_entry.ll
icp_covariant_call_return.ll
icp_covariant_invoke_return.ll
icp_invoke.ll
icp_invoke_nouse.ll
icp_mismatch_msg.ll
icp_sample.ll
icp_vararg.ll
icp_vararg_sret.ll [PGO] CallPromotion: Don't try to pass sret args to varargs functions 2020-06-08 21:10:27 +02:00
indirect_call_annotation.ll
indirect_call_profile.ll
indirect_call_profile_funclet.ll
indirect_call_promotion.ll
indirect_call_promotion_byval.ll
indirect_call_promotion_musttail.ll [ICP] Handling must tail calls in indirect call promotion 2020-05-03 10:42:22 -07:00
indirect_call_promotion_vla.ll
indirectbr.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
infinite_loop.ll
infinite_loop_gen.ll
instr_entry_bb.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
irreducible.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
landingpad.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
large_count_remarks.ll
loop1.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
loop2.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
memcpy.ll [PGO] Extend the value profile buckets for mem op sizes. 2020-08-03 11:04:32 -07:00
memop_clone.ll
memop_hash.ll [PGO][test] Add test to check memops changes function hash 2020-07-31 09:43:29 -07:00
memop_profile_funclet.ll [PGO] Extend the value profile buckets for mem op sizes. 2020-08-03 11:04:32 -07:00
memop_size_annotation.ll [PGO] Guard the memcmp/bcmp size value profiling instrumentation behind flag. 2020-05-28 10:07:04 -07:00
memop_size_from_strlen.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
memop_size_opt.ll [PGO] Add memcmp/bcmp size value profiling. 2020-05-26 10:28:04 -07:00
memop_size_opt_zero.ll
misexpect-branch-correct.ll
misexpect-branch-stripped.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
misexpect-branch-unpredictable.ll
misexpect-branch.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
misexpect-switch-default.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
misexpect-switch.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
multiple_hash_profile.ll [PGO] Include the mem ops into the function hash. 2020-07-30 09:26:20 -07:00
noreturncall.ll
not_promote_ret_exit.ll [PGO][InstrProf] Do not promote count if the exit blocks contains ret instruction 2020-07-24 17:38:31 -07:00
preinline.ll
remap.ll
select1.ll
select2.ll
select_hash_conflict.ll
single_bb.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
split-indirectbr-critical-edges.ll
statics_counter_naming.ll
suppl-profile.ll Supplement instr profile with sample profile. 2020-07-27 20:17:40 -07:00
switch.ll [PGO] Remove insignificant function hash values from some tests. 2020-07-29 10:23:42 -07:00
thinlto_cspgo_gen.ll
thinlto_cspgo_use.ll [PGO] Supporting code for always instrumenting entry block 2020-07-22 15:01:53 -07:00
thinlto_indirect_call_promotion.ll
thinlto_samplepgo_icp.ll
thinlto_samplepgo_icp2.ll
thinlto_samplepgo_icp3.ll
thinlto_samplepgo_icp_droppeddead.ll
unreachable_bb.ll [ProfileSummary] Add the PartialProfileRatio field in ProfileSummary metadata. 2020-05-21 09:12:23 -07:00