• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; Checks if the memory cost model does not break when using scalable vectors
2
3; RUN: opt  -cost-model -analyze -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s
4
5define <vscale x 8 x i8> @load-sve-8(<vscale x 8 x i8>* %ptr) {
6; CHECK-LABEL: 'load-sve-8':
7; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
8; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
9  %retval = load <vscale x 8 x i8>, <vscale x 8 x i8>* %ptr
10  ret <vscale x 8 x i8> %retval
11}
12
13define void  @store-sve-8(<vscale x 8 x i8>* %ptr, <vscale x 8 x i8> %val) {
14; CHECK-LABEL: 'store-sve-8'
15; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
16; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
17  store <vscale x 8 x i8> %val, <vscale x 8 x i8>* %ptr
18  ret void
19}
20
21define <vscale x 16 x i8> @load-sve-16(<vscale x 16 x i8>* %ptr) {
22; CHECK-LABEL: 'load-sve-16':
23; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
24; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
25  %retval = load <vscale x 16 x i8>, <vscale x 16 x i8>* %ptr
26  ret <vscale x 16 x i8> %retval
27}
28
29define void  @store-sve-16(<vscale x 16 x i8>* %ptr, <vscale x 16 x i8> %val) {
30; CHECK-LABEL: 'store-sve-16'
31; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
32; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
33  store <vscale x 16 x i8> %val, <vscale x 16 x i8>* %ptr
34  ret void
35}
36
37define <vscale x 32 x i8> @load-sve-32(<vscale x 32 x i8>* %ptr) {
38; CHECK-LABEL: 'load-sve-32':
39; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction:
40; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
41  %retval = load <vscale x 32 x i8>, <vscale x 32 x i8>* %ptr
42  ret <vscale x 32 x i8> %retval
43}
44
45define void  @store-sve-32(<vscale x 32 x i8>* %ptr, <vscale x 32 x i8> %val) {
46; CHECK-LABEL: 'store-sve-32'
47; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction:
48; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
49  store <vscale x 32 x i8> %val, <vscale x 32 x i8>* %ptr
50  ret void
51}
52