diff options
Diffstat (limited to 'llvm/test/CodeGen')
| -rw-r--r-- | llvm/test/CodeGen/X86/cleanuppad-inalloca.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll | 2 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/inalloca-ctor.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/inalloca-invoke.ll | 3 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/inalloca-stdcall.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/inalloca.ll | 12 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll | 4 | ||||
| -rw-r--r-- | llvm/test/CodeGen/X86/win-alloca-expander.ll | 153 |
8 files changed, 16 insertions, 170 deletions
diff --git a/llvm/test/CodeGen/X86/cleanuppad-inalloca.ll b/llvm/test/CodeGen/X86/cleanuppad-inalloca.ll index c0660fee2f1..2e34ada52e6 100644 --- a/llvm/test/CodeGen/X86/cleanuppad-inalloca.ll +++ b/llvm/test/CodeGen/X86/cleanuppad-inalloca.ll @@ -38,8 +38,8 @@ ehcleanup: ; preds = %entry ; CHECK: pushl %ebp ; CHECK: movl %esp, %ebp ; CHECK: subl ${{[0-9]+}}, %esp -; CHECK: pushl %eax -; CHECK: pushl %eax +; CHECK: movl $8, %eax +; CHECK: calll __chkstk ; CHECK: calll "??0A@@QAE@XZ" ; CHECK: calll "??0A@@QAE@XZ" ; CHECK: calll _takes_two diff --git a/llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll b/llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll index 2b5721d7fcf..7ed471c2f50 100644 --- a/llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll +++ b/llvm/test/CodeGen/X86/dynamic-alloca-in-entry.ll @@ -15,5 +15,5 @@ define void @bar() { ret void } ; CHECK-LABEL: _bar: -; CHECK: pushl %eax +; CHECK: calll __chkstk ; CHECK: retl diff --git a/llvm/test/CodeGen/X86/inalloca-ctor.ll b/llvm/test/CodeGen/X86/inalloca-ctor.ll index f13d537d90b..eba4e72f933 100644 --- a/llvm/test/CodeGen/X86/inalloca-ctor.ll +++ b/llvm/test/CodeGen/X86/inalloca-ctor.ll @@ -12,8 +12,8 @@ define void @g() { entry: %args = alloca inalloca %frame %c = getelementptr %frame, %frame* %args, i32 0, i32 2 -; CHECK: pushl %eax -; CHECK: subl $16, %esp +; CHECK: movl $20, %eax +; CHECK: calll __chkstk ; CHECK: movl %esp, call void @Foo_ctor(%Foo* %c) ; CHECK: leal 12(%{{.*}}), diff --git a/llvm/test/CodeGen/X86/inalloca-invoke.ll b/llvm/test/CodeGen/X86/inalloca-invoke.ll index d90e5012ba4..9a184e563b1 100644 --- a/llvm/test/CodeGen/X86/inalloca-invoke.ll +++ b/llvm/test/CodeGen/X86/inalloca-invoke.ll @@ -21,8 +21,7 @@ blah: %beg = getelementptr %frame.reverse, %frame.reverse* %rev_args, i32 0, i32 0 %end = getelementptr %frame.reverse, %frame.reverse* %rev_args, i32 0, i32 1 -; CHECK: pushl %eax -; CHECK: subl $20, %esp +; CHECK: calll __chkstk ; CHECK: movl %esp, %[[beg:[^ ]*]] ; CHECK: leal 12(%[[beg]]), %[[end:[^ ]*]] diff --git a/llvm/test/CodeGen/X86/inalloca-stdcall.ll b/llvm/test/CodeGen/X86/inalloca-stdcall.ll index 69d94d8bfa7..4f7e4092a99 100644 --- a/llvm/test/CodeGen/X86/inalloca-stdcall.ll +++ b/llvm/test/CodeGen/X86/inalloca-stdcall.ll @@ -8,8 +8,8 @@ declare x86_stdcallcc void @i(i32 %a) define void @g() { ; CHECK-LABEL: _g: %b = alloca inalloca %Foo -; CHECK: pushl %eax -; CHECK: pushl %eax +; CHECK: movl $8, %eax +; CHECK: calll __chkstk %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 store i32 13, i32* %f1 diff --git a/llvm/test/CodeGen/X86/inalloca.ll b/llvm/test/CodeGen/X86/inalloca.ll index 134de2f58dd..e523c945a69 100644 --- a/llvm/test/CodeGen/X86/inalloca.ll +++ b/llvm/test/CodeGen/X86/inalloca.ll @@ -8,8 +8,8 @@ define void @a() { ; CHECK-LABEL: _a: entry: %b = alloca inalloca %Foo -; CHECK: pushl %eax -; CHECK: pushl %eax +; CHECK: movl $8, %eax +; CHECK: calll __chkstk %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 store i32 13, i32* %f1 @@ -28,8 +28,8 @@ define void @b() { ; CHECK-LABEL: _b: entry: %b = alloca inalloca %Foo -; CHECK: pushl %eax -; CHECK: pushl %eax +; CHECK: movl $8, %eax +; CHECK: calll __chkstk %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 store i32 13, i32* %f1 @@ -49,8 +49,8 @@ define void @c() { ; CHECK-LABEL: _c: entry: %b = alloca inalloca %Foo -; CHECK: pushl %eax -; CHECK: pushl %eax +; CHECK: movl $8, %eax +; CHECK: calll __chkstk %f1 = getelementptr %Foo, %Foo* %b, i32 0, i32 0 %f2 = getelementptr %Foo, %Foo* %b, i32 0, i32 1 store i32 13, i32* %f1 diff --git a/llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll b/llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll index 099ef137d8d..94501b5764e 100644 --- a/llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll +++ b/llvm/test/CodeGen/X86/shrink-wrap-chkstk.ll @@ -7,7 +7,7 @@ target datalayout = "e-m:x-p:32:32-i64:64-f80:32-n8:16:32-a:0:32-S32" target triple = "i686-pc-windows-msvc18.0.0" -%struct.S = type { [8192 x i8] } +%struct.S = type { [12 x i8] } define x86_thiscallcc void @call_inalloca(i1 %x) { entry: @@ -29,7 +29,7 @@ bb2: ; CHECK-LABEL: _call_inalloca: # @call_inalloca ; CHECK: pushl %ebp ; CHECK: movl %esp, %ebp -; CHECK: movl $8192, %eax +; CHECK: movl $12, %eax ; CHECK: calll __chkstk ; CHECK: calll _inalloca_params ; CHECK: movl %ebp, %esp diff --git a/llvm/test/CodeGen/X86/win-alloca-expander.ll b/llvm/test/CodeGen/X86/win-alloca-expander.ll deleted file mode 100644 index 0dca72cae1a..00000000000 --- a/llvm/test/CodeGen/X86/win-alloca-expander.ll +++ /dev/null @@ -1,153 +0,0 @@ -; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s - -%struct.S = type { [1024 x i8] } -%struct.T = type { [3000 x i8] } -%struct.U = type { [10000 x i8] } - -define void @basics() { -; CHECK-LABEL: basics: -entry: - br label %bb1 - -; Allocation move sizes should have been removed. -; CHECK-NOT: movl $1024 -; CHECK-NOT: movl $3000 - -bb1: - %p0 = alloca %struct.S -; The allocation is small enough not to require stack probing, but the %esp -; offset after the prologue is not known, so the stack must be touched before -; the pointer is adjusted. -; CHECK: pushl %eax -; CHECK: subl $1020, %esp - - %saved_stack = tail call i8* @llvm.stacksave() - - %p1 = alloca %struct.S -; We know the %esp offset from above, so there is no need to touch the stack -; before adjusting it. -; CHECK: subl $1024, %esp - - %p2 = alloca %struct.T -; The offset is now 2048 bytes, so allocating a T must touch the stack again. -; CHECK: pushl %eax -; CHECK: subl $2996, %esp - - call void @f(%struct.S* %p0) -; CHECK: calll - - %p3 = alloca %struct.T -; The call above touched the stack, so there is room for a T object. -; CHECK: subl $3000, %esp - - %p4 = alloca %struct.U -; The U object is large enough to require stack probing. -; CHECK: movl $10000, %eax -; CHECK: calll __chkstk - - %p5 = alloca %struct.T -; The stack probing above touched the tip of the stack, so there's room for a T. -; CHECK: subl $3000, %esp - - call void @llvm.stackrestore(i8* %saved_stack) - %p6 = alloca %struct.S -; The stack restore means we lose track of the stack pointer and must probe. -; CHECK: pushl %eax -; CHECK: subl $1020, %esp - -; Use the pointers so they're not optimized away. - call void @f(%struct.S* %p1) - call void @g(%struct.T* %p2) - call void @g(%struct.T* %p3) - call void @h(%struct.U* %p4) - call void @g(%struct.T* %p5) - ret void -} - -define void @loop() { -; CHECK-LABEL: loop: -entry: - br label %bb1 - -bb1: - %p1 = alloca %struct.S -; The entry offset is unknown; touch-and-sub. -; CHECK: pushl %eax -; CHECK: subl $1020, %esp - br label %loop1 - -loop1: - %i1 = phi i32 [ 10, %bb1 ], [ %dec1, %loop1 ] - %p2 = alloca %struct.S -; We know the incoming offset from bb1, but from the back-edge, we assume the -; worst, and therefore touch-and-sub to allocate. -; CHECK: pushl %eax -; CHECK: subl $1020, %esp - %dec1 = sub i32 %i1, 1 - %cmp1 = icmp sgt i32 %i1, 0 - br i1 %cmp1, label %loop1, label %end -; CHECK: decl -; CHECK: jg - -end: - call void @f(%struct.S* %p1) - call void @f(%struct.S* %p2) - ret void -} - -define void @probe_size_attribute() "stack-probe-size"="512" { -; CHECK-LABEL: probe_size_attribute: -entry: - br label %bb1 - -bb1: - %p0 = alloca %struct.S -; The allocation would be small enough not to require probing, if it wasn't -; for the stack-probe-size attribute. -; CHECK: movl $1024, %eax -; CHECK: calll __chkstk - call void @f(%struct.S* %p0) - ret void -} - -define void @cfg(i1 %x, i1 %y) { -; Test that the blocks are analyzed in the correct order. -; CHECK-LABEL: cfg: -entry: - br i1 %x, label %bb1, label %bb2 - -bb1: - %p1 = alloca %struct.S -; CHECK: pushl %eax -; CHECK: subl $1020, %esp - br label %bb3 -bb2: - %p2 = alloca %struct.T -; CHECK: pushl %eax -; CHECK: subl $2996, %esp - br label %bb3 - -bb3: - br i1 %y, label %bb4, label %bb5 - -bb4: - %p4 = alloca %struct.S -; CHECK: subl $1024, %esp - call void @f(%struct.S* %p4) - ret void - -bb5: - %p5 = alloca %struct.T -; CHECK: pushl %eax -; CHECK: subl $2996, %esp - call void @g(%struct.T* %p5) - ret void -} - - -declare void @f(%struct.S*) -declare void @g(%struct.T*) -declare void @h(%struct.U*) - -declare i8* @llvm.stacksave() -declare void @llvm.stackrestore(i8*) |

