1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=amdgcn -mcpu=tahiti -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX6 %s
3 # RUN: llc -march=amdgcn -mcpu=hawaii -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
4 # RUN: llc -march=amdgcn -mcpu=fiji -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX7 %s
5 # RUN: llc -march=amdgcn -mcpu=gfx900 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
6 # RUN: llc -march=amdgcn -mcpu=gfx1010 -run-pass=instruction-select -verify-machineinstrs -global-isel-abort=0 -o - %s | FileCheck -check-prefix=GFX9 %s
10 name: atomic_cmpxchg_s32_local
13 tracksRegLiveness: true
16 liveins: $vgpr0, $vgpr1, $vgpr2
18 ; GFX6-LABEL: name: atomic_cmpxchg_s32_local
19 ; GFX6: liveins: $vgpr0, $vgpr1, $vgpr2
20 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
21 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
22 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
23 ; GFX6: $m0 = S_MOV_B32 -1
24 ; GFX6: [[DS_CMPST_RTN_B32_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32 [[COPY]], [[COPY1]], [[COPY2]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
25 ; GFX6: $vgpr0 = COPY [[DS_CMPST_RTN_B32_]]
26 ; GFX7-LABEL: name: atomic_cmpxchg_s32_local
27 ; GFX7: liveins: $vgpr0, $vgpr1, $vgpr2
28 ; GFX7: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
29 ; GFX7: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
30 ; GFX7: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
31 ; GFX7: $m0 = S_MOV_B32 -1
32 ; GFX7: [[DS_CMPST_RTN_B32_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32 [[COPY]], [[COPY1]], [[COPY2]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
33 ; GFX7: $vgpr0 = COPY [[DS_CMPST_RTN_B32_]]
34 ; GFX9-LABEL: name: atomic_cmpxchg_s32_local
35 ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
36 ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
37 ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
38 ; GFX9: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
39 ; GFX9: [[DS_CMPST_RTN_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32_gfx9 [[COPY]], [[COPY1]], [[COPY2]], 0, 0, implicit $exec :: (load store seq_cst 4, addrspace 3)
40 ; GFX9: $vgpr0 = COPY [[DS_CMPST_RTN_B32_gfx9_]]
41 %0:vgpr(p3) = COPY $vgpr0
42 %1:vgpr(s32) = COPY $vgpr1
43 %2:vgpr(s32) = COPY $vgpr2
44 %3:vgpr(s32) = G_ATOMIC_CMPXCHG %0, %1, %2 :: (load store seq_cst 4, addrspace 3)
50 name: atomic_cmpxchg_s32_local_gep4
53 tracksRegLiveness: true
56 liveins: $vgpr0, $vgpr1, $vgpr2
58 ; GFX6-LABEL: name: atomic_cmpxchg_s32_local_gep4
59 ; GFX6: liveins: $vgpr0, $vgpr1, $vgpr2
60 ; GFX6: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
61 ; GFX6: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
62 ; GFX6: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
63 ; GFX6: [[V_MOV_B32_e32_:%[0-9]+]]:vgpr_32 = V_MOV_B32_e32 4, implicit $exec
64 ; GFX6: %4:vgpr_32, dead %6:sreg_64_xexec = V_ADD_I32_e64 [[COPY]], [[V_MOV_B32_e32_]], 0, implicit $exec
65 ; GFX6: $m0 = S_MOV_B32 -1
66 ; GFX6: [[DS_CMPST_RTN_B32_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32 %4, [[COPY1]], [[COPY2]], 0, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
67 ; GFX6: $vgpr0 = COPY [[DS_CMPST_RTN_B32_]]
68 ; GFX7-LABEL: name: atomic_cmpxchg_s32_local_gep4
69 ; GFX7: liveins: $vgpr0, $vgpr1, $vgpr2
70 ; GFX7: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
71 ; GFX7: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
72 ; GFX7: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
73 ; GFX7: $m0 = S_MOV_B32 -1
74 ; GFX7: [[DS_CMPST_RTN_B32_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32 [[COPY]], [[COPY1]], [[COPY2]], 4, 0, implicit $m0, implicit $exec :: (load store seq_cst 4, addrspace 3)
75 ; GFX7: $vgpr0 = COPY [[DS_CMPST_RTN_B32_]]
76 ; GFX9-LABEL: name: atomic_cmpxchg_s32_local_gep4
77 ; GFX9: liveins: $vgpr0, $vgpr1, $vgpr2
78 ; GFX9: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
79 ; GFX9: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
80 ; GFX9: [[COPY2:%[0-9]+]]:vgpr_32 = COPY $vgpr2
81 ; GFX9: [[DS_CMPST_RTN_B32_gfx9_:%[0-9]+]]:vgpr_32 = DS_CMPST_RTN_B32_gfx9 [[COPY]], [[COPY1]], [[COPY2]], 4, 0, implicit $exec :: (load store seq_cst 4, addrspace 3)
82 ; GFX9: $vgpr0 = COPY [[DS_CMPST_RTN_B32_gfx9_]]
83 %0:vgpr(p3) = COPY $vgpr0
84 %1:vgpr(s32) = COPY $vgpr1
85 %2:vgpr(s32) = COPY $vgpr2
86 %3:vgpr(s32) = G_CONSTANT i32 4
87 %4:vgpr(p3) = G_GEP %0, %3
88 %5:vgpr(s32) = G_ATOMIC_CMPXCHG %4, %1, %2 :: (load store seq_cst 4, addrspace 3)