1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381
|
; RUN: llc -aarch64-sve-vector-bits-min=128 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefix=NO_SVE
; RUN: llc -aarch64-sve-vector-bits-min=256 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK
; RUN: llc -aarch64-sve-vector-bits-min=384 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK
; RUN: llc -aarch64-sve-vector-bits-min=512 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
; RUN: llc -aarch64-sve-vector-bits-min=640 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
; RUN: llc -aarch64-sve-vector-bits-min=768 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
; RUN: llc -aarch64-sve-vector-bits-min=896 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512
; RUN: llc -aarch64-sve-vector-bits-min=1024 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1152 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1280 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1408 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1536 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1664 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1792 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=1920 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024
; RUN: llc -aarch64-sve-vector-bits-min=2048 -aarch64-enable-atomic-cfg-tidy=false < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_512,VBITS_GE_1024,VBITS_GE_2048
; Test we can code generater patterns of the form:
; fixed_length_vector = ISD::EXTRACT_SUBVECTOR scalable_vector, 0
; scalable_vector = ISD::INSERT_SUBVECTOR scalable_vector, fixed_length_vector, 0
;
; NOTE: Currently shufflevector does not support scalable vectors so it cannot
; be used to model the above operations. Instead these tests rely on knowing
; how fixed length operation are lowered to scalable ones, with multiple blocks
; ensuring insert/extract sequences are not folded away.
target triple = "aarch64-unknown-linux-gnu"
; Don't use SVE when its registers are no bigger than NEON.
; NO_SVE-NOT: ptrue
define void @subvector_v8i16(<8 x i16> *%in, <8 x i16>* %out) #0 {
; CHECK-LABEL: subvector_v8i16:
; CHECK: ldr [[DATA:q[0-9]+]], [x0]
; CHECK: str [[DATA]], [x1]
; CHECK: ret
%a = load <8 x i16>, <8 x i16>* %in
br label %bb1
bb1:
store <8 x i16> %a, <8 x i16>* %out
ret void
}
define void @subvector_v16i16(<16 x i16> *%in, <16 x i16>* %out) #0 {
; CHECK-LABEL: subvector_v16i16:
; CHECK: ptrue [[PG:p[0-9]+]].h, vl16
; CHECK: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; CHECK: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x i16>, <16 x i16>* %in
br label %bb1
bb1:
store <16 x i16> %a, <16 x i16>* %out
ret void
}
define void @subvector_v32i16(<32 x i16> *%in, <32 x i16>* %out) #0 {
; CHECK-LABEL: subvector_v32i16:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].h, vl32
; VBITS_GE_512: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x i16>, <32 x i16>* %in
br label %bb1
bb1:
store <32 x i16> %a, <32 x i16>* %out
ret void
}
define void @subvector_v64i16(<64 x i16> *%in, <64 x i16>* %out) #0 {
; CHECK-LABEL: subvector_v64i16:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].h, vl64
; VBITS_GE_1024: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <64 x i16>, <64 x i16>* %in
br label %bb1
bb1:
store <64 x i16> %a, <64 x i16>* %out
ret void
}
define void @subvector_v8i32(<8 x i32> *%in, <8 x i32>* %out) #0 {
; CHECK-LABEL: subvector_v8i32:
; CHECK: ptrue [[PG:p[0-9]+]].s, vl8
; CHECK: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; CHECK: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <8 x i32>, <8 x i32>* %in
br label %bb1
bb1:
store <8 x i32> %a, <8 x i32>* %out
ret void
}
define void @subvector_v16i32(<16 x i32> *%in, <16 x i32>* %out) #0 {
; CHECK-LABEL: subvector_v16i32:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].s, vl16
; VBITS_GE_512: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x i32>, <16 x i32>* %in
br label %bb1
bb1:
store <16 x i32> %a, <16 x i32>* %out
ret void
}
define void @subvector_v32i32(<32 x i32> *%in, <32 x i32>* %out) #0 {
; CHECK-LABEL: subvector_v32i32:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].s, vl32
; VBITS_GE_1024: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x i32>, <32 x i32>* %in
br label %bb1
bb1:
store <32 x i32> %a, <32 x i32>* %out
ret void
}
define void @subvector_v64i32(<64 x i32> *%in, <64 x i32>* %out) #0 {
; CHECK-LABEL: subvector_v64i32:
; VBITS_GE_2048: ptrue [[PG:p[0-9]+]].s, vl64
; VBITS_GE_2048: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_2048: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <64 x i32>, <64 x i32>* %in
br label %bb1
bb1:
store <64 x i32> %a, <64 x i32>* %out
ret void
}
define void @subvector_v8i64(<8 x i64> *%in, <8 x i64>* %out) #0 {
; CHECK-LABEL: subvector_v8i64:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].d, vl8
; VBITS_GE_512: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <8 x i64>, <8 x i64>* %in
br label %bb1
bb1:
store <8 x i64> %a, <8 x i64>* %out
ret void
}
define void @subvector_v16i64(<16 x i64> *%in, <16 x i64>* %out) #0 {
; CHECK-LABEL: subvector_v16i64:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].d, vl16
; VBITS_GE_1024: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x i64>, <16 x i64>* %in
br label %bb1
bb1:
store <16 x i64> %a, <16 x i64>* %out
ret void
}
define void @subvector_v32i64(<32 x i64> *%in, <32 x i64>* %out) #0 {
; CHECK-LABEL: subvector_v32i64:
; VBITS_GE_2048: ptrue [[PG:p[0-9]+]].d, vl32
; VBITS_GE_2048: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_2048: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x i64>, <32 x i64>* %in
br label %bb1
bb1:
store <32 x i64> %a, <32 x i64>* %out
ret void
}
define void @subvector_v8f16(<8 x half> *%in, <8 x half>* %out) #0 {
; CHECK-LABEL: subvector_v8f16:
; CHECK: ldr [[DATA:q[0-9]+]], [x0]
; CHECK: str [[DATA]], [x1]
; CHECK: ret
%a = load <8 x half>, <8 x half>* %in
br label %bb1
bb1:
store <8 x half> %a, <8 x half>* %out
ret void
}
define void @subvector_v16f16(<16 x half> *%in, <16 x half>* %out) #0 {
; CHECK-LABEL: subvector_v16f16:
; CHECK: ptrue [[PG:p[0-9]+]].h, vl16
; CHECK: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; CHECK: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x half>, <16 x half>* %in
br label %bb1
bb1:
store <16 x half> %a, <16 x half>* %out
ret void
}
define void @subvector_v32f16(<32 x half> *%in, <32 x half>* %out) #0 {
; CHECK-LABEL: subvector_v32f16:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].h, vl32
; VBITS_GE_512: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x half>, <32 x half>* %in
br label %bb1
bb1:
store <32 x half> %a, <32 x half>* %out
ret void
}
define void @subvector_v64f16(<64 x half> *%in, <64 x half>* %out) #0 {
; CHECK-LABEL: subvector_v64f16:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].h, vl64
; VBITS_GE_1024: ld1h { [[DATA:z[0-9]+.h]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1h { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <64 x half>, <64 x half>* %in
br label %bb1
bb1:
store <64 x half> %a, <64 x half>* %out
ret void
}
define void @subvector_v8f32(<8 x float> *%in, <8 x float>* %out) #0 {
; CHECK-LABEL: subvector_v8f32:
; CHECK: ptrue [[PG:p[0-9]+]].s, vl8
; CHECK: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; CHECK: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <8 x float>, <8 x float>* %in
br label %bb1
bb1:
store <8 x float> %a, <8 x float>* %out
ret void
}
define void @subvector_v16f32(<16 x float> *%in, <16 x float>* %out) #0 {
; CHECK-LABEL: subvector_v16f32:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].s, vl16
; VBITS_GE_512: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x float>, <16 x float>* %in
br label %bb1
bb1:
store <16 x float> %a, <16 x float>* %out
ret void
}
define void @subvector_v32f32(<32 x float> *%in, <32 x float>* %out) #0 {
; CHECK-LABEL: subvector_v32f32:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].s, vl32
; VBITS_GE_1024: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x float>, <32 x float>* %in
br label %bb1
bb1:
store <32 x float> %a, <32 x float>* %out
ret void
}
define void @subvector_v64f32(<64 x float> *%in, <64 x float>* %out) #0 {
; CHECK-LABEL: subvector_v64f32:
; VBITS_GE_2048: ptrue [[PG:p[0-9]+]].s, vl64
; VBITS_GE_2048: ld1w { [[DATA:z[0-9]+.s]] }, [[PG]]/z, [x0]
; VBITS_GE_2048: st1w { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <64 x float>, <64 x float>* %in
br label %bb1
bb1:
store <64 x float> %a, <64 x float>* %out
ret void
}
define void @subvector_v8f64(<8 x double> *%in, <8 x double>* %out) #0 {
; CHECK-LABEL: subvector_v8f64:
; VBITS_GE_512: ptrue [[PG:p[0-9]+]].d, vl8
; VBITS_GE_512: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_512: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <8 x double>, <8 x double>* %in
br label %bb1
bb1:
store <8 x double> %a, <8 x double>* %out
ret void
}
define void @subvector_v16f64(<16 x double> *%in, <16 x double>* %out) #0 {
; CHECK-LABEL: subvector_v16f64:
; VBITS_GE_1024: ptrue [[PG:p[0-9]+]].d, vl16
; VBITS_GE_1024: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_1024: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <16 x double>, <16 x double>* %in
br label %bb1
bb1:
store <16 x double> %a, <16 x double>* %out
ret void
}
define void @subvector_v32f64(<32 x double> *%in, <32 x double>* %out) #0 {
; CHECK-LABEL: subvector_v32f64:
; VBITS_GE_2048: ptrue [[PG:p[0-9]+]].d, vl32
; VBITS_GE_2048: ld1d { [[DATA:z[0-9]+.d]] }, [[PG]]/z, [x0]
; VBITS_GE_2048: st1d { [[DATA]] }, [[PG]], [x1]
; CHECK: ret
%a = load <32 x double>, <32 x double>* %in
br label %bb1
bb1:
store <32 x double> %a, <32 x double>* %out
ret void
}
define <8 x i1> @no_warn_dropped_scalable(<8 x i32>* %in) #0 {
; CHECK-LABEL: no_warn_dropped_scalable:
; CHECK: ptrue [[PG:p[0-9]+]].s, vl8
; CHECK: ld1w { [[A:z[0-9]+]].s }, [[PG]]/z, [x0]
; CHECK: cmpgt p{{[0-9]}}.s, [[PG]]/z, [[A]].s, #0
; CHECK: ret
%a = load <8 x i32>, <8 x i32>* %in
br label %bb1
bb1:
%cond = icmp sgt <8 x i32> %a, zeroinitializer
ret <8 x i1> %cond
}
; binop(insert_subvec(a), insert_subvec(b)) -> insert_subvec(binop(a,b)) like
; combines remove redundant subvector operations. This test ensures it's not
; performed when the input idiom is the result of operation legalisation. When
; not prevented the test triggers infinite combine->legalise->combine->...
define void @no_subvector_binop_hang(<8 x i32>* %in, <8 x i32>* %out, i1 %cond) #0 {
; CHECK-LABEL: no_subvector_binop_hang:
; CHECK: // %bb.0:
; CHECK-NEXT: ptrue [[PG:p[0-9]+]].s, vl8
; CHECK-NEXT: ld1w { [[A:z[0-9]+]].s }, [[PG]]/z, [x0]
; CHECK-NEXT: ld1w { [[B:z[0-9]+]].s }, [[PG]]/z, [x1]
; CHECK-NEXT: tbz w2, #0, [[LABEL:\.[A-z0-9_]+]]
; CHECK-NEXT: // %bb.1: // %bb.1
; CHECK-NEXT: orr [[OR:z[0-9]+]].d, [[A]].d, [[B]].d
; CHECK-NEXT: st1w { [[OR]].s }, [[PG]], [x1]
; CHECK-NEXT: [[LABEL]]: // %bb.2
; CHECK-NEXT: ret
%a = load <8 x i32>, <8 x i32>* %in
%b = load <8 x i32>, <8 x i32>* %out
br i1 %cond, label %bb.1, label %bb.2
bb.1:
%or = or <8 x i32> %a, %b
store <8 x i32> %or, <8 x i32>* %out
br label %bb.2
bb.2:
ret void
}
attributes #0 = { "target-features"="+sve" }
|