This is an archive of the discontinued LLVM Phabricator instance.

[BOLT] Add fuzzy function name matching for LLVM LTO
ClosedPublic

Authored by maksfb on Apr 20 2022, 12:34 PM.

Details

Summary

LLVM with LTO can generate function names in the form
func.llvm.<number>, where <number> could vary based on the compilation
environment. As a result, if a profiled binary originated from a
different build than a corresponding binary used for BOLT optimization,
then profiles for such LTO functions will be ignored.

To fix the problem, use "fuzzy" matching with "func.llvm.*" form.

Diff Detail

Event Timeline

maksfb created this revision.Apr 20 2022, 12:34 PM
maksfb requested review of this revision.Apr 20 2022, 12:34 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 12:34 PM
Amir accepted this revision.Apr 20 2022, 12:48 PM

LG

BTW: is there any way to trigger these suffixes from source level test?

This revision is now accepted and ready to land.Apr 20 2022, 12:48 PM
maksfb updated this revision to Diff 424043.Apr 20 2022, 3:04 PM

Make the test more resilient to the system compiler/linker variations.

BTW: is there any way to trigger these suffixes from source level test?

There might be, but that would be way more involved and dependent on the compiler code gen.

yota9 accepted this revision.Apr 20 2022, 3:24 PM
This revision was automatically updated to reflect the committed changes.