[ThinLTO] Ignore callee edge to global variable
authorTeresa Johnson <tejohnson@google.com>
Wed, 7 Jun 2023 22:42:56 +0000 (15:42 -0700)
committerTeresa Johnson <tejohnson@google.com>
Thu, 8 Jun 2023 13:44:06 +0000 (06:44 -0700)
commit4638eb26603c8d1cd3c46167734356e2585afdfe
tree9b5b709338a2e46f5dc122cd8e33c7b2587a1fff
parent2f1fb5da724cf1c4455eadf67591640f83801547
[ThinLTO] Ignore callee edge to global variable

Since the symbols in the ThinLTO summary are indexed by GUID we can end
up in corner cases where a callee edge in the combined index goes to a
summary for a global variable. This could happen in the case of hash
collisions, and in the case of SamplePGO profiles could potentially happen
due to code changes (since we synthesize call edges to GUIDs that were
inlined callees in the profiled code).

Handle this by simply ignoring any non-FunctionSummary callees.

Differential Revision: https://reviews.llvm.org/D152406
llvm/lib/Transforms/IPO/FunctionImport.cpp
llvm/test/Transforms/FunctionImport/Inputs/funcimport_var2.ll
llvm/test/Transforms/FunctionImport/funcimport_var.ll