Files
clang-p2996/llvm/test/tools/llvm-profgen/Inputs/profile-density-cs.raw.prof
wlei c2e08aba1a [llvm-profgen] Compute and show profile density
AutoFDO performance is sensitive to profile density, i.e., the amount of samples in the profile relative to the program size, because profiles with insufficient samples could be inaccurate due to statistical noise and thus hurt AutoFDO performance. A previous investigation showed that AutoFDO performed better on MySQL with increased amount of samples. Therefore, we implement a profile-density computation feature to give hints about profile density to users and the compiler.

We define the density of a profile Prof as follows:

- For each function A in the profile, density(A) = total_samples(A) / sizeof(A).
- density(Prof) = min(density(A)) for all functions A that are warm (defined below).

A function is considered warm if its total-samples is within top N percent of the profile. For implementation, we reuse the `ProfileSummaryBuilder::getHotCountThreshold(..)` as threshold which can be set by percent(`--profile-summary-cutoff-hot`) or by value(`--profile-summary-hot-count`).

We also introduce `--hot-function-density-threshold` to set hot function density threshold and will give suggestion if profile density is below it which implies we should increase samples.

This also applies for CS profile with all profiles merged into base.

Reviewed By: hoy, wenlei

Differential Revision: https://reviews.llvm.org/D113781
2021-11-29 23:54:31 -08:00

155 lines
2.1 KiB
Plaintext

[main]
8
810-82f:15
834-85c:15
870-870:1544
875-8a1:11
875-8bf:1223
875-8c3:185
893-8bf:176
8a7-8c3:13
5
82f->790:15
870->540:1546
8a1->810:15
8bf->870:2022
8c3->893:276
[partition_pivot_first]
10
710-72d:238
740-753:1
740-75b:739
740-75f:267
740-761:1164
743-753:12
743-75b:2414
743-761:793
755-75b:103
755-75f:115
3
753->770:13
75b->743:3327
75f->740:385
[partition_pivot_first:4.2 @ swap]
1
764-76e:2904
1
76e->740:2999
[partition_pivot_first:5 @ swap]
2
770-770:619
77a-783:619
0
[partition_pivot_last]
15
650-66d:206
650-675:182
682-689:164
686-689:193
6b0-6b7:18
6b0-6bf:2082
6b0-6c8:1180
6b0-6ca:683
6b9-6bf:170
6b9-6c8:92
6b9-6ca:62
6d0-6d3:2230
6e3-6ea:712
6e3-6ef:1518
6ec-6ef:667
8
66d->686:206
675->682:79
689->6b9:359
6b7->68b:18
6bf->6d0:2307
6c8->6b0:1300
6ca->6ec:755
6ea->6b0:724
[partition_pivot_last:5 @ swap]
3
677-67d:292
6d6-6df:3621
6f2-700:3528
1
700->6b0:3619
[partition_pivot_last:6 @ swap]
2
68b-68b:1124
695-69e:1124
0
[quick_sort]
4
790-79c:1273
7a6-7a6:1273
7a8-7b8:941
7bd-7ca:791
4
7a6->650:817
7a6->710:489
7b8->790:961
7ca->790:805
[quick_sort:2 @ partition_pivot_first]
12
710-72d:408
740-753:208
740-75b:463
740-75f:262
740-761:496
743-753:386
743-75b:1300
743-761:451
755-75b:283
755-75f:144
774-777:619
787-788:619
4
753->770:619
75b->743:2137
75f->740:427
788->7a8:646
[quick_sort:2 @ partition_pivot_last]
17
650-66d:295
650-675:517
682-689:528
686-689:307
68f-692:1124
6a2-6a2:1124
6b0-6b7:806
6b0-6bf:1093
6b0-6c8:935
6b0-6ca:351
6b9-6bf:226
6b9-6c8:273
6b9-6ca:81
6d0-6d3:1391
6e3-6ea:500
6e3-6ef:891
6ec-6ef:452
9
66d->686:307
675->682:340
689->6b9:580
6a2->7a8:1167
6b7->68b:834
6bf->6d0:1391
6c8->6b0:1263
6ca->6ec:452
6ea->6b0:518
[quick_sort:4 @ quick_sort]
6
790-792:831
790-79c:331
7a6-7a6:331
7a8-7b8:441
7bd-7ca:632
7d7-7d7:2029
6
792->7d7:853
7a6->650:248
7a6->710:103
7b8->790:462
7ca->790:661
7d7->7cf:2097