[llvm] r273843 - Mips: Fix access to private functions.
Rafael Espindola via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 26 20:19:41 PDT 2016
Author: rafael
Date: Sun Jun 26 22:19:40 2016
New Revision: 273843
URL: http://llvm.org/viewvc/llvm-project?rev=273843&view=rev
Log:
Mips: Fix access to private functions.
Added:
llvm/trunk/test/CodeGen/Mips/private-addr.ll
Modified:
llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
Modified: llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp?rev=273843&r1=273842&r2=273843&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Mips/MipsISelLowering.cpp Sun Jun 26 22:19:40 2016
@@ -1764,7 +1764,7 @@ SDValue MipsTargetLowering::lowerGlobalA
return getAddrNonPIC(N, SDLoc(N), Ty, DAG);
}
- if (GV->hasInternalLinkage() || (GV->hasLocalLinkage() && !isa<Function>(GV)))
+ if (GV->hasLocalLinkage())
return getAddrLocal(N, SDLoc(N), Ty, DAG, ABI.IsN32() || ABI.IsN64());
if (LargeGOT)
Added: llvm/trunk/test/CodeGen/Mips/private-addr.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/private-addr.ll?rev=273843&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/private-addr.ll (added)
+++ llvm/trunk/test/CodeGen/Mips/private-addr.ll Sun Jun 26 22:19:40 2016
@@ -0,0 +1,14 @@
+; RUN: llc -mtriple=mips-pc-linux -relocation-model=pic < %s | FileCheck %s
+
+define private void @bar() {
+ ret void
+}
+
+define void()* @foo() {
+; CHECK: foo:
+; CHECK: lw $[[REG:.*]], %got($bar)($1)
+; CHECK-NEXT: jr $ra
+; CHECK-NEXT: addiu $2, $[[REG]], %lo($bar)
+
+ ret void()* @bar
+}
More information about the llvm-commits
mailing list