1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -march=aarch64 -run-pass=legalizer -verify-machineinstrs %s -o - | FileCheck %s
5 tracksRegLiveness: true
10 ; CHECK-LABEL: name: test_memcpy
11 ; CHECK: liveins: $w2, $x0, $x1
12 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
13 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
14 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
15 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
16 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
17 ; CHECK: $x0 = COPY [[COPY]](p0)
18 ; CHECK: $x1 = COPY [[COPY1]](p0)
19 ; CHECK: $x2 = COPY [[ZEXT]](s64)
20 ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2
21 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
26 %4:_(s1) = G_CONSTANT i1 false
27 %3:_(s64) = G_ZEXT %2(s32)
28 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
34 tracksRegLiveness: true
37 liveins: $w2, $x0, $x1
39 ; CHECK-LABEL: name: test_memmove
40 ; CHECK: liveins: $w2, $x0, $x1
41 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
42 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
43 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
44 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
45 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
46 ; CHECK: $x0 = COPY [[COPY]](p0)
47 ; CHECK: $x1 = COPY [[COPY1]](p0)
48 ; CHECK: $x2 = COPY [[ZEXT]](s64)
49 ; CHECK: BL &memmove, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2
50 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
55 %4:_(s1) = G_CONSTANT i1 false
56 %3:_(s64) = G_ZEXT %2(s32)
57 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memmove), %0(p0), %1(p0), %3(s64), %4(s1)
63 tracksRegLiveness: true
66 liveins: $w1, $w2, $x0
68 ; CHECK-LABEL: name: test_memset
69 ; CHECK: liveins: $w1, $w2, $x0
70 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
71 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
72 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
73 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
74 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
75 ; CHECK: $x0 = COPY [[COPY]](p0)
76 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
77 ; CHECK: $w1 = COPY [[COPY3]](s32)
78 ; CHECK: $x2 = COPY [[ZEXT]](s64)
79 ; CHECK: BL &memset, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $w1, implicit $x2
80 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
85 %5:_(s1) = G_CONSTANT i1 false
86 %3:_(s8) = G_TRUNC %1(s32)
87 %4:_(s64) = G_ZEXT %2(s32)
88 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memset), %0(p0), %3(s8), %4(s64), %5(s1)