[PATCH] D97350: [SampleFDO] Another fix to prevent repeated indirect call promotion in sample loader pass
Hongtao Yu via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Mar 3 18:07:11 PST 2021
hoy added inline comments.
================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:769
+ if (Pair.first->second != NOMORE_ICP_MAGICNUM &&
+ Data.Count == NOMORE_ICP_MAGICNUM) {
+ OldSum -= Pair.first->second;
----------------
IIUC, `Data` is from profile, why can it be -1?
================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:762
+ Data.Count != NOMORE_ICP_MAGICNUM) {
+ Sum -= Data.Count;
+ } else if (Pair.first->second != NOMORE_ICP_MAGICNUM &&
----------------
wmi wrote:
> davidxl wrote:
> > can it become negative?
> It won't. Sum is got by adding up the counts of all the targets so it should never be less than Data.Count. I add an assertion for it.
Looks like `Sum` could be zero in one of the callsites of `updateIDTMetaData` where no value is passed and the default value 0 is used.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97350/new/
https://reviews.llvm.org/D97350
More information about the llvm-commits
mailing list