1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -global-isel -march=amdgcn -mcpu=gfx900 -stop-after=finalize-isel < %s | FileCheck %s
4 declare void @readsMem(ptr) #0
5 declare void @writesMem(ptr) #1
7 define void @fence_loads(ptr %ptr) {
8 ; CHECK-LABEL: name: fence_loads
9 ; CHECK: bb.1 (%ir-block.0):
10 ; CHECK-NEXT: liveins: $vgpr0, $vgpr1
12 ; CHECK-NEXT: [[COPY:%[0-9]+]]:vgpr_32 = COPY $vgpr0
13 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:vgpr_32 = COPY $vgpr1
14 ; CHECK-NEXT: [[REG_SEQUENCE:%[0-9]+]]:vreg_64 = REG_SEQUENCE [[COPY]], %subreg.sub0, [[COPY1]], %subreg.sub1
15 ; CHECK-NEXT: ATOMIC_FENCE 5, 1, mmra !0
16 ; CHECK-NEXT: [[FLAT_LOAD_UBYTE:%[0-9]+]]:vgpr_32 = FLAT_LOAD_UBYTE [[REG_SEQUENCE]], 0, 0, implicit $exec, implicit $flat_scr, mmra !1 :: (load acquire (s8) from %ir.ptr, align 4)
17 ; CHECK-NEXT: [[S_MOV_B32_:%[0-9]+]]:sreg_32 = S_MOV_B32 1
18 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:vgpr_32 = COPY [[S_MOV_B32_]]
19 ; CHECK-NEXT: FLAT_STORE_BYTE [[REG_SEQUENCE]], [[COPY2]], 0, 0, implicit $exec, implicit $flat_scr, mmra !2 :: (store release (s8) into %ir.ptr, align 4)
20 ; CHECK-NEXT: SI_RETURN
21 fence release, !mmra !0
22 %ld = load atomic i8, ptr %ptr acquire, align 4, !mmra !2
23 store atomic i8 1, ptr %ptr release, align 4, !mmra !1
27 ; TODO: test atomicrmw, cmpxchg - current lowering doesn't work and blows up on i1 PHIs.
29 attributes #0 = { memory(read) }
30 attributes #1 = { memory(write) }
32 !0 = !{!"foo", !"bar"}
33 !1 = !{!"bux", !"baz"}