[PATCH] D148876: [IndirectCallPromotion] Clear value profile metadata after the last run of indirect-call-promotion in a pipeline

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 21 14:11:08 PDT 2023

hoy added a comment.

In D148876#4288504 <https://reviews.llvm.org/D148876#4288504>, @mingmingl wrote:

> In D148876#4288286 <https://reviews.llvm.org/D148876#4288286>, @tejohnson wrote:
>> Would be good to explain motivation (maybe reference other patch?)
> Makes sense, will do.
>> Also, the new tests only test the behavior with the internal option. It would be good to have tests with various pipelines to check the logic on when it gets cleared in those different cases simply based on the new pipeline logic.
> I see your point. I'm going to write a test like https://github.com/llvm/llvm-project/blob/main/llvm/test/Other/new-pm-thinlto-postlink-pgo-defaults.ll to test pipeline logic.
> In D148876#4288429 <https://reviews.llvm.org/D148876#4288429>, @wenlei wrote:
>> cc @hoy to make sure this works for csspgo.
> thanks! The assumption here is that ICP runs once per pipeline and there are no other passes that uses value-profiles. If the assumption doesn't hold, I'm thinking about an explicit boolean in ICP pass constructor (which makes pipeline logic a little bit more complex)

Value profiles for indirect call sites can still be used by lld call graph sorting after ICP. Please see https://github.com/llvm/llvm-project/blob/26202a57e5e78b5473ef657737d181f0a68ed56d/llvm/lib/Transforms/Instrumentation/CGProfile.cpp#L81

  rG LLVM Github Monorepo



More information about the llvm-commits mailing list