Build SymbolMap in SampleProfileLoader to help matchin function names with suffix.
authorDehao Chen <dehao@google.com>
Mon, 17 Apr 2017 22:23:05 +0000 (22:23 +0000)
committerDehao Chen <dehao@google.com>
Mon, 17 Apr 2017 22:23:05 +0000 (22:23 +0000)
commit1ea8bd81096b42830bb4f20c891f5a34af385de6
treeb806b1f95e312f306d3e3873c2479fb7811ade21
parent68f82a31d33beca9f276cca580cb3e96c7a4d6af
Build SymbolMap in SampleProfileLoader to help matchin function names with suffix.

Summary: If there is suffix added in the function name (e.g. module hash added by thinLTO), we will not be able to find a match in profile as the suffix does not exist in profile. This patch build a map from function name to Function *. The map includes the entry for the stripped function name so that inlineHotFunctions can find the corresponding function to promote/inline.

Reviewers: davidxl, dnovillo, tejohnson

Reviewed By: davidxl

Subscribers: mehdi_amini, llvm-commits

Differential Revision: https://reviews.llvm.org/D31952

llvm-svn: 300507
llvm/lib/Transforms/IPO/SampleProfile.cpp
llvm/test/Transforms/SampleProfile/Inputs/indirect-call.prof
llvm/test/Transforms/SampleProfile/indirect-call.ll