This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Add another interface for annotateValueSite
ClosedPublic

Authored by xur on Feb 10 2016, 3:30 PM.

Details

Summary

Add another interface to function annotateValueSite() which directly uses the VauleData array. This is needed in indirect-call promotion where un-promoted valuedata needs to be updated in the MD.prof meta data.

Diff Detail

Repository
rL LLVM

Event Timeline

xur updated this revision to Diff 47552.Feb 10 2016, 3:30 PM
xur retitled this revision from to [PGO] Add another interface for annotateValueSite.
xur updated this object.
xur added a reviewer: davidxl.
xur added a subscriber: llvm-commits.
davidxl edited edge metadata.Feb 10 2016, 9:16 PM

What is main reason/need for vp data update after the transformation?

xur added a comment.Feb 11 2016, 9:05 AM

my indirect-call promotion implementation supports multiple targets (specified the by an option) for a single callsite and the transformation pass can be called multiple times. The promotion stops at the first non-promoted direct target (as it's sorted on the count).

For example, for a callsite with the the following valuedata {<func1, 100> <func2, 80> <func3,10>}, after we promote func1 and cannot promote func2, I will attach {<func2, 80> <func3, 10>} to the indirect-call instruction.

See also discussions in review D17115.

David

davidxl accepted this revision.Feb 12 2016, 8:42 AM
davidxl edited edge metadata.

Aside from how transformation should be done, I think annotating the remaining indirect call with the right meta data after the transformation is the right thing to do, and the information can be used for later optimizations (such as function layout based on dyn call graph).

LGTM.

This revision is now accepted and ready to land.Feb 12 2016, 8:42 AM
This revision was automatically updated to reflect the committed changes.