1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mtriple=aarch64-- -mcpu=falkor -mattr=+lse -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - | FileCheck %s
4 define i32 @atomicrmw_volatile(ptr %ptr) {
5 ; CHECK-LABEL: name: atomicrmw_volatile
6 ; CHECK: bb.1 (%ir-block.0):
8 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
9 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
10 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (volatile load store monotonic (s32) on %ir.ptr)
11 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
12 ; CHECK: RET_ReallyLR implicit $w0
13 %oldval = atomicrmw volatile add ptr %ptr, i32 1 monotonic
17 define i32 @atomicrmw_falkor(ptr %ptr) {
18 ; CHECK-LABEL: name: atomicrmw_falkor
19 ; CHECK: bb.1 (%ir-block.0):
21 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
22 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
23 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: ("aarch64-strided-access" load store monotonic (s32) on %ir.ptr)
24 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
25 ; CHECK: RET_ReallyLR implicit $w0
26 %oldval = atomicrmw add ptr %ptr, i32 1 monotonic, !falkor.strided.access !0
30 define i32 @atomicrmw_volatile_falkor(ptr %ptr) {
31 ; CHECK-LABEL: name: atomicrmw_volatile_falkor
32 ; CHECK: bb.1 (%ir-block.0):
34 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
35 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
36 ; CHECK: [[ATOMICRMW_ADD:%[0-9]+]]:_(s32) = G_ATOMICRMW_ADD [[COPY]](p0), [[C]] :: (volatile "aarch64-strided-access" load store monotonic (s32) on %ir.ptr)
37 ; CHECK: $w0 = COPY [[ATOMICRMW_ADD]](s32)
38 ; CHECK: RET_ReallyLR implicit $w0
39 %oldval = atomicrmw volatile add ptr %ptr, i32 1 monotonic, !falkor.strided.access !0
43 define i32 @cmpxchg_volatile(ptr %addr) {
44 ; CHECK-LABEL: name: cmpxchg_volatile
45 ; CHECK: bb.1 (%ir-block.0):
47 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
48 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
49 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
50 ; CHECK: [[ATOMIC_CMPXCHG_WITH_SUCCESS:%[0-9]+]]:_(s32), [[ATOMIC_CMPXCHG_WITH_SUCCESS1:%[0-9]+]]:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS [[COPY]](p0), [[C]], [[C1]] :: (volatile load store monotonic monotonic (s32) on %ir.addr)
51 ; CHECK: $w0 = COPY [[ATOMIC_CMPXCHG_WITH_SUCCESS]](s32)
52 ; CHECK: RET_ReallyLR implicit $w0
53 %val_success = cmpxchg volatile ptr %addr, i32 0, i32 1 monotonic monotonic
54 %value_loaded = extractvalue { i32, i1 } %val_success, 0
58 define i32 @cmpxchg_falkor(ptr %addr) {
59 ; CHECK-LABEL: name: cmpxchg_falkor
60 ; CHECK: bb.1 (%ir-block.0):
62 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
63 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
64 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
65 ; CHECK: [[ATOMIC_CMPXCHG_WITH_SUCCESS:%[0-9]+]]:_(s32), [[ATOMIC_CMPXCHG_WITH_SUCCESS1:%[0-9]+]]:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS [[COPY]](p0), [[C]], [[C1]] :: ("aarch64-strided-access" load store monotonic monotonic (s32) on %ir.addr)
66 ; CHECK: $w0 = COPY [[ATOMIC_CMPXCHG_WITH_SUCCESS]](s32)
67 ; CHECK: RET_ReallyLR implicit $w0
68 %val_success = cmpxchg ptr %addr, i32 0, i32 1 monotonic monotonic, !falkor.strided.access !0
69 %value_loaded = extractvalue { i32, i1 } %val_success, 0
73 define i32 @cmpxchg_volatile_falkor(ptr %addr) {
74 ; CHECK-LABEL: name: cmpxchg_volatile_falkor
75 ; CHECK: bb.1 (%ir-block.0):
77 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
78 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
79 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
80 ; CHECK: [[ATOMIC_CMPXCHG_WITH_SUCCESS:%[0-9]+]]:_(s32), [[ATOMIC_CMPXCHG_WITH_SUCCESS1:%[0-9]+]]:_(s1) = G_ATOMIC_CMPXCHG_WITH_SUCCESS [[COPY]](p0), [[C]], [[C1]] :: (volatile "aarch64-strided-access" load store monotonic monotonic (s32) on %ir.addr)
81 ; CHECK: $w0 = COPY [[ATOMIC_CMPXCHG_WITH_SUCCESS]](s32)
82 ; CHECK: RET_ReallyLR implicit $w0
83 %val_success = cmpxchg volatile ptr %addr, i32 0, i32 1 monotonic monotonic, !falkor.strided.access !0
84 %value_loaded = extractvalue { i32, i1 } %val_success, 0