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

Side by Side Diff: tests_lit/assembler/x86/jump_encodings.ll

Issue 1406593003: Optimize 64-bit compares with zero (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Add isZero utility function, fix comments. Created 5 years, 2 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/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/icmp-with-zero.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 ; Tests various aspects of x86 branch encodings (near vs far, 1 ; Tests various aspects of x86 branch encodings (near vs far,
2 ; forward vs backward, using CFG labels, or local labels). 2 ; forward vs backward, using CFG labels, or local labels).
3 3
4 ; Use -ffunction-sections so that the offsets reset for each function. 4 ; Use -ffunction-sections so that the offsets reset for each function.
5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \ 5 ; RUN: %p2i --filetype=obj --disassemble -i %s --args -O2 \
6 ; RUN: -ffunction-sections | FileCheck %s 6 ; RUN: -ffunction-sections | FileCheck %s
7 7
8 ; Use atomic ops as filler, which shouldn't get optimized out. 8 ; Use atomic ops as filler, which shouldn't get optimized out.
9 declare void @llvm.nacl.atomic.store.i32(i32, i32*, i32) 9 declare void @llvm.nacl.atomic.store.i32(i32, i32*, i32)
10 declare i32 @llvm.nacl.atomic.load.i32(i32*, i32) 10 declare i32 @llvm.nacl.atomic.load.i32(i32*, i32)
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 ; A 64-bit compare happens to use local forward branches. 159 ; A 64-bit compare happens to use local forward branches.
160 define internal void @test_local_forward_then_back(i64 %val64, i32 %iptr, 160 define internal void @test_local_forward_then_back(i64 %val64, i32 %iptr,
161 i32 %val) { 161 i32 %val) {
162 entry: 162 entry:
163 br label %next 163 br label %next
164 next: 164 next:
165 %ptr = inttoptr i32 %iptr to i32* 165 %ptr = inttoptr i32 %iptr to i32*
166 call void @llvm.nacl.atomic.store.i32(i32 %val, i32* %ptr, i32 6) 166 call void @llvm.nacl.atomic.store.i32(i32 %val, i32* %ptr, i32 6)
167 br label %next2 167 br label %next2
168 next2: 168 next2:
169 %cmp = icmp ult i64 %val64, 0 169 %cmp = icmp ult i64 %val64, 1
170 br i1 %cmp, label %next, label %next2 170 br i1 %cmp, label %next, label %next2
171 } 171 }
172 ; CHECK-LABEL: test_local_forward_then_back 172 ; CHECK-LABEL: test_local_forward_then_back
173 ; CHECK: {{.*}} mov DWORD PTR 173 ; CHECK: {{.*}} mov DWORD PTR
174 ; CHECK-NEXT: {{.*}} mfence 174 ; CHECK-NEXT: {{.*}} mfence
175 ; CHECK-NEXT: [[LABEL:[0-9a-f]+]]: {{.*}} mov {{.*}},0x1 175 ; CHECK-NEXT: [[LABEL:[0-9a-f]+]]: {{.*}} mov {{.*}},0x1
176 ; CHECK-NEXT: {{.*}} cmp 176 ; CHECK-NEXT: {{.*}} cmp
177 ; CHECK-NEXT: {{.*}} jb 177 ; CHECK-NEXT: {{.*}} jb
178 ; CHECK: {{.*}} jne 178 ; CHECK: {{.*}} jne
179 ; CHECK: {{.*}} jmp [[LABEL]] 179 ; CHECK: {{.*}} jmp [[LABEL]]
(...skipping 12 matching lines...) Expand all
192 %success = icmp eq i32 1, %a 192 %success = icmp eq i32 1, %a
193 br i1 %success, label %next, label %next2 193 br i1 %success, label %next, label %next2
194 } 194 }
195 ; CHECK-LABEL: test_local_backward 195 ; CHECK-LABEL: test_local_backward
196 ; CHECK: 9: {{.*}} mov {{.*}},DWORD 196 ; CHECK: 9: {{.*}} mov {{.*}},DWORD
197 ; CHECK: b: {{.*}} mov 197 ; CHECK: b: {{.*}} mov
198 ; CHECK-NEXT: d: {{.*}} xor 198 ; CHECK-NEXT: d: {{.*}} xor
199 ; CHECK-NEXT: f: {{.*}} lock cmpxchg 199 ; CHECK-NEXT: f: {{.*}} lock cmpxchg
200 ; CHECK-NEXT: 13: 75 f6 jne b 200 ; CHECK-NEXT: 13: 75 f6 jne b
201 ; CHECK: 1c: 74 eb je 9 201 ; CHECK: 1c: 74 eb je 9
OLDNEW
« no previous file with comments | « src/IceTargetLoweringX86BaseImpl.h ('k') | tests_lit/llvm2ice_tests/icmp-with-zero.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698