From 98a532dd8e94f0e66c901b95b515cfde52879ecc Mon Sep 17 00:00:00 2001 From: Justin Hibbits Date: Thu, 8 Jan 2015 15:47:19 +0000 Subject: Add saving and restoring of r30 to the prologue and epilogue, respectively Summary: The PIC additions didn't update the prologue and epilogue code to save and restore r30 (PIC base register). This does that. Test Plan: Tests updated. Reviewers: hfinkel Reviewed By: hfinkel Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D6876 llvm-svn: 225450 --- llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll | 4 +++- llvm/test/CodeGen/PowerPC/ppc32-pic.ll | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'llvm/test/CodeGen') diff --git a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll index 3ee1cef..ac638df 100644 --- a/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll +++ b/llvm/test/CodeGen/PowerPC/ppc32-pic-large.ll @@ -12,12 +12,14 @@ entry: ; LARGE-BSS: [[POFF:\.L[0-9]+\$poff]]: ; LARGE-BSS-NEXT: .long .LTOC-[[PB:\.L[0-9]+\$pb]] ; LARGE-BSS-NEXT: foo: +; LARGE-BSS: stw 30, -8(1) ; LARGE-BSS: bl [[PB]] ; LARGE-BSS-NEXT: [[PB]]: ; LARGE-BSS: mflr 30 ; LARGE-BSS: lwz [[REG:[0-9]+]], [[POFF]]-[[PB]](30) ; LARGE-BSS-NEXT: add 30, [[REG]], 30 ; LARGE-BSS: lwz [[VREG:[0-9]+]], [[VREF:\.LC[0-9]+]]-.LTOC(30) -; LARGE-BSS: lwz {{[0-9]+}}, 0([[VREG]]) +; LARGE-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]]) +; LARGE-BSS-DAG: lwz 30, -8(1) ; LARGE-BSS: [[VREF]]: ; LARGE-BSS-NEXT: .long bar diff --git a/llvm/test/CodeGen/PowerPC/ppc32-pic.ll b/llvm/test/CodeGen/PowerPC/ppc32-pic.ll index 6c0d989..0ea5082 100644 --- a/llvm/test/CodeGen/PowerPC/ppc32-pic.ll +++ b/llvm/test/CodeGen/PowerPC/ppc32-pic.ll @@ -10,7 +10,9 @@ entry: !llvm.module.flags = !{!0} !0 = !{i32 1, !"PIC Level", i32 1} ; SMALL-BSS-LABEL:foo: +; SMALL-BSS: stw 30, -8(1) ; SMALL-BSS: bl _GLOBAL_OFFSET_TABLE_@local-4 ; SMALL-BSS: mflr 30 ; SMALL-BSS: lwz [[VREG:[0-9]+]], bar@GOT(30) -; SMALL-BSS: lwz {{[0-9]+}}, 0([[VREG]]) +; SMALL-BSS-DAG: lwz {{[0-9]+}}, 0([[VREG]]) +; SMALL-BSS-DAG: lwz 30, -8(1) -- cgit v1.1