1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mtriple=aarch64-- -mcpu=falkor -O0 -aarch64-enable-atomic-cfg-tidy=0 -stop-after=irtranslator -global-isel -verify-machineinstrs %s -o - | FileCheck %s
4 define i32 @load_invariant(ptr %ptr) {
5 ; CHECK-LABEL: name: load_invariant
6 ; CHECK: bb.1 (%ir-block.0):
7 ; CHECK-NEXT: liveins: $x0
9 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
10 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (invariant load (s32) from %ir.ptr)
11 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
12 ; CHECK-NEXT: RET_ReallyLR implicit $w0
13 %load = load i32, ptr %ptr, align 4, !invariant.load !0
17 define i32 @load_volatile_invariant(ptr %ptr) {
18 ; CHECK-LABEL: name: load_volatile_invariant
19 ; CHECK: bb.1 (%ir-block.0):
20 ; CHECK-NEXT: liveins: $x0
22 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
23 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (volatile invariant load (s32) from %ir.ptr)
24 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
25 ; CHECK-NEXT: RET_ReallyLR implicit $w0
26 %load = load volatile i32, ptr %ptr, align 4, !invariant.load !0
30 define i32 @load_dereferenceable(ptr dereferenceable(4) %ptr) {
31 ; CHECK-LABEL: name: load_dereferenceable
32 ; CHECK: bb.1 (%ir-block.0):
33 ; CHECK-NEXT: liveins: $x0
35 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
36 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (load (s32) from %ir.ptr)
37 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
38 ; CHECK-NEXT: RET_ReallyLR implicit $w0
39 %load = load i32, ptr %ptr, align 4
43 define i32 @load_dereferenceable_invariant(ptr dereferenceable(4) %ptr) {
44 ; CHECK-LABEL: name: load_dereferenceable_invariant
45 ; CHECK: bb.1 (%ir-block.0):
46 ; CHECK-NEXT: liveins: $x0
48 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
49 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (invariant load (s32) from %ir.ptr)
50 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
51 ; CHECK-NEXT: RET_ReallyLR implicit $w0
52 %load = load i32, ptr %ptr, align 4, !invariant.load !0
56 define i32 @load_nontemporal(ptr %ptr) {
57 ; CHECK-LABEL: name: load_nontemporal
58 ; CHECK: bb.1 (%ir-block.0):
59 ; CHECK-NEXT: liveins: $x0
61 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
62 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: (non-temporal load (s32) from %ir.ptr)
63 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
64 ; CHECK-NEXT: RET_ReallyLR implicit $w0
65 %load = load i32, ptr %ptr, align 4, !nontemporal !0
69 define i32 @load_falkor_strided_access(ptr %ptr) {
70 ; CHECK-LABEL: name: load_falkor_strided_access
71 ; CHECK: bb.1 (%ir-block.0):
72 ; CHECK-NEXT: liveins: $x0
74 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
75 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[COPY]](p0) :: ("aarch64-strided-access" load (s32) from %ir.ptr)
76 ; CHECK-NEXT: $w0 = COPY [[LOAD]](s32)
77 ; CHECK-NEXT: RET_ReallyLR implicit $w0
78 %load = load i32, ptr %ptr, align 4, !falkor.strided.access !0