OLD | NEW |
1 ; Test that loads/stores don't move across a nacl.atomic.fence.all. | 1 ; Test that loads/stores don't move across a nacl.atomic.fence.all. |
2 ; This should apply to both atomic and non-atomic loads/stores | 2 ; This should apply to both atomic and non-atomic loads/stores |
3 ; (unlike the non-"all" variety of nacl.atomic.fence, which only | 3 ; (unlike the non-"all" variety of nacl.atomic.fence, which only |
4 ; applies to atomic load/stores). | 4 ; applies to atomic load/stores). |
5 ; | 5 ; |
6 ; RUN: %llvm2ice -O2 --verbose none %s \ | 6 ; RUN: %llvm2ice -O2 --verbose none %s \ |
7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 7 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
8 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - | FileCheck %s | 8 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - | FileCheck %s |
9 | 9 |
10 ; TODO(jvoung): llvm-objdump doesn't symbolize global symbols well, so we | 10 ; TODO(jvoung): llvm-objdump doesn't symbolize global symbols well, so we |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 branch1: | 206 branch1: |
207 %y = load i32* %ptr | 207 %y = load i32* %ptr |
208 ret i32 %y | 208 ret i32 %y |
209 branch2: | 209 branch2: |
210 call void @llvm.nacl.atomic.fence.all() | 210 call void @llvm.nacl.atomic.fence.all() |
211 %z = load i32* %ptr | 211 %z = load i32* %ptr |
212 ret i32 %z | 212 ret i32 %z |
213 } | 213 } |
214 ; CHECK-LABEL: could_have_hoisted_loads | 214 ; CHECK-LABEL: could_have_hoisted_loads |
215 ; CHECK: dword ptr [0] | 215 ; CHECK: dword ptr [0] |
216 ; CHECK: je {{.*}} | 216 ; CHECK: jne {{.*}} |
217 ; CHECK: jmp {{.*}} | |
218 ; CHECK: mov {{.*}}, dword ptr | 217 ; CHECK: mov {{.*}}, dword ptr |
219 ; CHECK: ret | 218 ; CHECK: ret |
220 ; CHECK: mfence | 219 ; CHECK: mfence |
221 ; CHECK: mov {{.*}}, dword ptr | 220 ; CHECK: mov {{.*}}, dword ptr |
222 ; CHECK: ret | 221 ; CHECK: ret |
OLD | NEW |