1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=hawaii -O0 -run-pass=legalizer %s -o - | FileCheck %s
5 name: test_atomic_cmpxchg_with_success_s32_global
8 liveins: $vgpr0_vgpr1, $vgpr2, $vgpr3
10 ; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_global
11 ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
12 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
13 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr3
14 ; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p1), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 1)
15 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
16 ; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
17 %0:_(p1) = COPY $vgpr0_vgpr1
18 %1:_(s32) = COPY $vgpr2
19 %2:_(s32) = COPY $vgpr3
20 %3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 1)
21 S_ENDPGM 0, implicit %3, implicit %4
26 name: test_atomic_cmpxchg_with_success_s32_flat
29 liveins: $vgpr0_vgpr1, $vgpr2, $vgpr3
31 ; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_flat
32 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $vgpr0_vgpr1
33 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr2
34 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr3
35 ; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p0), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4)
36 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
37 ; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
38 %0:_(p0) = COPY $vgpr0_vgpr1
39 %1:_(s32) = COPY $vgpr2
40 %2:_(s32) = COPY $vgpr3
41 %3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 0)
42 S_ENDPGM 0, implicit %3, implicit %4
47 name: test_atomic_cmpxchg_with_success_s32_local
50 liveins: $vgpr0, $vgpr1, $vgpr2
52 ; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s32_local
53 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
54 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $vgpr1
55 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $vgpr2
56 ; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s32) = G_ATOMIC_CMPXCHG [[COPY]](p3), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 3)
57 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s32), [[COPY1]]
58 ; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s32), implicit [[ICMP]](s1)
59 %0:_(p3) = COPY $vgpr0
60 %1:_(s32) = COPY $vgpr1
61 %2:_(s32) = COPY $vgpr2
62 %3:_(s32), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 4, addrspace 3)
63 S_ENDPGM 0, implicit %3, implicit %4
68 name: test_atomic_cmpxchg_with_success_s64_global
71 liveins: $vgpr0_vgpr1, $vgpr2_vgpr3, $vgpr4_vgpr5
73 ; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s64_global
74 ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $vgpr0_vgpr1
75 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr2_vgpr3
76 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr4_vgpr5
77 ; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p1), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 1)
78 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s64), [[COPY1]]
79 ; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s64), implicit [[ICMP]](s1)
80 %0:_(p1) = COPY $vgpr0_vgpr1
81 %1:_(s64) = COPY $vgpr2_vgpr3
82 %2:_(s64) = COPY $vgpr4_vgpr5
83 %3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 1)
84 S_ENDPGM 0, implicit %3, implicit %4
89 name: test_atomic_cmpxchg_with_success_s64_local
92 liveins: $vgpr0, $vgpr1_vgpr2, $vgpr3_vgpr4
94 ; CHECK-LABEL: name: test_atomic_cmpxchg_with_success_s64_local
95 ; CHECK: [[COPY:%[0-9]+]]:_(p3) = COPY $vgpr0
96 ; CHECK: [[COPY1:%[0-9]+]]:_(s64) = COPY $vgpr1_vgpr2
97 ; CHECK: [[COPY2:%[0-9]+]]:_(s64) = COPY $vgpr3_vgpr4
98 ; CHECK: [[ATOMIC_CMPXCHG:%[0-9]+]]:_(s64) = G_ATOMIC_CMPXCHG [[COPY]](p3), [[COPY1]], [[COPY2]] :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 3)
99 ; CHECK: [[ICMP:%[0-9]+]]:_(s1) = G_ICMP intpred(eq), [[ATOMIC_CMPXCHG]](s64), [[COPY1]]
100 ; CHECK: S_ENDPGM 0, implicit [[ATOMIC_CMPXCHG]](s64), implicit [[ICMP]](s1)
101 %0:_(p3) = COPY $vgpr0
102 %1:_(s64) = COPY $vgpr1_vgpr2
103 %2:_(s64) = COPY $vgpr3_vgpr4
104 %3:_(s64), %4:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS %0, %1, %2 :: (load store syncscope("agent-one-as") monotonic monotonic 8, addrspace 3)
105 S_ENDPGM 0, implicit %3, implicit %4