This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Use ArrayRef in annotateValueSite()
ClosedPublic

Authored by xur on Mar 29 2016, 12:49 PM.

Details

Summary

Using ArrayRef in annotateValueSite's parameter instead of using an array and it's size. This is one of cleanups suggested by Sean Silva in http://reviews.llvm.org/D17864.

Diff Detail

Event Timeline

xur updated this revision to Diff 51964.Mar 29 2016, 12:49 PM
xur retitled this revision from to [PGO] Use ArrayRef in annotateValueSite().
xur updated this object.
xur added reviewers: silvas, davidxl.
xur added subscribers: xur, llvm-commits.
silvas edited edge metadata.Mar 29 2016, 12:57 PM

Thank! LGTM. A couple minor suggestions inline.

lib/ProfileData/InstrProf.cpp
631

Would VD be a better name instead of I?

unittests/ProfileData/InstrProfTest.cpp
334

I believe this can be just makeArrayRef(VD0Sorted).slice(2) without introducing the temporary or having to explicitly give a size.

xur updated this revision to Diff 51971.Mar 29 2016, 1:26 PM
xur edited edge metadata.

Sean, thanks for the quick review. Here is the updated patch.

Regards,

-Rong

xur marked 2 inline comments as done.Mar 29 2016, 1:27 PM
xur updated this revision to Diff 52011.Mar 29 2016, 5:04 PM

Justin, thanks for the suggestion. Attached is the updated patch.

silvas accepted this revision.Mar 29 2016, 5:48 PM
silvas edited edge metadata.

LGTM

This revision is now accepted and ready to land.Mar 29 2016, 5:48 PM
This revision was automatically updated to reflect the committed changes.