This is an archive of the discontinued LLVM Phabricator instance.

[PGO] refactor PGOFuncName meta data code to be used in clang
ClosedPublic

Authored by xur on Mar 30 2016, 2:26 PM.

Details

Summary

Refactor the code that gets and creates PGOFuncName meta data so that it can be used in clang's value profile annotation.

Diff Detail

Event Timeline

xur updated this revision to Diff 52123.Mar 30 2016, 2:26 PM
xur retitled this revision from to [PGO] refactor PGOFuncName meta data code to be used in clang.
xur updated this object.
xur added reviewers: davidxl, mehdi_amini.
xur added subscribers: llvm-commits, bogner, vsk, xur.
davidxl added inline comments.Mar 30 2016, 2:32 PM
include/llvm/ProfileData/InstrProf.h
250

clang-format it.

-->getPGOFuncNameMetaDataKind()

262

Not suitable for being an 'inline' function. Put the def in InstrProf.cpp.

xur updated this revision to Diff 52129.Mar 30 2016, 2:41 PM

Updated with David's comments.

vsk added a comment.Mar 30 2016, 2:50 PM

Thanks --

include/llvm/ProfileData/InstrProf.h
250

nit 1: MetaData -> Metadata, I'd prefer to preserve consistency with the existing naming convention.
nit 2: MetaDataKind -> MetadataName, since enum MetadataKind already exists, and this could cause confusion.

257

nit: "Write out" -> "Create"

xur updated this revision to Diff 52133.Mar 30 2016, 3:06 PM

Updated the patch with vsk@'s review comments.

Thanks!

-Rong

davidxl edited edge metadata.Mar 30 2016, 11:10 PM

sort the header file order properly.

include/llvm/ProfileData/InstrProf.h
258

apply to internal linkage functions declared by user only.

lib/ProfileData/InstrProf.cpp
102

In LTO mode or When InLTO is true

xur updated this revision to Diff 52229.Mar 31 2016, 9:47 AM
xur edited edge metadata.

More comments change suggested by David.

Thanks,

-Rong

davidxl accepted this revision.Mar 31 2016, 10:49 AM
davidxl edited edge metadata.

lgtm

The return value of createPGOFunctionMetadata is not used -- consider dropping it.

This revision is now accepted and ready to land.Mar 31 2016, 10:49 AM
xur updated this revision to Diff 52242.Mar 31 2016, 10:54 AM
xur edited edge metadata.

drop the return value of reatePGOFuncNameMetadata().

If I don't here other review comments, I'll commit ater today.

Thanks,

-Rong

This revision was automatically updated to reflect the committed changes.