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/nacl-other-intrinsics.ll

Issue 402253002: Use lowerCast instead of inlined _movzx, to get legalization, for memset. (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 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
1 ; This tests the NaCl intrinsics not related to atomic operations. 1 ; This tests the NaCl intrinsics not related to atomic operations.
2 2
3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s 3 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s
4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s 4 ; RUN: %llvm2ice -Om1 --verbose none %s | FileCheck %s
5 5
6 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1 6 ; Do another run w/ O2 and a different check-prefix (otherwise O2 and Om1
7 ; share the same "CHECK" prefix). This separate run helps check that 7 ; share the same "CHECK" prefix). This separate run helps check that
8 ; some code is optimized out. 8 ; some code is optimized out.
9 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=CHECKO2REM 9 ; RUN: %llvm2ice -O2 --verbose none %s | FileCheck %s --check-prefix=CHECKO2REM
10 10
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 125
126 define void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) { 126 define void @test_memset(i32 %iptr_dst, i32 %wide_val, i32 %len) {
127 entry: 127 entry:
128 %val = trunc i32 %wide_val to i8 128 %val = trunc i32 %wide_val to i8
129 %dst = inttoptr i32 %iptr_dst to i8* 129 %dst = inttoptr i32 %iptr_dst to i8*
130 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, 130 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val,
131 i32 %len, i32 1, i1 0) 131 i32 %len, i32 1, i1 0)
132 ret void 132 ret void
133 } 133 }
134 ; CHECK-LABEL: test_memset 134 ; CHECK-LABEL: test_memset
135 ; CHECK: movzx
135 ; CHECK: call memset 136 ; CHECK: call memset
136 137
137 define void @test_memset_const_len_align(i32 %iptr_dst, i32 %wide_val) { 138 define void @test_memset_const_len_align(i32 %iptr_dst, i32 %wide_val) {
138 entry: 139 entry:
139 %val = trunc i32 %wide_val to i8 140 %val = trunc i32 %wide_val to i8
140 %dst = inttoptr i32 %iptr_dst to i8* 141 %dst = inttoptr i32 %iptr_dst to i8*
141 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val, 142 call void @llvm.memset.p0i8.i32(i8* %dst, i8 %val,
142 i32 8, i32 1, i1 0) 143 i32 8, i32 1, i1 0)
143 ret void 144 ret void
144 } 145 }
145 ; CHECK-LABEL: test_memset_const_len_align 146 ; CHECK-LABEL: test_memset_const_len_align
147 ; CHECK: movzx
148 ; CHECK: call memset
149
150 define void @test_memset_const_val(i32 %iptr_dst, i32 %len) {
151 entry:
152 %dst = inttoptr i32 %iptr_dst to i8*
153 call void @llvm.memset.p0i8.i32(i8* %dst, i8 0, i32 %len, i32 1, i1 0)
154 ret void
155 }
156 ; CHECK-LABEL: test_memset_const_val
157 ; Make sure the argument is legalized (can't movzx reg, 0).
158 ; CHECK: movzx {{.*}}, {{[^0]}}
146 ; CHECK: call memset 159 ; CHECK: call memset
147 160
148 define i32 @test_setjmplongjmp(i32 %iptr_env) { 161 define i32 @test_setjmplongjmp(i32 %iptr_env) {
149 entry: 162 entry:
150 %env = inttoptr i32 %iptr_env to i8* 163 %env = inttoptr i32 %iptr_env to i8*
151 %i = call i32 @llvm.nacl.setjmp(i8* %env) 164 %i = call i32 @llvm.nacl.setjmp(i8* %env)
152 %r1 = icmp eq i32 %i, 0 165 %r1 = icmp eq i32 %i, 0
153 br i1 %r1, label %Zero, label %NonZero 166 br i1 %r1, label %Zero, label %NonZero
154 Zero: 167 Zero:
155 ; Redundant inttoptr, to make --pnacl cast-eliding/re-insertion happy. 168 ; Redundant inttoptr, to make --pnacl cast-eliding/re-insertion happy.
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 } 449 }
437 ; CHECK-LABEL: test_stacksave_multiple 450 ; CHECK-LABEL: test_stacksave_multiple
438 ; At least 3 copies of esp, but probably more from having to do the allocas. 451 ; At least 3 copies of esp, but probably more from having to do the allocas.
439 ; CHECK: mov {{.*}}, esp 452 ; CHECK: mov {{.*}}, esp
440 ; CHECK: mov {{.*}}, esp 453 ; CHECK: mov {{.*}}, esp
441 ; CHECK: mov {{.*}}, esp 454 ; CHECK: mov {{.*}}, esp
442 ; CHECK: mov esp, {{.*}} 455 ; CHECK: mov esp, {{.*}}
443 456
444 ; ERRORS-NOT: ICE translation error 457 ; ERRORS-NOT: ICE translation error
445 ; DUMP-NOT: SZ 458 ; DUMP-NOT: SZ
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