Index: lib/LTO/LTO.cpp =================================================================== --- lib/LTO/LTO.cpp +++ lib/LTO/LTO.cpp @@ -1013,7 +1013,7 @@ // IRName will be defined if we have seen the prevailing copy of // this value. If not, no need to preserve any ThinLTO copies. !Res.second.IRName.empty()) - GUIDPreservedSymbols.insert(GlobalValue::getGUID(Res.second.IRName)); + GUIDPreservedSymbols.insert(GlobalValue::getGUID(GlobalValue::getRealLinkageName(Res.second.IRName))); } auto DeadSymbols = @@ -1032,10 +1032,10 @@ // partition (and we can't get the GUID). if (Res.second.IRName.empty()) continue; - auto GUID = GlobalValue::getGUID(Res.second.IRName); + auto GUID = GlobalValue::getGUID(GlobalValue::getRealLinkageName(Res.second.IRName)); // Mark exported unless index-based analysis determined it to be dead. if (!DeadSymbols.count(GUID)) - ExportedGUIDs.insert(GlobalValue::getGUID(Res.second.IRName)); + ExportedGUIDs.insert(GUID); } auto isPrevailing = [&](GlobalValue::GUID GUID,