diff options
author | Job Noorman <jobnoorman@gmail.com> | 2013-10-24 09:32:31 +0000 |
---|---|---|
committer | Job Noorman <jobnoorman@gmail.com> | 2013-10-24 09:32:31 +0000 |
commit | a8d35c98fd1ccef09e604eadb27a4a2c6e205978 (patch) | |
tree | e599045dc9216841cff1b68b3c4a971c6286f9fb | |
parent | 5998ee6b3d0ba3e60cd48d818d5aec3435ac53e1 (diff) | |
download | bcm5719-llvm-a8d35c98fd1ccef09e604eadb27a4a2c6e205978.tar.gz bcm5719-llvm-a8d35c98fd1ccef09e604eadb27a4a2c6e205978.zip |
Make sure SP is always aligned on a 2 byte boundary
llvm-svn: 193320
-rw-r--r-- | llvm/lib/Target/MSP430/MSP430FrameLowering.h | 4 | ||||
-rw-r--r-- | llvm/test/CodeGen/MSP430/transient-stack-alignment.ll | 17 |
2 files changed, 19 insertions, 2 deletions
diff --git a/llvm/lib/Target/MSP430/MSP430FrameLowering.h b/llvm/lib/Target/MSP430/MSP430FrameLowering.h index c673f59b5ef..8370714a594 100644 --- a/llvm/lib/Target/MSP430/MSP430FrameLowering.h +++ b/llvm/lib/Target/MSP430/MSP430FrameLowering.h @@ -27,8 +27,8 @@ protected: public: explicit MSP430FrameLowering(const MSP430Subtarget &sti) - : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2), STI(sti) { - } + : TargetFrameLowering(TargetFrameLowering::StackGrowsDown, 2, -2, 2), + STI(sti) {} /// emitProlog/emitEpilog - These methods insert prolog and epilog code into /// the function. diff --git a/llvm/test/CodeGen/MSP430/transient-stack-alignment.ll b/llvm/test/CodeGen/MSP430/transient-stack-alignment.ll new file mode 100644 index 00000000000..cca83509cf4 --- /dev/null +++ b/llvm/test/CodeGen/MSP430/transient-stack-alignment.ll @@ -0,0 +1,17 @@ +; RUN: llc < %s | FileCheck %s + +target datalayout = "e-p:16:16:16-i8:8:8-i16:16:16-i32:16:32-n8:16-a0:16:16" +target triple = "msp430---elf" + +define void @test() #0 { +; CHECK-LABEL: test: +; CHECK: sub.w #2, r1 + %1 = alloca i8, align 1 +; CHECK-NEXT: mov.b #0, 1(r1) + store i8 0, i8* %1, align 1 +; CHECK-NEXT: add.w #2, r1 +; CHECK-NEXT: ret + ret void +} + +attributes #0 = { nounwind "no-frame-pointer-elim"="false" } |