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

Side by Side Diff: tests_lit/llvm2ice_tests/fused-alloca.ll

Issue 1411583007: Combine allocas (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Finish fast path. Created 5 years, 1 month 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/fused-alloca-arg.ll » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 ; This is a basic test of the alloca instruction.
2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s
6
7 ; Test that a sequence of allocas with less than stack alignment get fused.
8 define internal void @fused_small_align(i32 %arg) {
9 entry:
10 %a1 = alloca i8, i32 8, align 4
11 %a2 = alloca i8, i32 12, align 4
12 %a3 = alloca i8, i32 16, align 8
13 %p1 = bitcast i8* %a1 to i32*
14 %p2 = bitcast i8* %a2 to i32*
15 %p3 = bitcast i8* %a3 to i32*
16 store i32 %arg, i32* %p1, align 1
17 store i32 %arg, i32* %p2, align 1
18 store i32 %arg, i32* %p3, align 1
19 ret void
20 }
21 ; CHECK-LABEL: fused_small_align
22 ; CHECK-NEXT: sub esp,0xc
23 ; CHECK-NEXT: mov eax,DWORD PTR [esp+0x10]
24 ; CHECK-NEXT: sub esp,0x30
25 ; CHECK-NEXT: mov {{.*}},esp
26 ; CHECK-NEXT: mov DWORD PTR [esp+0x10],eax
27 ; CHECK-NEXT: mov DWORD PTR [esp+0x18],eax
28 ; CHECK-NEXT: mov DWORD PTR [esp],eax
29 ; CHECK-NEXT: add esp,0x3c
30
31 ; Test that a sequence of allocas with greater than stack alignment get fused.
32 define internal void @fused_large_align(i32 %arg) {
33 entry:
34 %a1 = alloca i8, i32 8, align 32
35 %a2 = alloca i8, i32 12, align 64
36 %a3 = alloca i8, i32 16, align 32
37 %p1 = bitcast i8* %a1 to i32*
38 %p2 = bitcast i8* %a2 to i32*
39 %p3 = bitcast i8* %a3 to i32*
40 store i32 %arg, i32* %p1, align 1
41 store i32 %arg, i32* %p2, align 1
42 store i32 %arg, i32* %p3, align 1
43 ret void
44 }
45 ; CHECK-LABEL: fused_large_align
46 ; CHECK-NEXT: push ebp
47 ; CHECK-NEXT: mov ebp,esp
48 ; CHECK-NEXT: sub esp,0x8
49 ; CHECK-NEXT: mov eax,DWORD PTR [ebp+0x8]
50 ; CHECK-NEXT: and esp,0xffffffc0
51 ; CHECK-NEXT: sub esp,0x80
52 ; CHECK-NEXT: mov ecx,esp
53 ; CHECK-NEXT: mov DWORD PTR [esp+0x40],eax
54 ; CHECK-NEXT: mov DWORD PTR [esp],eax
55 ; CHECK-NEXT: mov DWORD PTR [esp+0x60],eax
56 ; CHECK-NEXT: mov esp,ebp
57 ; CHECK-NEXT: pop ebp
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/fused-alloca-arg.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698