[PATCH] D25963: [LoopUnroll] Implement profile-based loop peeling

Xinliang David Li via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 15 16:53:16 PST 2016


We should probably just remove the adjustment here.
1) for IR based instrumentation (-fprofile-generate/-fprofile-use), the
profile annotator does not add 1 to with branch weight when annotating the
branch, so do the 'reverse' here would be wrong for IR based PGO
2) for FE based instrumentation
(-fprofile-instr-generate/-fpofile-instr-use), the weight does get adjusted
(by adding 1 to both targets of the branch). For loops that execute only
once, the estimated trip count would be wrong without adjustment. However
the belief is that hot loops usually will be executed/entered many times,
so the impact of this to trip count estimation will be small.
I also believe that longer term, PGO users for perfromance will shift to 1)
while 2) is for coverage testing, so we making the estimation for 1)
correct is the right thing to do.

David

On Tue, Nov 15, 2016 at 4:42 PM, Adam Nemet <anemet at apple.com> wrote:

> anemet added a comment.
>
> In https://reviews.llvm.org/D25963#596582, @mkuper wrote:
>
> > Thanks, Adam!
> >  I'll fix the cosmetics, but I'm still not sure what to do about the
> branch weight adjustments.
>
>
> Wasn't @davidxl working on fixing them?
>
>
> https://reviews.llvm.org/D25963
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161115/b630da11/attachment.html>


More information about the llvm-commits mailing list