| OLD | NEW |
| 1 ; This tests the optimization of atomic cmpxchg w/ following cmp + branches. | 1 ; This tests the optimization of atomic cmpxchg w/ following cmp + branches. |
| 2 | 2 |
| 3 ; RUN: %llvm2ice -O2 --verbose none %s \ | 3 ; RUN: %p2i -i %s --args -O2 --verbose none \ |
| 4 ; 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 - \ | 5 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \ |
| 6 ; RUN: | FileCheck --check-prefix=O2 %s | 6 ; RUN: | FileCheck --check-prefix=O2 %s |
| 7 ; RUN: %llvm2ice -Om1 --verbose none %s \ | 7 ; RUN: %p2i -i %s --args -Om1 --verbose none \ |
| 8 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ | 8 ; RUN: | llvm-mc -triple=i686-none-nacl -x86-asm-syntax=intel -filetype=obj \ |
| 9 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \ | 9 ; RUN: | llvm-objdump -d -symbolize -x86-asm-syntax=intel - \ |
| 10 ; RUN: | FileCheck --check-prefix=OM1 %s | 10 ; RUN: | FileCheck --check-prefix=OM1 %s |
| 11 ; RUN: %llvm2ice --verbose none %s | FileCheck --check-prefix=ERRORS %s | 11 ; RUN: %p2i -i %s --args --verbose none | FileCheck --check-prefix=ERRORS %s |
| 12 ; RUN: %llvm2iceinsts %s | %szdiff %s | FileCheck --check-prefix=DUMP %s | 12 ; TODO(kschimpf) Find out why lc2i is needed. |
| 13 ; RUN: %llvm2iceinsts --pnacl %s | %szdiff %s \ | 13 ; RUN: %lc2i -i %s --insts | %szdiff %s | FileCheck --check-prefix=DUMP %s |
| 14 ; RUN: | FileCheck --check-prefix=DUMP %s | |
| 15 | 14 |
| 16 declare i32 @llvm.nacl.atomic.cmpxchg.i32(i32*, i32, i32, i32, i32) | 15 declare i32 @llvm.nacl.atomic.cmpxchg.i32(i32*, i32, i32, i32, i32) |
| 17 | 16 |
| 18 | 17 |
| 19 ; Test that a cmpxchg followed by icmp eq and branch can be optimized to | 18 ; Test that a cmpxchg followed by icmp eq and branch can be optimized to |
| 20 ; reuse the flags set by the cmpxchg instruction itself. | 19 ; reuse the flags set by the cmpxchg instruction itself. |
| 21 ; This is only expected to work w/ O2, based on lightweight liveness. | 20 ; This is only expected to work w/ O2, based on lightweight liveness. |
| 22 ; (Or if we had other means to detect the only use). | 21 ; (Or if we had other means to detect the only use). |
| 23 declare void @use_value(i32) | 22 declare void @use_value(i32) |
| 24 | 23 |
| (...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 } | 146 } |
| 148 ; O2-LABEL: test_atomic_cmpxchg_no_opt2 | 147 ; O2-LABEL: test_atomic_cmpxchg_no_opt2 |
| 149 ; O2: lock | 148 ; O2: lock |
| 150 ; O2-NEXT: cmpxchg dword ptr [e{{[^a].}}], e{{[^a]}} | 149 ; O2-NEXT: cmpxchg dword ptr [e{{[^a].}}], e{{[^a]}} |
| 151 ; O2: mov {{.*}} | 150 ; O2: mov {{.*}} |
| 152 ; O2: cmp | 151 ; O2: cmp |
| 153 ; O2: je | 152 ; O2: je |
| 154 | 153 |
| 155 ; ERRORS-NOT: ICE translation error | 154 ; ERRORS-NOT: ICE translation error |
| 156 ; DUMP-NOT: SZ | 155 ; DUMP-NOT: SZ |
| OLD | NEW |