Avoid pointless canonicalize when using Dwarf names
authorMark Santaniello <marksan@meta.com>
Thu, 25 May 2023 15:11:40 +0000 (08:11 -0700)
committerWenlei He <aktoon@gmail.com>
Thu, 25 May 2023 15:14:11 +0000 (08:14 -0700)
commit27c37327da67020f938aabf0f6405f57d688441e
treef5fe2c6cca31e1a4e2d2f9e8dc6b40df37c5ee3e
parent5ec360c58961379f29e8a69cb98c352412329f77
Avoid pointless canonicalize when using Dwarf names

CPU profile indicated memcmp was hot due to the two rfind calls in
getCanonicalFnName. If UseSymbolTable is false, we can avoid the cost entirely.

For CSSPGO profiles I've measured ~5% speedup with this change.

Profile similarity before/after matches 100%.

Reviewed By: wenlei

Differential Revision: https://reviews.llvm.org/D151441
llvm/tools/llvm-profgen/ProfiledBinary.cpp
llvm/tools/llvm-profgen/ProfiledBinary.h