[LTO] Avoid calling GlobalValue::getGUID (MD5) twice
authorFangrui Song <maskray@google.com>
Wed, 11 Sep 2019 07:38:21 +0000 (07:38 +0000)
committerFangrui Song <maskray@google.com>
Wed, 11 Sep 2019 07:38:21 +0000 (07:38 +0000)
llvm-svn: 371593

llvm/lib/LTO/LTO.cpp

index d6e7950b078a4b2063a10ba5a4077eb4bd962868..4696265a23204951210f29c28f813288c7b093c8 100644 (file)
@@ -907,8 +907,7 @@ Error LTO::run(AddStreamFn AddStream, NativeObjectCache Cache) {
         GlobalValue::dropLLVMManglingEscape(Res.second.IRName));
 
     if (Res.second.VisibleOutsideSummary && Res.second.Prevailing)
-      GUIDPreservedSymbols.insert(GlobalValue::getGUID(
-          GlobalValue::dropLLVMManglingEscape(Res.second.IRName)));
+      GUIDPreservedSymbols.insert(GUID);
 
     GUIDPrevailingResolutions[GUID] =
         Res.second.Prevailing ? PrevailingType::Yes : PrevailingType::No;