[MemProf] Fix combined index handling for locals
Since the linker does not resolve local symbols, we cannot look up whether they are prevailing. The prior check was blocking all locals from getting memprof summaries in the combined index. Modified the existing test case to contain a local. This necessitated some other fixes as the order of summary entries changed. Differential Revision: https://reviews.llvm.org/D140786
This commit is contained in:
@@ -7260,8 +7260,12 @@ Error ModuleSummaryIndexBitcodeReader::parseEntireSummary(unsigned ID) {
|
||||
setSpecialRefs(Refs, NumRORefs, NumWORefs);
|
||||
auto VIAndOriginalGUID = getValueInfoFromValueId(ValueID);
|
||||
// In order to save memory, only record the memprof summaries if this is
|
||||
// the prevailing copy of a symbol.
|
||||
if (IsPrevailing && !IsPrevailing(std::get<2>(VIAndOriginalGUID))) {
|
||||
// the prevailing copy of a symbol. The linker doesn't resolve local
|
||||
// linkage values so don't check whether those are prevailing.
|
||||
auto LT = (GlobalValue::LinkageTypes)Flags.Linkage;
|
||||
if (IsPrevailing &&
|
||||
!GlobalValue::isLocalLinkage(LT) &&
|
||||
!IsPrevailing(std::get<2>(VIAndOriginalGUID))) {
|
||||
PendingCallsites.clear();
|
||||
PendingAllocs.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user