[PATCH] D96806: [SampleFDO] Stop repeated indirect call promotion for the same target
Wei Mi via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 18 09:47:38 PST 2021
wmi marked an inline comment as done.
wmi added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:1201
+ Pair.first->second = Data.Count;
+ else if (Total > Data.Count)
+ Total -= Data.Count;
----------------
wmi wrote:
> wenlei wrote:
> > In what case do we have Total < Data.Count? And Total == Data.Count should be fine for subtraction too?
> Currently we won't have such case. It is just some extra protect in case of future change. I think assertion will be better. Will change it.
>
> Right, Total == Data.Count should be added. will change it.
The assertion catches a case where we have Total < Data.Count when running the test test/Transforms/SampleProfile/csspgo-inline-icall.ll.
For CS profile, the sum computed in findIndirectCallFunctionSamples can be smaller than the sum of the target counts returned by findCallTargetMapAt. Is it expected?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96806/new/
https://reviews.llvm.org/D96806
More information about the llvm-commits
mailing list