[PATCH] D133121: [PGO] Annotate branch_weight for invoke instruction

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 7 09:12:10 PDT 2022


xur added a comment.

In D133121#3774764 <https://reviews.llvm.org/D133121#3774764>, @hoy wrote:

> In D133121#3774657 <https://reviews.llvm.org/D133121#3774657>, @xur wrote:
>
>> In D133121#3772956 <https://reviews.llvm.org/D133121#3772956>, @hoy wrote:
>>
>>> Thanks for the change. Wondering if you saw performance improvement with it.
>>>
>>> The corresponding change on the sample profile side isn't included, do you have any plan for it?
>>
>> Yes. For AutoFDO, we still need some change for the invoke in sampleloader
>> The situation is slightly different in AutoFDO. In FDO, we do branch_weight annotation first, then do the VP.
>>
>> In AutoFDO, we do VP annotation first  and then branch_weight annotation. We need to set the branch_weight metadata where there is already a VP metadata (which is the reverse of FDO).
>> I was planning to have a separated patch for AutoFDO, but I can also include it in this patch.
>
> A separate patch sounds good, thanks.

AutoFDO is less problematic as branch_weights metadata overwrites VP in the end. (and many VP metadata is already consumed by the prompting in preinliner).

In FDO, VP metadata overwrites branch_weights -- This is bad as we lost more information in BPI/BFI.
(branch_weights is more important for downstream opt).


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

https://reviews.llvm.org/D133121



More information about the llvm-commits mailing list