[PATCH] D98835: [SampleFDO] Don't mix up the existing indirect call value profile with the new value profile annotated after inlining.
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 17 22:47:43 PDT 2021
wmi added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:772
if (Valid) {
- for (uint32_t I = 0; I < NumVals; I++)
+ for (uint32_t I = 0; I < NumVals; I++) {
+ // If the given Sum is not 0, the existing values with count
----------------
davidxl wrote:
> The logic seems clearer if the handling is specialized for sum == 0 and != 0 case:
>
> if (sum == 0) {
> } else {
> // iniitlaize value count map with already promoted targets.
> ....
>
> }
Very good suggestion. I try it and it looks clearer indeed.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D98835/new/
https://reviews.llvm.org/D98835
More information about the llvm-commits
mailing list