[PATCH] D99787: [CSSPGO] Fix incorrect probe distribution factor computation in top-down inliner

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 5 15:20:22 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/lib/Transforms/IPO/SampleProfile.cpp:875
       // be prorated so that the it will reflect the real callsite counts.
-      setProbeDistributionFactor(CI, Candidate.CallsiteDistribution * Sum /
-                                         SumOrigin);
+      setProbeDistributionFactor(CI, 1.0 * Sum / SumOrigin);
       Candidate.CallInstr = DI;
----------------
hoy wrote:
> hoy wrote:
> > hoy wrote:
> > > Thanks for the fix. This seems losing the original distribution factor pre
> > nvm, ignore this comment.
> Nit: may just do a type casting here instead of using the multiplication. The compiler may not optimize it away in different FP models.
+1 for explicit casting


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D99787/new/

https://reviews.llvm.org/D99787



More information about the llvm-commits mailing list