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 1441793002: Subzero: Find rematerializable variables transitively. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Make the analysis loop more readable 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') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 ; This is a basic test of the alloca instruction. 1 ; This is a basic test of the alloca instruction.
2 2
3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \ 3 ; RUN: %if --need=target_X8632 --command %p2i --filetype=obj --disassemble \
4 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \ 4 ; RUN: --target x8632 -i %s --args -O2 -allow-externally-defined-symbols \
5 ; RUN: | %if --need=target_X8632 --command FileCheck %s 5 ; RUN: | %if --need=target_X8632 --command FileCheck %s
6 6
7 ; Test that a sequence of allocas with less than stack alignment get fused. 7 ; Test that a sequence of allocas with less than stack alignment get fused.
8 define internal void @fused_small_align(i32 %arg) { 8 define internal void @fused_small_align(i32 %arg) {
9 entry: 9 entry:
10 %a1 = alloca i8, i32 8, align 4 10 %a1 = alloca i8, i32 8, align 4
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 ; CHECK-NEXT: sub esp,0x8 48 ; CHECK-NEXT: sub esp,0x8
49 ; CHECK-NEXT: mov eax,DWORD PTR [ebp+0x8] 49 ; CHECK-NEXT: mov eax,DWORD PTR [ebp+0x8]
50 ; CHECK-NEXT: and esp,0xffffffc0 50 ; CHECK-NEXT: and esp,0xffffffc0
51 ; CHECK-NEXT: sub esp,0x80 51 ; CHECK-NEXT: sub esp,0x80
52 ; CHECK-NEXT: mov ecx,esp 52 ; CHECK-NEXT: mov ecx,esp
53 ; CHECK-NEXT: mov DWORD PTR [esp+0x40],eax 53 ; CHECK-NEXT: mov DWORD PTR [esp+0x40],eax
54 ; CHECK-NEXT: mov DWORD PTR [esp],eax 54 ; CHECK-NEXT: mov DWORD PTR [esp],eax
55 ; CHECK-NEXT: mov DWORD PTR [esp+0x60],eax 55 ; CHECK-NEXT: mov DWORD PTR [esp+0x60],eax
56 ; CHECK-NEXT: mov esp,ebp 56 ; CHECK-NEXT: mov esp,ebp
57 ; CHECK-NEXT: pop ebp 57 ; CHECK-NEXT: pop ebp
58
59 ; Test that an interior pointer into a rematerializable variable is also
60 ; rematerializable, and test that it is detected even when the use appears
61 ; syntactically before the definition. Test that it is folded into mem
62 ; operands, and also rematerializable through an lea instruction for direct use.
63 define internal i32 @fused_derived(i32 %arg) {
64 entry:
65 %a1 = alloca i8, i32 128, align 4
66 %a2 = alloca i8, i32 128, align 4
67 %a3 = alloca i8, i32 128, align 4
68 br label %block2
69 block1:
70 %a2_i32 = bitcast i8* %a2 to i32*
71 store i32 %arg, i32* %a2_i32, align 1
72 store i32 %arg, i32* %derived, align 1
73 ret i32 %retval
74 block2:
75 ; The following are all rematerializable variables deriving from %a2.
76 %p2 = ptrtoint i8* %a2 to i32
77 %d = add i32 %p2, 12
78 %retval = add i32 %p2, 1
79 %derived = inttoptr i32 %d to i32*
80 br label %block1
81 }
82 ; CHECK-LABEL: fused_derived
83 ; CHECK-NEXT: sub esp,0xc
84 ; CHECK-NEXT: mov [[ARG:e..]],DWORD PTR [esp+0x10]
85 ; CHECK-NEXT: sub esp,0x180
86 ; CHECK-NEXT: mov {{.*}},esp
87 ; CHECK-NEXT: jmp
88 ; CHECK-NEXT: mov DWORD PTR [esp+0x80],[[ARG]]
89 ; CHECK-NEXT: mov DWORD PTR [esp+0x8c],[[ARG]]
90 ; CHECK-NEXT: lea eax,[esp+0x81]
91 ; CHECK-NEXT: add esp,0x18c
92 ; CHECK-NEXT: ret
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698