You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
52 lines
2.1 KiB
52 lines
2.1 KiB
; Checks if the memory cost model does not break when using scalable vectors
|
|
|
|
; RUN: opt -cost-model -analyze -mtriple=aarch64--linux-gnu -mattr=+sve < %s | FileCheck %s
|
|
|
|
define <vscale x 8 x i8> @load-sve-8(<vscale x 8 x i8>* %ptr) {
|
|
; CHECK-LABEL: 'load-sve-8':
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
%retval = load <vscale x 8 x i8>, <vscale x 8 x i8>* %ptr
|
|
ret <vscale x 8 x i8> %retval
|
|
}
|
|
|
|
define void @store-sve-8(<vscale x 8 x i8>* %ptr, <vscale x 8 x i8> %val) {
|
|
; CHECK-LABEL: 'store-sve-8'
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
store <vscale x 8 x i8> %val, <vscale x 8 x i8>* %ptr
|
|
ret void
|
|
}
|
|
|
|
define <vscale x 16 x i8> @load-sve-16(<vscale x 16 x i8>* %ptr) {
|
|
; CHECK-LABEL: 'load-sve-16':
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
%retval = load <vscale x 16 x i8>, <vscale x 16 x i8>* %ptr
|
|
ret <vscale x 16 x i8> %retval
|
|
}
|
|
|
|
define void @store-sve-16(<vscale x 16 x i8>* %ptr, <vscale x 16 x i8> %val) {
|
|
; CHECK-LABEL: 'store-sve-16'
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
store <vscale x 16 x i8> %val, <vscale x 16 x i8>* %ptr
|
|
ret void
|
|
}
|
|
|
|
define <vscale x 32 x i8> @load-sve-32(<vscale x 32 x i8>* %ptr) {
|
|
; CHECK-LABEL: 'load-sve-32':
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
%retval = load <vscale x 32 x i8>, <vscale x 32 x i8>* %ptr
|
|
ret <vscale x 32 x i8> %retval
|
|
}
|
|
|
|
define void @store-sve-32(<vscale x 32 x i8>* %ptr, <vscale x 32 x i8> %val) {
|
|
; CHECK-LABEL: 'store-sve-32'
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction:
|
|
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction:
|
|
store <vscale x 32 x i8> %val, <vscale x 32 x i8>* %ptr
|
|
ret void
|
|
}
|