Index: lib/Analysis/ModuleSummaryAnalysis.cpp =================================================================== --- lib/Analysis/ModuleSummaryAnalysis.cpp +++ lib/Analysis/ModuleSummaryAnalysis.cpp @@ -55,7 +55,7 @@ // We have a reference to a global value. This should be added to // the reference set unless it is a callee. Callees are handled // specially by WriteFunction and are added to a separate list. - if (!(CS && CS.isCallee(&OI))) + if (!(CS && CS.isCallee(&OI) && CS.getCalledFunction())) RefEdges.insert(Operand); continue; } Index: test/Bitcode/thinlto-alias2.ll =================================================================== --- /dev/null +++ test/Bitcode/thinlto-alias2.ll @@ -0,0 +1,28 @@ +; Test to check the callgraph for call to alias in module. +; RUN: opt -module-summary %s -o %t.o +; RUN: llvm-bcanalyzer -dump %t.o | FileCheck %s + +; CHECK: +; CHECK-NEXT: +; CHECK-NEXT: + +; ModuleID = 'thinlto-alias2.ll' +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define i32 @main() { +entry: + call void (...) @analias() + ret i32 0 +} + +@analias = alias void (...), bitcast (void ()* @aliasee to void (...)*) + +define void @aliasee() #0 { +entry: + ret void +} +