Index: lib/Target/PowerPC/PPCISelLowering.cpp =================================================================== --- lib/Target/PowerPC/PPCISelLowering.cpp +++ lib/Target/PowerPC/PPCISelLowering.cpp @@ -4549,7 +4606,7 @@ bool isLocalCall(const SDValue &Callee) { if (GlobalAddressSDNode *G = dyn_cast(Callee)) - return G->getGlobal()->isStrongDefinitionForLinker(); + return G->getGlobal()->hasLocalLinkage(); return false; } Index: test/CodeGen/PowerPC/call-nop.ll =================================================================== --- test/CodeGen/PowerPC/call-nop.ll +++ test/CodeGen/PowerPC/call-nop.ll @@ -0,0 +1,27 @@ +; RUN: llc -O2 < %s | FileCheck %s + +target datalayout = "E-m:e-i64:64-n32:64" +target triple = "powerpc64--linux" + +@f.x = internal global i32 0, align 4 + +; Function Attrs: noinline nounwind +define signext i32 @f() noinline { + %1 = load volatile i32, i32* @f.x, align 4 + ret i32 %1 +} + +; Function Attrs: nounwind +define signext i32 @g() { + %1 = call signext i32 @f() + %2 = call signext i32 @f() + %3 = add nsw i32 %1, %2 + ret i32 %3 +} + +; CHECK-LABEL: @g +; CHECK: bl f +; CHECK-NEXT: nop +; CHECK: bl f +; CHECK-NEXT: nop +