[PATCH] D30754: SamplePGO ThinLTO ICP fix for local functions.

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Mar 9 09:23:40 PST 2017


tejohnson added a comment.

> In SamplePGO, if the profile is collected from non-LTO binary, and used to drive ThinLTO, the indirect call promotion may fail because the function name will mismatch as ThinLTO added module ID in the local function name. This patch tries at the best effort to find the GUID from the unpromoted local function name (in profile), and use that in ICP promotion.

Want to clarify what the situation is that we're trying to fix here. The function name used to compute the GUID in the index for ThinLTO for functions with local linkage is 'SourceFilePath + ":" + FunctionName'. I'm not sure how collecting on a non-LTO binary matters here. Note that ThinLTO will sometimes promote local functions to global scope and rename them, but that is a completely different naming scheme, and is done in the ThinLTO Backends ('FunctionName + ".llvm." + ModuleHash').

Normally the PGOFunctionName used in profiles for indirect call targets (at least with instrumentation FDO) is the same 'SourceFilePath + ":" + FunctionName'., so the GUID computed for ThinLTO is the same as the GUID in the profile metadata for the hot targets. Is that not the case for AutoFDO indirect call targets?


https://reviews.llvm.org/D30754





More information about the llvm-commits mailing list