[llvm] r191160 - [SPARC] Make functions with GLOBAL_OFFSET_TABLE access as non-leaf functions.
Venkatraman Govindaraju
venkatra at cs.wisc.edu
Sat Sep 21 18:40:25 PDT 2013
Author: venkatra
Date: Sat Sep 21 20:40:24 2013
New Revision: 191160
URL: http://llvm.org/viewvc/llvm-project?rev=191160&view=rev
Log:
[SPARC] Make functions with GLOBAL_OFFSET_TABLE access as non-leaf functions.
Modified:
llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
llvm/trunk/test/CodeGen/SPARC/constpool.ll
llvm/trunk/test/CodeGen/SPARC/globals.ll
Modified: llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp?rev=191160&r1=191159&r2=191160&view=diff
==============================================================================
--- llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/Sparc/SparcISelLowering.cpp Sat Sep 21 20:40:24 2013
@@ -1651,6 +1651,10 @@ SDValue SparcTargetLowering::makeAddress
SDValue HiLo = makeHiLoPair(Op, SPII::MO_HI, SPII::MO_LO, DAG);
SDValue GlobalBase = DAG.getNode(SPISD::GLOBAL_BASE_REG, DL, VT);
SDValue AbsAddr = DAG.getNode(ISD::ADD, DL, VT, GlobalBase, HiLo);
+ // GLOBAL_BASE_REG codegen'ed with call. Inform MFI that this
+ // function has calls.
+ MachineFrameInfo *MFI = DAG.getMachineFunction().getFrameInfo();
+ MFI->setHasCalls(true);
return DAG.getLoad(VT, DL, DAG.getEntryNode(), AbsAddr,
MachinePointerInfo::getGOT(), false, false, false, 0);
}
Modified: llvm/trunk/test/CodeGen/SPARC/constpool.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/constpool.ll?rev=191160&r1=191159&r2=191160&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/constpool.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/constpool.ll Sat Sep 21 20:40:24 2013
@@ -39,8 +39,10 @@ entry:
; v8pic32: sethi %hi(.LCPI0_0), %[[R1:[gilo][0-7]]]
; v8pic32: add %[[R1]], %lo(.LCPI0_0), %[[Goffs:[gilo][0-7]]]
; v8pic32: ld [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
-; v8pic32: jmp %o7+8
; v8pic32: ld [%[[Gaddr]]], %f0
+; v8pic32: jmp %i7+8
+; v8pic32: restore
+
; v9pic32: floatCP
@@ -48,6 +50,8 @@ entry:
; v9pic32: sethi %hi(.LCPI0_0), %[[R1:[gilo][0-7]]]
; v9pic32: add %[[R1]], %lo(.LCPI0_0), %[[Goffs:[gilo][0-7]]]
; v9pic32: ldx [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
-; v9pic32: jmp %o7+8
; v9pic32: ld [%[[Gaddr]]], %f1
+; v9pic32: jmp %i7+8
+; v9pic32: restore
+
Modified: llvm/trunk/test/CodeGen/SPARC/globals.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/globals.ll?rev=191160&r1=191159&r2=191160&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/globals.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/globals.ll Sat Sep 21 20:40:24 2013
@@ -41,8 +41,9 @@ define zeroext i8 @loadG() {
; v8pic32: sethi %hi(G), %[[R1:[gilo][0-7]]]
; v8pic32: add %[[R1]], %lo(G), %[[Goffs:[gilo][0-7]]]
; v8pic32: ld [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
-; v8pic32: jmp %o7+8
-; v8pic32: ldub [%[[Gaddr]]], %o0
+; v8pic32: ldub [%[[Gaddr]]], %i0
+; v8pic32: jmp %i7+8
+; v8pic32: restore
; v9pic32: loadG
@@ -50,6 +51,7 @@ define zeroext i8 @loadG() {
; v9pic32: sethi %hi(G), %[[R1:[gilo][0-7]]]
; v9pic32: add %[[R1]], %lo(G), %[[Goffs:[gilo][0-7]]]
; v9pic32: ldx [%[[GOT:[gilo][0-7]]]+%[[Goffs]]], %[[Gaddr:[gilo][0-7]]]
-; v9pic32: jmp %o7+8
-; v9pic32: ldub [%[[Gaddr]]], %o0
+; v9pic32: ldub [%[[Gaddr]]], %i0
+; v9pic32: jmp %i7+8
+; v9pic32: restore
More information about the llvm-commits
mailing list