1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-unknown-unknown -run-pass=instruction-select -verify-machineinstrs %s -o - | FileCheck %s
5 define void @test_load_i8(i8* %addr) { ret void }
6 define void @test_load_i16(i16* %addr) { ret void }
7 define void @test_load_i32(i32* %addr) { ret void }
8 define void @test_load_i64(i64* %addr) { ret void }
15 tracksRegLiveness: true
19 ; CHECK-LABEL: name: test_load_i8
21 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
22 ; CHECK: [[LDXRB:%[0-9]+]]:gpr32 = LDXRB [[COPY]] :: (volatile load (s8) from %ir.addr)
23 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDXRB]], %subreg.sub_32
24 ; CHECK: $x1 = COPY [[SUBREG_TO_REG]]
25 ; CHECK: RET_ReallyLR implicit $x1
27 %1:gpr(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aarch64.ldxr), %0(p0) :: (volatile load (s8) from %ir.addr)
29 RET_ReallyLR implicit $x1
37 tracksRegLiveness: true
41 ; CHECK-LABEL: name: test_load_i16
43 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
44 ; CHECK: [[LDXRH:%[0-9]+]]:gpr32 = LDXRH [[COPY]] :: (volatile load (s16) from %ir.addr)
45 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDXRH]], %subreg.sub_32
46 ; CHECK: $x1 = COPY [[SUBREG_TO_REG]]
47 ; CHECK: RET_ReallyLR implicit $x1
49 %1:gpr(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aarch64.ldxr), %0(p0) :: (volatile load (s16) from %ir.addr)
51 RET_ReallyLR implicit $x1
59 tracksRegLiveness: true
63 ; CHECK-LABEL: name: test_load_i32
65 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
66 ; CHECK: [[LDXRW:%[0-9]+]]:gpr32 = LDXRW [[COPY]] :: (volatile load (s32) from %ir.addr)
67 ; CHECK: [[SUBREG_TO_REG:%[0-9]+]]:gpr64all = SUBREG_TO_REG 0, [[LDXRW]], %subreg.sub_32
68 ; CHECK: $x1 = COPY [[SUBREG_TO_REG]]
69 ; CHECK: RET_ReallyLR implicit $x1
71 %1:gpr(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aarch64.ldxr), %0(p0) :: (volatile load (s32) from %ir.addr)
73 RET_ReallyLR implicit $x1
82 tracksRegLiveness: true
86 ; CHECK-LABEL: name: test_load_i64
88 ; CHECK: [[COPY:%[0-9]+]]:gpr64sp = COPY $x0
89 ; CHECK: [[LDXRX:%[0-9]+]]:gpr64 = LDXRX [[COPY]] :: (volatile load (s64) from %ir.addr)
90 ; CHECK: $x1 = COPY [[LDXRX]]
91 ; CHECK: RET_ReallyLR implicit $x1
93 %1:gpr(s64) = G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.aarch64.ldxr), %0(p0) :: (volatile load (s64) from %ir.addr)
95 RET_ReallyLR implicit $x1