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

Side by Side Diff: tests_lit/llvm2ice_tests/address-mode-opt.ll

Issue 509233002: Convert lit tests to check disassembled assembly. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: reorder some CALLTARGETS-LABEL Created 6 years, 3 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 | « tests_lit/llvm2ice_tests/64bit.pnacl.ll ('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 file checks support for address mode optimization. 1 ; This file checks support for address mode optimization.
2 2
3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s
4 ; RUN: %llvm2ice -O2 --verbose none %s \ 3 ; RUN: %llvm2ice -O2 --verbose none %s \
5 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj 4 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \
5 ; RUN: | llvm-objdump -d --symbolize -x86-asm-syntax=intel - | FileCheck %s
6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s 6 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s
7 7
8 define float @load_arg_plus_200000(float* %arg) { 8 define float @load_arg_plus_200000(float* %arg) {
9 entry: 9 entry:
10 %arg.int = ptrtoint float* %arg to i32 10 %arg.int = ptrtoint float* %arg to i32
11 %addr.int = add i32 %arg.int, 200000 11 %addr.int = add i32 %arg.int, 200000
12 %addr.ptr = inttoptr i32 %addr.int to float* 12 %addr.ptr = inttoptr i32 %addr.int to float*
13 %addr.load = load float* %addr.ptr, align 4 13 %addr.load = load float* %addr.ptr, align 4
14 ret float %addr.load 14 ret float %addr.load
15 ; CHECK-LABEL: load_arg_plus_200000: 15 ; CHECK-LABEL: load_arg_plus_200000:
16 ; CHECK: movss xmm0, dword ptr [eax+200000] 16 ; CHECK: movss xmm0, dword ptr [eax + 200000]
17 } 17 }
18 18
19 define float @load_200000_plus_arg(float* %arg) { 19 define float @load_200000_plus_arg(float* %arg) {
20 entry: 20 entry:
21 %arg.int = ptrtoint float* %arg to i32 21 %arg.int = ptrtoint float* %arg to i32
22 %addr.int = add i32 200000, %arg.int 22 %addr.int = add i32 200000, %arg.int
23 %addr.ptr = inttoptr i32 %addr.int to float* 23 %addr.ptr = inttoptr i32 %addr.int to float*
24 %addr.load = load float* %addr.ptr, align 4 24 %addr.load = load float* %addr.ptr, align 4
25 ret float %addr.load 25 ret float %addr.load
26 ; CHECK-LABEL: load_200000_plus_arg: 26 ; CHECK-LABEL: load_200000_plus_arg:
27 ; CHECK: movss xmm0, dword ptr [eax+200000] 27 ; CHECK: movss xmm0, dword ptr [eax + 200000]
28 } 28 }
29 29
30 define float @load_arg_minus_200000(float* %arg) { 30 define float @load_arg_minus_200000(float* %arg) {
31 entry: 31 entry:
32 %arg.int = ptrtoint float* %arg to i32 32 %arg.int = ptrtoint float* %arg to i32
33 %addr.int = sub i32 %arg.int, 200000 33 %addr.int = sub i32 %arg.int, 200000
34 %addr.ptr = inttoptr i32 %addr.int to float* 34 %addr.ptr = inttoptr i32 %addr.int to float*
35 %addr.load = load float* %addr.ptr, align 4 35 %addr.load = load float* %addr.ptr, align 4
36 ret float %addr.load 36 ret float %addr.load
37 ; CHECK-LABEL: load_arg_minus_200000: 37 ; CHECK-LABEL: load_arg_minus_200000:
38 ; CHECK: movss xmm0, dword ptr [eax-200000] 38 ; CHECK: movss xmm0, dword ptr [eax - 200000]
39 } 39 }
40 40
41 define float @load_200000_minus_arg(float* %arg) { 41 define float @load_200000_minus_arg(float* %arg) {
42 entry: 42 entry:
43 %arg.int = ptrtoint float* %arg to i32 43 %arg.int = ptrtoint float* %arg to i32
44 %addr.int = sub i32 200000, %arg.int 44 %addr.int = sub i32 200000, %arg.int
45 %addr.ptr = inttoptr i32 %addr.int to float* 45 %addr.ptr = inttoptr i32 %addr.int to float*
46 %addr.load = load float* %addr.ptr, align 4 46 %addr.load = load float* %addr.ptr, align 4
47 ret float %addr.load 47 ret float %addr.load
48 ; CHECK-LABEL: load_200000_minus_arg: 48 ; CHECK-LABEL: load_200000_minus_arg:
49 ; CHECK: movss xmm0, dword ptr [eax] 49 ; CHECK: movss xmm0, dword ptr [eax]
50 } 50 }
51 51
52 define float @address_mode_opt_chaining(float* %arg) { 52 define float @address_mode_opt_chaining(float* %arg) {
53 entry: 53 entry:
54 %arg.int = ptrtoint float* %arg to i32 54 %arg.int = ptrtoint float* %arg to i32
55 %addr1.int = add i32 12, %arg.int 55 %addr1.int = add i32 12, %arg.int
56 %addr2.int = sub i32 %addr1.int, 4 56 %addr2.int = sub i32 %addr1.int, 4
57 %addr2.ptr = inttoptr i32 %addr2.int to float* 57 %addr2.ptr = inttoptr i32 %addr2.int to float*
58 %addr2.load = load float* %addr2.ptr, align 4 58 %addr2.load = load float* %addr2.ptr, align 4
59 ret float %addr2.load 59 ret float %addr2.load
60 ; CHECK-LABEL: address_mode_opt_chaining: 60 ; CHECK-LABEL: address_mode_opt_chaining:
61 ; CHECK: movss xmm0, dword ptr [eax+8] 61 ; CHECK: movss xmm0, dword ptr [eax + 8]
62 } 62 }
63 63
64 ; ERRORS-NOT: ICE translation error 64 ; ERRORS-NOT: ICE translation error
OLDNEW
« no previous file with comments | « tests_lit/llvm2ice_tests/64bit.pnacl.ll ('k') | tests_lit/llvm2ice_tests/alloc.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698