================
@@ -480,12 +481,19 @@ static void thinLTOInternalizeAndPromoteGUID(
VI.getSummaryList().size() == 1 &&
!GlobalValue::isLocalLinkage(VI.getSummaryList().front()->linkage());
+ bool NameInGlobals = false;
for (auto &S : VI.getSummaryList()) {
// First see if we need to promote an internal value because it is not
// exported.
if (isExported(S->modulePath(), VI)) {
- if (GlobalValue::isLocalLinkage(S->linkage()))
+ if (GlobalValue::isLocalLinkage(S->linkage())) {
S->setLinkage(GlobalValue::ExternalLinkage);
+ if (!NameInGlobals) {
+ if (Globals.insert(VI.name()).second)
+ S->setRenameOnPromotion(false);
----------------
teresajohnson wrote:
Chat is confused. It is confusing the way we construct the name for the GUID
hash (where for locals it prepends the source file name), and the name we use
when renaming after promotion (where the module hash is appended). See
llvm/test/ThinLTO/X86/devirt_local_same_guid.ll for an example of how to get
the same GUID for locals in different modules.
https://github.com/llvm/llvm-project/pull/178587
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits