r302176 - Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
Peter Collingbourne via cfe-commits
cfe-commits at lists.llvm.org
Thu May 4 11:03:26 PDT 2017
Author: pcc
Date: Thu May 4 13:03:25 2017
New Revision: 302176
URL: http://llvm.org/viewvc/llvm-project?rev=302176&view=rev
Log:
Re-apply r302108, "IR: Use pointers instead of GUIDs to represent edges in the module summary. NFCI."
with a fix for the clang backend.
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
cfe/trunk/test/CodeGen/thinlto_backend.ll
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=302176&r1=302175&r2=302176&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu May 4 13:03:25 2017
@@ -974,10 +974,14 @@ static void runThinLTOBackend(ModuleSumm
// via a WriteIndexesThinBackend.
FunctionImporter::ImportMapTy ImportList;
for (auto &GlobalList : *CombinedIndex) {
+ // Ignore entries for undefined references.
+ if (GlobalList.second.SummaryList.empty())
+ continue;
+
auto GUID = GlobalList.first;
- assert(GlobalList.second.size() == 1 &&
+ assert(GlobalList.second.SummaryList.size() == 1 &&
"Expected individual combined index to have one summary per GUID");
- auto &Summary = GlobalList.second[0];
+ auto &Summary = GlobalList.second.SummaryList[0];
// Skip the summaries for the importing module. These are included to
// e.g. record required linkage changes.
if (Summary->modulePath() == M->getModuleIdentifier())
Modified: cfe/trunk/test/CodeGen/thinlto_backend.ll
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/thinlto_backend.ll?rev=302176&r1=302175&r2=302176&view=diff
==============================================================================
--- cfe/trunk/test/CodeGen/thinlto_backend.ll (original)
+++ cfe/trunk/test/CodeGen/thinlto_backend.ll Thu May 4 13:03:25 2017
@@ -35,8 +35,12 @@ target datalayout = "e-m:e-i64:64-f80:12
target triple = "x86_64-unknown-linux-gnu"
declare void @f2()
+declare i8* @f3()
define void @f1() {
call void @f2()
+ ; Make sure that the backend can handle undefined references.
+ ; Do an indirect call so that the undefined ref shows up in the combined index.
+ call void bitcast (i8*()* @f3 to void()*)()
ret void
}
More information about the cfe-commits
mailing list