This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Indirect-call profile annotation in IR level
ClosedPublic

Authored by xur on Feb 5 2016, 2:41 PM.

Details

Summary

This patch read the indirect call value records in the profile and make the annotation in the indirectcall instructions. This is for IR level instrumentation.

Thanks,

-Rong

Diff Detail

Event Timeline

xur updated this revision to Diff 47051.Feb 5 2016, 2:41 PM
xur retitled this revision from to [PGO] Indirect-call profile annotation in IR level.
xur updated this object.
xur added reviewers: davidxl, silvas, bogner, betulb, ivanbaev.
xur added a subscriber: llvm-commits.
davidxl added inline comments.Feb 5 2016, 2:53 PM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
469

nit: ProfileRecords --> ProfileRecord

571

Seems a unnecessary change.

xur updated this revision to Diff 47059.Feb 5 2016, 3:14 PM
xur marked 2 inline comments as done.

Integrated David's comments

betulb edited edge metadata.Feb 9 2016, 2:34 PM

Looks fine to me except a naming nit.

lib/Transforms/Instrumentation/PGOInstrumentation.cpp
733

NumTargets -> NumValueSites.

davidxl added inline comments.Feb 9 2016, 2:41 PM
lib/Transforms/Instrumentation/PGOInstrumentation.cpp
734

Better check ICV's number of icall instructions matches the number of NumValueSites. If not give warning and return.

xur updated this revision to Diff 47388.Feb 9 2016, 3:42 PM
xur edited edge metadata.
xur marked 2 inline comments as done.

Integrated with Betul and David's review comments.

Thanks,

-Rong

davidxl accepted this revision.Feb 9 2016, 3:44 PM
davidxl edited edge metadata.

lgtm

This revision is now accepted and ready to land.Feb 9 2016, 3:44 PM
This revision was automatically updated to reflect the committed changes.