[CSSPGO][llvm-profgen] Handle return to external transition.
authorHongtao Yu <hoy@fb.com>
Fri, 18 Jun 2021 16:30:38 +0000 (09:30 -0700)
committerHongtao Yu <hoy@fb.com>
Tue, 22 Jun 2021 23:24:59 +0000 (16:24 -0700)
commit5c8659801a4976ef2b327f4071d98086efd42a36
tree6f3b567e81e494b3b3b84ecd7af5fa7926ef1b1e
parent959dbd1761cddbe8c53509459dbc0463f86c1b50
[CSSPGO][llvm-profgen] Handle return to external transition.

In a callback case, a return from internal code, say A, to external runtime can happen. The external runtime can then call back to another internal routine, say B. Making an artificial branch that looks like a return from A to B can confuse the unwinder to treat the instruction before B as the call instruction.

Reviewed By: wenlei, wmi

Differential Revision: https://reviews.llvm.org/D104546
llvm/tools/llvm-profgen/PerfReader.cpp