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

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

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

Powered by Google App Engine
This is Rietveld 408576698