Index: llvm/trunk/lib/IR/AsmWriter.cpp =================================================================== --- llvm/trunk/lib/IR/AsmWriter.cpp +++ llvm/trunk/lib/IR/AsmWriter.cpp @@ -2788,8 +2788,14 @@ } void AssemblyWriter::printAliasSummary(const AliasSummary *AS) { - Out << ", aliasee: ^" - << Machine.getGUIDSlot(SummaryToGUIDMap[&AS->getAliasee()]); + Out << ", aliasee: "; + // The indexes emitted for distributed backends may not include the + // aliasee summary (only if it is being imported directly). Handle + // that case by just emitting "null" as the aliasee. + if (AS->hasAliasee()) + Out << "^" << Machine.getGUIDSlot(SummaryToGUIDMap[&AS->getAliasee()]); + else + Out << "null"; } void AssemblyWriter::printGlobalVarSummary(const GlobalVarSummary *GS) { Index: llvm/trunk/test/ThinLTO/X86/distributed_indexes.ll =================================================================== --- llvm/trunk/test/ThinLTO/X86/distributed_indexes.ll +++ llvm/trunk/test/ThinLTO/X86/distributed_indexes.ll @@ -40,6 +40,12 @@ ; BACKEND2-NEXT: