Tolerate unmangled names in sample profiles.
authorDiego Novillo <dnovillo@google.com>
Tue, 18 Mar 2014 12:03:12 +0000 (12:03 +0000)
committerDiego Novillo <dnovillo@google.com>
Tue, 18 Mar 2014 12:03:12 +0000 (12:03 +0000)
commitc605296342c38e16799a70d2a0dc0b4018a20f31
tree5fe4b245a1e2aade3e09ae8028089503314f20bc
parent8a99824c5a1eddb6f298163f0c1068d025fab6f6
Tolerate unmangled names in sample profiles.

Summary:
The compiler does not always generate linkage names. If a function
has been inlined and its body elided, its linkage name may not be
generated.

When the binary executes, the profiler will use its unmangled name
when attributing samples. This results in unmangled names in the
input profile.

We are currently failing hard when this happens. However, in this case
all that happens is that we fail to attribute samples to the inlined
function. While this means fewer optimization opportunities, it should
not cause a compilation failure.

This patch accepts all valid function names, regardless of whether
they were mangled or not.

Reviewers: chandlerc

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3087

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204142 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/SampleProfile.cpp
test/Transforms/SampleProfile/Inputs/bad_fn_header.prof
test/Transforms/SampleProfile/Inputs/bad_mangle.prof [new file with mode: 0644]
test/Transforms/SampleProfile/syntax.ll