diff options
author | Hal Finkel <hfinkel@anl.gov> | 2013-04-13 08:09:20 +0000 |
---|---|---|
committer | Hal Finkel <hfinkel@anl.gov> | 2013-04-13 08:09:20 +0000 |
commit | b99c995825a49f0da5af40ee1b61269deb8994b5 (patch) | |
tree | 07f7f82e199cad44f9722fa37e9243377c0bc77c /test/CodeGen/PowerPC | |
parent | 16de01ec277e4c67be6e0909b76a63d7f8a4ced4 (diff) | |
download | llvm-b99c995825a49f0da5af40ee1b61269deb8994b5.tar.gz llvm-b99c995825a49f0da5af40ee1b61269deb8994b5.tar.bz2 llvm-b99c995825a49f0da5af40ee1b61269deb8994b5.tar.xz |
Spill and restore PPC CR registers using the FP when we have one
For functions that need to spill CRs, and have dynamic stack allocations, the
value of the SP during the restore is not what it was during the save, and so
we need to use the FP in these cases (as for all of the other spills and
restores, but the CR restore has a special code path because its reserved slot,
like the link register, is specified directly relative to the adjusted SP).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179457 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/PowerPC')
-rw-r--r-- | test/CodeGen/PowerPC/crsave.ll | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/test/CodeGen/PowerPC/crsave.ll b/test/CodeGen/PowerPC/crsave.ll index 3e98dbd254..109e595900 100644 --- a/test/CodeGen/PowerPC/crsave.ll +++ b/test/CodeGen/PowerPC/crsave.ll @@ -1,5 +1,6 @@ ; RUN: llc -O0 -disable-fp-elim -mtriple=powerpc-unknown-linux-gnu < %s | FileCheck %s -check-prefix=PPC32 -; RUN: llc -O0 -disable-fp-elim -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=PPC64 +; RUN: llc -O0 -disable-fp-elim -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=PPC64-FP +; RUN: llc -O0 -mtriple=powerpc64-unknown-linux-gnu < %s | FileCheck %s -check-prefix=PPC64 declare void @foo() @@ -23,6 +24,11 @@ entry: ; PPC64: lwz 12, 8(1) ; PPC64-NEXT: mtcrf 32, 12 +; PPC64-FP: mfcr 12 +; PPC64-FP-NEXT: stw 12, 8(31) +; PPC64-FP: lwz 12, 8(31) +; PPC64-FP-NEXT: mtcrf 32, 12 + define i32 @test_cr234() nounwind { entry: %ret = alloca i32, align 4 @@ -47,3 +53,10 @@ entry: ; PPC64-NEXT: mtcrf 16, 12 ; PPC64-NEXT: mtcrf 8, 12 +; PPC64-FP: mfcr 12 +; PPC64-FP-NEXT: stw 12, 8(31) +; PPC64-FP: lwz 12, 8(31) +; PPC64-FP-NEXT: mtcrf 32, 12 +; PPC64-FP-NEXT: mtcrf 16, 12 +; PPC64-FP-NEXT: mtcrf 8, 12 + |