This is an archive of the discontinued LLVM Phabricator instance.

[PGO] Remove duplicate profile entries for functions with available_externally linkage
ClosedPublic

Authored by davidxl on Feb 26 2016, 12:32 PM.

Details

Summary

The per function data and counter variables for available externally functions are created with linkonce linkage (to prevent compiler from dropping counter vars). However on ELF based systems, linkonce symbols are created as weak symbols and the duplicated entries are not removed by the linker. For bad consequences it causes, see comments in the code. One example, the profile counts for _ZNKSs7_M_dataEv method is duplicated 655 times in raw profile data of clang. In the merged indexed profile, the counter values are magnified 655x -- totally dwarfed other functions -- this also distorted profile summary a lot leading to not useful profile data.

Diff Detail

Event Timeline

davidxl updated this revision to Diff 49222.Feb 26 2016, 12:32 PM
davidxl retitled this revision from to [PGO] Remove duplicate profile entries for functions with available_externally linkage .
davidxl updated this object.
davidxl added a reviewer: vsk.
davidxl added a subscriber: llvm-commits.
This revision was automatically updated to reflect the committed changes.