Experiment with changing the default 32-bit linux stack alignment to

16 bytes for PR8969. Update all testcases accordingly.

llvm-svn: 123367
This commit is contained in:
Eric Christopher 2011-01-13 06:47:10 +00:00
parent 0272c002ae
commit 3821f63f4b
6 changed files with 83 additions and 65 deletions

View File

@ -342,9 +342,9 @@ X86Subtarget::X86Subtarget(const std::string &TT, const std::string &FS,
assert((!Is64Bit || HasX86_64) &&
"64-bit code requested on a subtarget that doesn't support it!");
// Stack alignment is 16 bytes on Darwin (both 32 and 64 bit) and for all 64
// bit targets.
if (isTargetDarwin() || Is64Bit)
// Stack alignment is 16 bytes on Darwin and Linux (both 32 and 64 bit) and
// for all 64-bit targets.
if (isTargetDarwin() || isTargetLinux() || Is64Bit)
stackAlignment = 16;
if (StackAlignment)

View File

@ -1,6 +1,7 @@
; RUN: llc < %s -mtriple=i686-pc-linux -realign-stack=1 -mattr=sse2 | grep movaps | count 75
; RUN: llc < %s -mtriple=i686-pc-linux -realign-stack=0 -mattr=sse2 | grep movaps | count 1
; RUN: llc < %s -mtriple=i686-pc-linux -realign-stack=0 -mattr=sse2 | grep movaps | count 75
; PR2539
; PR8969 - make 32-bit linux have a 16-byte aligned stack
external global <4 x float>, align 1 ; <<4 x float>*>:0 [#uses=2]
external global <4 x float>, align 1 ; <<4 x float>*>:1 [#uses=1]

View File

@ -1,8 +1,8 @@
; Linux doesn't support stack realignment for functions with allocas (PR2888).
; Until it does, we shouldn't use movaps to access the stack. On targets with
; sufficiently aligned stack (e.g. darwin) we should.
; RUN: llc < %s -mtriple=i386-pc-linux-gnu -mcpu=yonah | not grep movaps
; PR8969 - make 32-bit linux have a 16-byte aligned stack
; RUN: llc < %s -mtriple=i386-pc-linux-gnu -mcpu=yonah | grep movaps | count 2
; RUN: llc < %s -mtriple=i686-apple-darwin9 -mcpu=yonah | grep movaps | count 2

View File

@ -1,10 +1,12 @@
; RUN: llc -mtriple=i386-pc-linux-gnu < %s
; RUN: false
; XRUN: llc -mtriple=i386-pc-linux-gnu < %s
; PR4668
; XFAIL: *
; FIXME: If the coalescer happens to coalesce %level.1 with the copy to EAX
; (for ret) then this will fail to compile. The fundamental problem is
; once the coalescer fixes a virtual register to physical register we can't
; evict it.
; evict it. This started passing again due to the changes for PR8969
; so I've disabled it with a bigger stick.
define i32 @x(i32 %qscale) nounwind {
entry:

View File

@ -8375,7 +8375,7 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: lcallee:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll x
; LINUX-32-STATIC-NEXT: calll x
; LINUX-32-STATIC-NEXT: calll x
@ -8383,11 +8383,11 @@ entry:
; LINUX-32-STATIC-NEXT: calll x
; LINUX-32-STATIC-NEXT: calll x
; LINUX-32-STATIC-NEXT: calll x
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: lcallee:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll x
; LINUX-32-PIC-NEXT: calll x
; LINUX-32-PIC-NEXT: calll x
@ -8395,7 +8395,8 @@ entry:
; LINUX-32-PIC-NEXT: calll x
; LINUX-32-PIC-NEXT: calll x
; LINUX-32-PIC-NEXT: calll x
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: lcallee:
@ -8506,7 +8507,7 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: dcallee:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll y
; LINUX-32-STATIC-NEXT: calll y
; LINUX-32-STATIC-NEXT: calll y
@ -8514,11 +8515,11 @@ entry:
; LINUX-32-STATIC-NEXT: calll y
; LINUX-32-STATIC-NEXT: calll y
; LINUX-32-STATIC-NEXT: calll y
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: dcallee:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll y
; LINUX-32-PIC-NEXT: calll y
; LINUX-32-PIC-NEXT: calll y
@ -8526,7 +8527,8 @@ entry:
; LINUX-32-PIC-NEXT: calll y
; LINUX-32-PIC-NEXT: calll y
; LINUX-32-PIC-NEXT: calll y
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: dcallee:
@ -8770,17 +8772,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: caller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll callee
; LINUX-32-STATIC-NEXT: calll callee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: caller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll callee
; LINUX-32-PIC-NEXT: calll callee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: caller:
@ -8844,17 +8847,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: dcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll dcallee
; LINUX-32-STATIC-NEXT: calll dcallee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: dcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll dcallee
; LINUX-32-PIC-NEXT: calll dcallee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: dcaller:
@ -8918,17 +8922,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: lcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll lcallee
; LINUX-32-STATIC-NEXT: calll lcallee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: lcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll lcallee
; LINUX-32-PIC-NEXT: calll lcallee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: lcaller:
@ -8990,15 +8995,16 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: tailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll callee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: tailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll callee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: tailcaller:
@ -9053,15 +9059,16 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: dtailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll dcallee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: dtailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll dcallee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: dtailcaller:
@ -9116,15 +9123,16 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: ltailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll lcallee
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: ltailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll lcallee
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: ltailcaller:
@ -9183,17 +9191,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: icaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *ifunc
; LINUX-32-STATIC-NEXT: calll *ifunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: icaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *ifunc
; LINUX-32-PIC-NEXT: calll *ifunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: icaller:
@ -9272,17 +9281,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: dicaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *difunc
; LINUX-32-STATIC-NEXT: calll *difunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: dicaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *difunc
; LINUX-32-PIC-NEXT: calll *difunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: dicaller:
@ -9354,17 +9364,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: licaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *lifunc
; LINUX-32-STATIC-NEXT: calll *lifunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: licaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *lifunc
; LINUX-32-PIC-NEXT: calll *lifunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: licaller:
@ -9435,17 +9446,18 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: itailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *ifunc
; LINUX-32-STATIC-NEXT: calll *ifunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: itailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *ifunc
; LINUX-32-PIC-NEXT: calll *ifunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: itailcaller:
@ -9521,15 +9533,16 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: ditailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *difunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: ditailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *difunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: ditailcaller:
@ -9588,15 +9601,16 @@ entry:
; LINUX-64-STATIC: ret
; LINUX-32-STATIC: litailcaller:
; LINUX-32-STATIC: pushl
; LINUX-32-STATIC: subl
; LINUX-32-STATIC-NEXT: calll *lifunc
; LINUX-32-STATIC-NEXT: popl
; LINUX-32-STATIC-NEXT: addl
; LINUX-32-STATIC-NEXT: ret
; LINUX-32-PIC: litailcaller:
; LINUX-32-PIC: pushl
; LINUX-32-PIC: subl
; LINUX-32-PIC-NEXT: calll *lifunc
; LINUX-32-PIC-NEXT: popl
; LINUX-32-PIC-NEXT: addl
; LINUX-32-PIC-NEXT: ret
; LINUX-64-PIC: litailcaller:

View File

@ -1,5 +1,6 @@
; RUN: llc < %s -march=x86 -mcpu=yonah -mtriple=i686-apple-darwin8 | grep movaps
; RUN: llc < %s -march=x86 -mcpu=yonah -mtriple=i686-linux-gnu | grep movups
; RUN: llc < %s -march=x86 -mcpu=yonah -mtriple=i686-linux-gnu | grep movaps
; PR8969 - make 32-bit linux have a 16-byte aligned stack
define <4 x float> @foo(float %a, float %b, float %c, float %d) nounwind {
entry: