1# RUN: not --crash llc -mtriple=amdgcn-mesa-mesa3d -mcpu=tahiti -O0 -run-pass=legalizer -o - %s 2>&1| FileCheck -check-prefix=ERROR %s 2 3# This needs to be expanded into a cmpxchg loop. 4# TODO: Will AtomicExpand still do this? 5 6# ERROR: LLVM ERROR: unable to legalize instruction: %2:_(s32) = G_ATOMICRMW_NAND %0:_(p1), %1:_ :: (load store seq_cst 4, addrspace 1) (in function: atomicrmw_nand_global_i32) 7 8--- 9name: atomicrmw_nand_global_i32 10 11body: | 12 bb.0: 13 liveins: $sgpr0_sgpr1, $sgpr2 14 ; CHECK-LABEL: name: atomicrmw_nand_global_i32 15 ; CHECK: [[COPY:%[0-9]+]]:_(p1) = COPY $sgpr0_sgpr1 16 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $sgpr2 17 ; CHECK: [[ATOMICRMW_NAND:%[0-9]+]]:_(s32) = G_ATOMICRMW_NAND [[COPY]](p1), [[COPY1]] :: (load store seq_cst 4, addrspace 1) 18 %0:_(p1) = COPY $sgpr0_sgpr1 19 %1:_(s32) = COPY $sgpr2 20 %2:_(s32) = G_ATOMICRMW_NAND %0, %1 :: (load store seq_cst 4, addrspace 1) 21... 22 23