[llvm] r193320 - Make sure SP is always aligned on a 2 byte boundary
Job Noorman
jobnoorman at gmail.com
Thu Oct 24 02:32:32 PDT 2013
Author: job
Date: Thu Oct 24 04:32:31 2013
New Revision: 193320
URL: http://llvm.org/viewvc/llvm-project?rev=193320&view=rev
Log:
Make sure SP is always aligned on a 2 byte boundary
Added:
llvm/trunk/test/CodeGen/MSP430/transient-stack-alignment.ll
Modified:
llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h
Modified: llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h?rev=193320&r1=193319&r2=193320&view=diff
==============================================================================
--- llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h (original)
+++ llvm/trunk/lib/Target/MSP430/MSP430FrameLowering.h Thu Oct 24 04:32:31 2013
@@ -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.
Added: llvm/trunk/test/CodeGen/MSP430/transient-stack-alignment.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/MSP430/transient-stack-alignment.ll?rev=193320&view=auto
==============================================================================
--- llvm/trunk/test/CodeGen/MSP430/transient-stack-alignment.ll (added)
+++ llvm/trunk/test/CodeGen/MSP430/transient-stack-alignment.ll Thu Oct 24 04:32:31 2013
@@ -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" }
More information about the llvm-commits
mailing list