[PATCH] D31444: LTO: call getRealLinkageName on IRNames before feeding to getGUID

Bob Haarman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Mar 31 14:30:54 PDT 2017


inglorion updated this revision to Diff 93708.
inglorion added a comment.

moved the tests to lld (https://reviews.llvm.org/D31549)


https://reviews.llvm.org/D31444

Files:
  lib/LTO/LTO.cpp


Index: lib/LTO/LTO.cpp
===================================================================
--- lib/LTO/LTO.cpp
+++ lib/LTO/LTO.cpp
@@ -971,7 +971,8 @@
           // 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 =
@@ -990,10 +991,11 @@
       // 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,


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D31444.93708.patch
Type: text/x-patch
Size: 1157 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170331/52894c8f/attachment.bin>


More information about the llvm-commits mailing list