Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(522)

Side by Side Diff: tests_lit/llvm2ice_tests/align-spill-locations.ll

Issue 1361803002: Subzero: Improve handling of alloca instructions of constant size. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add a couple of basic tests Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/alloc.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This checks to ensure that Subzero aligns spill slots. 1 ; This checks to ensure that Subzero aligns spill slots.
2 2
3 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s 3 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -Om1 | FileCheck %s
4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s 4 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 | FileCheck %s
5 5
6 ; The location of the stack slot for a variable is inferred from the 6 ; The location of the stack slot for a variable is inferred from the
7 ; return sequence. 7 ; return sequence.
8 8
9 ; In this file, "global" refers to a variable with a live range across 9 ; In this file, "global" refers to a variable with a live range across
10 ; multiple basic blocks (not an LLVM global variable) and "local" 10 ; multiple basic blocks (not an LLVM global variable) and "local"
(...skipping 22 matching lines...) Expand all
33 ; CHECK-LABEL: align_local_vector 33 ; CHECK-LABEL: align_local_vector
34 ; CHECK: movups xmm0,XMMWORD PTR [esp] 34 ; CHECK: movups xmm0,XMMWORD PTR [esp]
35 ; CHECK-NEXT: add esp,0x1c 35 ; CHECK-NEXT: add esp,0x1c
36 ; CHECK-NEXT: ret 36 ; CHECK-NEXT: ret
37 } 37 }
38 38
39 declare void @ForceXmmSpills() 39 declare void @ForceXmmSpills()
40 40
41 define <4 x i32> @align_global_vector_ebp_based(i32 %arg) { 41 define <4 x i32> @align_global_vector_ebp_based(i32 %arg) {
42 entry: 42 entry:
43 br label %eblock ; Disable alloca optimization
44 eblock:
43 %alloc = alloca i8, i32 1, align 1 45 %alloc = alloca i8, i32 1, align 1
44 %vec.global = insertelement <4 x i32> undef, i32 %arg, i32 0 46 %vec.global = insertelement <4 x i32> undef, i32 %arg, i32 0
45 br label %block 47 br label %block
46 block: 48 block:
47 call void @ForceXmmSpillsAndUseAlloca(i8* %alloc) 49 call void @ForceXmmSpillsAndUseAlloca(i8* %alloc)
48 ret <4 x i32> %vec.global 50 ret <4 x i32> %vec.global
49 ; CHECK-LABEL: align_global_vector_ebp_based 51 ; CHECK-LABEL: align_global_vector_ebp_based
50 ; CHECK: movups xmm0,XMMWORD PTR [ebp-0x18] 52 ; CHECK: movups xmm0,XMMWORD PTR [ebp-0x18]
51 ; CHECK-NEXT: mov esp,ebp 53 ; CHECK-NEXT: mov esp,ebp
52 ; CHECK-NEXT: pop ebp 54 ; CHECK-NEXT: pop ebp
53 ; CHECK: ret 55 ; CHECK: ret
54 } 56 }
55 57
56 define <4 x i32> @align_local_vector_ebp_based(i32 %arg) { 58 define <4 x i32> @align_local_vector_ebp_based(i32 %arg) {
57 entry: 59 entry:
60 br label %eblock ; Disable alloca optimization
61 eblock:
58 %alloc = alloca i8, i32 1, align 1 62 %alloc = alloca i8, i32 1, align 1
59 %vec.local = insertelement <4 x i32> undef, i32 %arg, i32 0 63 %vec.local = insertelement <4 x i32> undef, i32 %arg, i32 0
60 call void @ForceXmmSpillsAndUseAlloca(i8* %alloc) 64 call void @ForceXmmSpillsAndUseAlloca(i8* %alloc)
61 ret <4 x i32> %vec.local 65 ret <4 x i32> %vec.local
62 ; CHECK-LABEL: align_local_vector_ebp_based 66 ; CHECK-LABEL: align_local_vector_ebp_based
63 ; CHECK: movups xmm0,XMMWORD PTR [ebp-0x18] 67 ; CHECK: movups xmm0,XMMWORD PTR [ebp-0x18]
64 ; CHECK-NEXT: mov esp,ebp 68 ; CHECK-NEXT: mov esp,ebp
65 ; CHECK-NEXT: pop ebp 69 ; CHECK-NEXT: pop ebp
66 ; CHECK: ret 70 ; CHECK: ret
67 } 71 }
(...skipping 10 matching lines...) Expand all
78 ; CHECK-LABEL: align_local_vector_and_global_float 82 ; CHECK-LABEL: align_local_vector_and_global_float
79 ; CHECK: cvtsi2ss xmm0,eax 83 ; CHECK: cvtsi2ss xmm0,eax
80 ; CHECK-NEXT: movss DWORD PTR [esp+{{0xc|0x1c}}],xmm0 84 ; CHECK-NEXT: movss DWORD PTR [esp+{{0xc|0x1c}}],xmm0
81 ; CHECK: movups xmm0,XMMWORD PTR [{{esp|esp\+0x10}}] 85 ; CHECK: movups xmm0,XMMWORD PTR [{{esp|esp\+0x10}}]
82 ; CHECK-NEXT: add esp,0x2c 86 ; CHECK-NEXT: add esp,0x2c
83 ; CHECK-NEXT: ret 87 ; CHECK-NEXT: ret
84 } 88 }
85 89
86 declare void @ForceXmmSpillsAndUseAlloca(i8*) 90 declare void @ForceXmmSpillsAndUseAlloca(i8*)
87 declare void @ForceXmmSpillsAndUseFloat(float) 91 declare void @ForceXmmSpillsAndUseFloat(float)
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/alloc.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698