1 ; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2 ; RUN: opt -mtriple=aarch64-- -mattr=+sve -cost-model -analyze -cost-kind=throughput < %s | FileCheck %s --check-prefix=THRU
3 ; RUN: opt -mtriple=aarch64-- -mattr=+sve -cost-model -analyze -cost-kind=latency < %s | FileCheck %s --check-prefix=LATE
4 ; RUN: opt -mtriple=aarch64-- -mattr=+sve -cost-model -analyze -cost-kind=code-size < %s | FileCheck %s --check-prefix=SIZE
5 ; RUN: opt -mtriple=aarch64-- -mattr=+sve -cost-model -analyze -cost-kind=size-latency < %s | FileCheck %s --check-prefix=SIZE_LATE
7 declare <vscale x 2 x double> @llvm.sqrt.v2f64(<vscale x 2 x double>)
9 define <vscale x 2 x double> @fadd_v2f64(<vscale x 2 x double> %a, <vscale x 2 x double> %b) {
10 ; THRU-LABEL: 'fadd_v2f64'
11 ; THRU-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %r = fadd <vscale x 2 x double> %a, %b
12 ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x double> %r
14 ; LATE-LABEL: 'fadd_v2f64'
15 ; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %r = fadd <vscale x 2 x double> %a, %b
16 ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
18 ; SIZE-LABEL: 'fadd_v2f64'
19 ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r = fadd <vscale x 2 x double> %a, %b
20 ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
22 ; SIZE_LATE-LABEL: 'fadd_v2f64'
23 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %r = fadd <vscale x 2 x double> %a, %b
24 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
26 %r = fadd <vscale x 2 x double> %a, %b
27 ret <vscale x 2 x double> %r
30 define <vscale x 2 x double> @sqrt_v2f64(<vscale x 2 x double> %a) {
31 ; THRU-LABEL: 'sqrt_v2f64'
32 ; THRU-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %r = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> %a)
33 ; THRU-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <vscale x 2 x double> %r
35 ; LATE-LABEL: 'sqrt_v2f64'
36 ; LATE-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %r = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> %a)
37 ; LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
39 ; SIZE-LABEL: 'sqrt_v2f64'
40 ; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %r = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> %a)
41 ; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
43 ; SIZE_LATE-LABEL: 'sqrt_v2f64'
44 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %r = call <vscale x 2 x double> @llvm.sqrt.nxv2f64(<vscale x 2 x double> %a)
45 ; SIZE_LATE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret <vscale x 2 x double> %r
47 %r = call <vscale x 2 x double> @llvm.sqrt.v2f64(<vscale x 2 x double> %a)
48 ret <vscale x 2 x double> %r