1 ; RUN: llc < %s -stackrealign -mtriple i386-apple-darwin -mcpu=i486 | FileCheck %s
3 %struct.foo = type { [88 x i8] }
5 declare void @bar(i8* nocapture, %struct.foo* align 4 byval) nounwind
6 declare void @baz(i8*) nounwind
9 ; We can't use rep;movsl here because it clobbers the base pointer in %esi.
10 define void @test1(%struct.foo* nocapture %x, i32 %y) nounwind {
11 %dynalloc = alloca i8, i32 %y, align 1
12 call void @bar(i8* %dynalloc, %struct.foo* align 4 byval %x)
16 ; CHECK: andl $-16, %esp
17 ; CHECK: movl %esp, %esi
18 ; CHECK-NOT: rep;movsl
22 ; Also don't clobber %esi if the dynamic alloca comes after the memcpy.
23 define void @test2(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind {
24 call void @bar(i8* %z, %struct.foo* align 4 byval %x)
25 %dynalloc = alloca i8, i32 %y, align 1
26 call void @baz(i8* %dynalloc)
30 ; CHECK: movl %esp, %esi
31 ; CHECK-NOT: rep;movsl
34 ; Check that we do use rep movs if we make the alloca static.
35 define void @test3(%struct.foo* nocapture %x, i32 %y, i8* %z) nounwind {
36 call void @bar(i8* %z, %struct.foo* align 4 byval %x)
37 %statalloc = alloca i8, i32 8, align 1
38 call void @baz(i8* %statalloc)