1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=amdgcn-mesa-mesa3d -mcpu=bonaire -O0 -run-pass=legalizer -o - %s | FileCheck %s
3 # RUN: not --crash llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -O0 -run-pass=legalizer -o /dev/null %s 2>&1 | FileCheck -check-prefix=ERROR %s
5 # ERROR: LLVM ERROR: unable to legalize instruction: %2:_(s32) = G_ATOMICRMW_XCHG %0:_(p0), %1:_ :: (load store seq_cst (s32)) (in function: atomicrmw_xchg_flat_i32)
9 name: atomicrmw_xchg_flat_i32
13 liveins: $sgpr0_sgpr1, $sgpr2
14 ; CHECK-LABEL: name: atomicrmw_xchg_flat_i32
15 ; CHECK: liveins: $sgpr0_sgpr1, $sgpr2
17 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sgpr0_sgpr1
18 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr2
19 ; CHECK-NEXT: [[ATOMICRMW_XCHG:%[0-9]+]]:_(s32) = G_ATOMICRMW_XCHG [[COPY]](p0), [[COPY1]] :: (load store seq_cst (s32))
20 %0:_(p0) = COPY $sgpr0_sgpr1
21 %1:_(s32) = COPY $sgpr2
22 %2:_(s32) = G_ATOMICRMW_XCHG %0, %1 :: (load store seq_cst (s32), addrspace 0)
26 name: atomicrmw_xchg_flat_i64
30 liveins: $sgpr0_sgpr1, $sgpr2
31 ; CHECK-LABEL: name: atomicrmw_xchg_flat_i64
32 ; CHECK: liveins: $sgpr0_sgpr1, $sgpr2
34 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sgpr0_sgpr1
35 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr2
36 ; CHECK-NEXT: [[ATOMICRMW_XCHG:%[0-9]+]]:_(s32) = G_ATOMICRMW_XCHG [[COPY]](p0), [[COPY1]] :: (load store seq_cst (s32))
37 %0:_(p0) = COPY $sgpr0_sgpr1
38 %1:_(s32) = COPY $sgpr2
39 %2:_(s32) = G_ATOMICRMW_XCHG %0, %1 :: (load store seq_cst (s32), addrspace 0)