OSDN Git Service

[CSSPGO][llvm-profgen] Filter out the instructions without location info for symbolizer
authorwlei <wlei@fb.com>
Wed, 10 Feb 2021 18:04:39 +0000 (10:04 -0800)
committerTom Stellard <tstellar@redhat.com>
Sat, 20 Feb 2021 05:21:13 +0000 (21:21 -0800)
commit610b51c04d3ca6b58555fa30ae52ad9762f9cf86
tree1fc4a153746ad684c8f13fd1e9544a7e8b3b8b24
parent66873fb695370f5bd333e327ec77e4710c7891c2
[CSSPGO][llvm-profgen] Filter out the instructions without location info for symbolizer

It appears some instructions doesn't have the debug location info and the symbolizer will return an empty call stack for them which will cause some crash later in profile unwinding. Actually we do not record the sample info for them, so this change just filter out those instruction.

As those instruction would appears at the begin and end of the instruction list, without them we need to add the boundary check for IP `advance` and `backward`.

Also for pseudo probe based profile, we actually don't need the symbolized location info, so here just change to use an empty stack for it. This could save half of the binary loading time.

Differential Revision: https://reviews.llvm.org/D96434
llvm/test/tools/llvm-profgen/inline-cs-noprobe.test
llvm/test/tools/llvm-profgen/noinline-cs-noprobe.test
llvm/test/tools/llvm-profgen/recursion-compression-noprobe.test
llvm/tools/llvm-profgen/PerfReader.cpp
llvm/tools/llvm-profgen/ProfileGenerator.cpp
llvm/tools/llvm-profgen/ProfiledBinary.cpp
llvm/tools/llvm-profgen/ProfiledBinary.h