[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
Thu Mar 18 11:53:58 PDT 2021


wmi added inline comments.


================
Comment at: llvm/test/Transforms/SampleProfile/norepeated-icp-3.ll:71
+; CHECK: ![[PROF_ID]] = !{!"VP", i32 0, i64 5860, i64 -7383239051784516332, i64 -1, i64 -7701940972712279918, i64 5860}
+!22 = !{!"VP", i32 0, i64 8000, i64 -7383239051784516332, i64 -1, i64 125292384912345234234, i64 8000}
----------------
hoy wrote:
> hoy wrote:
> > I'd like to understand a bit more about the counts here. In reality, is 8000 from prelink and 5860 from postlink? If the same profile is used, why different callees can be seen?
> Asking because the failing assert also fired with csspgo, where in postlink the same profile was retrieved differently due to adjusted top-down order in postlink that affects context Tri promotion.
One case is 8000 is from outline instance. After inlining, the indirect call get more precise profile 5860 from inline instance. There can be different set of callees in the value profile in the outline instance and in the inline instance. 

If it is the same profile applied differently to the same indirect call in csspgo, we should still drop all the existing values in the value profile except those with -1 count and apply the new values, like the patch currently does. 


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