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: $x0 = COPY [[COPY]](p0)
17 ; CHECK: $x1 = COPY [[COPY1]](p0)
18 ; CHECK: $x2 = COPY [[ZEXT]](s64)
19 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
20 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
21 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
22 ; CHECK: $w3 = COPY [[AND]](s32)
23 ; CHECK: TCRETURNdi &memcpy, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
27 %4:_(s1) = G_CONSTANT i1 false
28 %3:_(s64) = G_ZEXT %2(s32)
29 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
35 tracksRegLiveness: true
38 liveins: $w2, $x0, $x1
40 ; CHECK-LABEL: name: test_memmove
41 ; CHECK: liveins: $w2, $x0, $x1
42 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
43 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
44 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
45 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
46 ; CHECK: $x0 = COPY [[COPY]](p0)
47 ; CHECK: $x1 = COPY [[COPY1]](p0)
48 ; CHECK: $x2 = COPY [[ZEXT]](s64)
49 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
50 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
51 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
52 ; CHECK: $w3 = COPY [[AND]](s32)
53 ; CHECK: TCRETURNdi &memmove, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
57 %4:_(s1) = G_CONSTANT i1 false
58 %3:_(s64) = G_ZEXT %2(s32)
59 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memmove), %0(p0), %1(p0), %3(s64), %4(s1)
65 tracksRegLiveness: true
68 liveins: $w1, $w2, $x0
70 ; CHECK-LABEL: name: test_memset
71 ; CHECK: liveins: $w1, $w2, $x0
72 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
73 ; CHECK: [[COPY1:%[0-9]+]]:_(s32) = COPY $w1
74 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
75 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
76 ; CHECK: $x0 = COPY [[COPY]](p0)
77 ; CHECK: [[COPY3:%[0-9]+]]:_(s32) = COPY [[COPY1]](s32)
78 ; CHECK: $w1 = COPY [[COPY3]](s32)
79 ; CHECK: $x2 = COPY [[ZEXT]](s64)
80 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
81 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
82 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
83 ; CHECK: $w3 = COPY [[AND]](s32)
84 ; CHECK: TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp, implicit $x0, implicit $w1, implicit $x2, implicit $w3
88 %5:_(s1) = G_CONSTANT i1 false
89 %3:_(s8) = G_TRUNC %1(s32)
90 %4:_(s64) = G_ZEXT %2(s32)
91 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memset), %0(p0), %3(s8), %4(s64), %5(s1)
97 tracksRegLiveness: true
100 liveins: $w2, $x0, $x1
102 ; CHECK-LABEL: name: no_tail_call
103 ; CHECK: liveins: $w2, $x0, $x1
104 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
105 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
106 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
107 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
108 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
109 ; CHECK: $x0 = COPY [[COPY]](p0)
110 ; CHECK: $x1 = COPY [[COPY1]](p0)
111 ; CHECK: $x2 = COPY [[ZEXT]](s64)
112 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
113 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
114 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
115 ; CHECK: $w3 = COPY [[AND]](s32)
116 ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
117 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
118 ; CHECK: $x0 = COPY [[ZEXT]](s64)
119 ; CHECK: RET_ReallyLR implicit $x0
123 %4:_(s1) = G_CONSTANT i1 false
124 %3:_(s64) = G_ZEXT %2(s32)
125 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
127 RET_ReallyLR implicit $x0
132 tracksRegLiveness: true
135 liveins: $w2, $x0, $x1
136 ; CHECK-LABEL: name: dont_tc_twice
137 ; CHECK: liveins: $w2, $x0, $x1
138 ; CHECK: [[COPY:%[0-9]+]]:_(p0) = COPY $x0
139 ; CHECK: [[COPY1:%[0-9]+]]:_(p0) = COPY $x1
140 ; CHECK: [[COPY2:%[0-9]+]]:_(s32) = COPY $w2
141 ; CHECK: [[ZEXT:%[0-9]+]]:_(s64) = G_ZEXT [[COPY2]](s32)
142 ; CHECK: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit $sp
143 ; CHECK: $x0 = COPY [[COPY]](p0)
144 ; CHECK: $x1 = COPY [[COPY1]](p0)
145 ; CHECK: $x2 = COPY [[ZEXT]](s64)
146 ; CHECK: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
147 ; CHECK: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
148 ; CHECK: [[AND:%[0-9]+]]:_(s32) = G_AND [[C1]], [[C]]
149 ; CHECK: $w3 = COPY [[AND]](s32)
150 ; CHECK: BL &memcpy, csr_aarch64_aapcs, implicit-def $lr, implicit $sp, implicit $x0, implicit $x1, implicit $x2, implicit $w3
151 ; CHECK: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit $sp
152 ; CHECK: TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp
156 %4:_(s1) = G_CONSTANT i1 false
157 %3:_(s64) = G_ZEXT %2(s32)
158 G_INTRINSIC_W_SIDE_EFFECTS intrinsic(@llvm.memcpy), %0(p0), %1(p0), %3(s64), %4(s1)
159 TCRETURNdi &memset, 0, csr_aarch64_aapcs, implicit $sp