summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen
diff options
context:
space:
mode:
authorHal Finkel <hfinkel@anl.gov>2013-01-30 23:43:27 +0000
committerHal Finkel <hfinkel@anl.gov>2013-01-30 23:43:27 +0000
commite1df90958d21bfe5b517b1fe7d73c5084026bf1a (patch)
tree537b4eb81547bfa22c4644d9960fb6d60a1bb6a7 /llvm/test/CodeGen
parent785afdf3a48b3f38a0fd30edefc533ca1bf725f9 (diff)
downloadbcm5719-llvm-e1df90958d21bfe5b517b1fe7d73c5084026bf1a.tar.gz
bcm5719-llvm-e1df90958d21bfe5b517b1fe7d73c5084026bf1a.zip
PPC QPX requires a 32-byte aligned stack
On systems which support the QPX vector instructions, the stack must be 32-byte aligned. llvm-svn: 173993
Diffstat (limited to 'llvm/test/CodeGen')
-rw-r--r--llvm/test/CodeGen/PowerPC/a2q-stackalign.ll23
1 files changed, 23 insertions, 0 deletions
diff --git a/llvm/test/CodeGen/PowerPC/a2q-stackalign.ll b/llvm/test/CodeGen/PowerPC/a2q-stackalign.ll
new file mode 100644
index 00000000000..00c32911937
--- /dev/null
+++ b/llvm/test/CodeGen/PowerPC/a2q-stackalign.ll
@@ -0,0 +1,23 @@
+; RUN: llc < %s -march=ppc64 -mcpu=a2 | FileCheck -check-prefix=CHECK-A2 %s
+; RUN: llc < %s -march=ppc64 -mcpu=a2q | FileCheck -check-prefix=CHECK-A2Q %s
+; RUN: llc < %s -march=ppc64 -mtriple=powerpc64-bgq-linux -mcpu=a2 | FileCheck -check-prefix=CHECK-BGQ %s
+target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
+target triple = "powerpc64-unknown-linux-gnu"
+
+declare i32 @bar(i8* %a) nounwind;
+define i32 @foo() nounwind {
+ %p = alloca i8, i8 115
+ store i8 0, i8* %p
+ %r = call i32 @bar(i8* %p)
+ ret i32 %r
+}
+
+; Without QPX, the allocated stack frame is 240 bytes, but with QPX
+; (because we require 32-byte alignment), it is 256 bytes.
+; CHECK-A2: @foo
+; CHECK-A2: stdu 1, -240(1)
+; CHECK-A2Q: @foo
+; CHECK-A2Q: stdu 1, -256(1)
+; CHECK-BGQ: @foo
+; CHECK-BGQ: stdu 1, -256(1)
+
OpenPOWER on IntegriCloud