11; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
2- ; RUN: opt < %s -enable-no-nans-fp-math -passes="print<cost-model>" 2>&1 -disable-output -mtriple=aarch64 -mattr=+fullfp16 -mattr=+sve | FileCheck %s
2+ ; RUN: opt < %s -enable-no-nans-fp-math -passes="print<cost-model>" -cost-kind=all 2>&1 -disable-output -mtriple=aarch64 -mattr=+fullfp16 -mattr=+sve | FileCheck %s
33
44target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
55
66define void @fadd () {
77; CHECK-LABEL: 'fadd'
8- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F16 = fadd <vscale x 4 x half> undef, undef
9- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V8F16 = fadd <vscale x 8 x half> undef, undef
10- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V16F16 = fadd <vscale x 16 x half> undef, undef
11- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V1F32 = fadd <vscale x 1 x float> undef, undef
12- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F32 = fadd <vscale x 2 x float> undef, undef
13- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F32 = fadd <vscale x 4 x float> undef, undef
14- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V8F32 = fadd <vscale x 8 x float> undef, undef
15- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F64 = fadd <vscale x 2 x double> undef, undef
16- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F64 = fadd <vscale x 4 x double> undef, undef
17- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
8+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F16 = fadd <vscale x 4 x half> undef, undef
9+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V8F16 = fadd <vscale x 8 x half> undef, undef
10+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V16F16 = fadd <vscale x 16 x half> undef, undef
11+ ; CHECK-NEXT: Cost Model: Found costs of Invalid for : %V1F32 = fadd <vscale x 1 x float> undef, undef
12+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F32 = fadd <vscale x 2 x float> undef, undef
13+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F32 = fadd <vscale x 4 x float> undef, undef
14+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V8F32 = fadd <vscale x 8 x float> undef, undef
15+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F64 = fadd <vscale x 2 x double> undef, undef
16+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V4F64 = fadd <vscale x 4 x double> undef, undef
17+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
1818;
1919 %V4F16 = fadd <vscale x 4 x half > undef , undef
2020 %V8F16 = fadd <vscale x 8 x half > undef , undef
@@ -33,16 +33,16 @@ define void @fadd() {
3333
3434define void @fsub () {
3535; CHECK-LABEL: 'fsub'
36- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F16 = fsub <vscale x 4 x half> undef, undef
37- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V8F16 = fsub <vscale x 8 x half> undef, undef
38- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V16F16 = fsub <vscale x 16 x half> undef, undef
39- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V1F32 = fsub <vscale x 1 x float> undef, undef
40- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F32 = fsub <vscale x 2 x float> undef, undef
41- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F32 = fsub <vscale x 4 x float> undef, undef
42- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V8F32 = fsub <vscale x 8 x float> undef, undef
43- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F64 = fsub <vscale x 2 x double> undef, undef
44- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F64 = fsub <vscale x 4 x double> undef, undef
45- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
36+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F16 = fsub <vscale x 4 x half> undef, undef
37+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V8F16 = fsub <vscale x 8 x half> undef, undef
38+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V16F16 = fsub <vscale x 16 x half> undef, undef
39+ ; CHECK-NEXT: Cost Model: Found costs of Invalid for : %V1F32 = fsub <vscale x 1 x float> undef, undef
40+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F32 = fsub <vscale x 2 x float> undef, undef
41+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F32 = fsub <vscale x 4 x float> undef, undef
42+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V8F32 = fsub <vscale x 8 x float> undef, undef
43+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F64 = fsub <vscale x 2 x double> undef, undef
44+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V4F64 = fsub <vscale x 4 x double> undef, undef
45+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
4646;
4747 %V4F16 = fsub <vscale x 4 x half > undef , undef
4848 %V8F16 = fsub <vscale x 8 x half > undef , undef
@@ -61,16 +61,16 @@ define void @fsub() {
6161
6262define void @fneg () {
6363; CHECK-LABEL: 'fneg'
64- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F16 = fneg <vscale x 2 x half> undef
65- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F16 = fneg <vscale x 4 x half> undef
66- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V8F16 = fneg <vscale x 8 x half> undef
67- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V16F16 = fneg <vscale x 16 x half> undef
68- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F32 = fneg <vscale x 2 x float> undef
69- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V4F32 = fneg <vscale x 4 x float> undef
70- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V8F32 = fneg <vscale x 8 x float> undef
71- ; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction : %V2F64 = fneg <vscale x 2 x double> undef
72- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F64 = fneg <vscale x 4 x double> undef
73- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
64+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F16 = fneg <vscale x 2 x half> undef
65+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F16 = fneg <vscale x 4 x half> undef
66+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V8F16 = fneg <vscale x 8 x half> undef
67+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V16F16 = fneg <vscale x 16 x half> undef
68+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F32 = fneg <vscale x 2 x float> undef
69+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V4F32 = fneg <vscale x 4 x float> undef
70+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V8F32 = fneg <vscale x 8 x float> undef
71+ ; CHECK-NEXT: Cost Model: Found costs of RThru:1 CodeSize:1 Lat:3 SizeLat: 1 for: %V2F64 = fneg <vscale x 2 x double> undef
72+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V4F64 = fneg <vscale x 4 x double> undef
73+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
7474;
7575 %V2F16 = fneg <vscale x 2 x half > undef
7676 %V4F16 = fneg <vscale x 4 x half > undef
@@ -89,15 +89,15 @@ define void @fneg() {
8989
9090define void @fmul () {
9191; CHECK-LABEL: 'fmul'
92- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F16 = fmul <vscale x 4 x half> undef, undef
93- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V8F16 = fmul <vscale x 8 x half> undef, undef
94- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V16F16 = fmul <vscale x 16 x half> undef, undef
95- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V2F32 = fmul <vscale x 2 x float> undef, undef
96- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F32 = fmul <vscale x 4 x float> undef, undef
97- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V8F32 = fmul <vscale x 8 x float> undef, undef
98- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V2F64 = fmul <vscale x 2 x double> undef, undef
99- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V4F64 = fmul <vscale x 4 x double> undef, undef
100- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
92+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V4F16 = fmul <vscale x 4 x half> undef, undef
93+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V8F16 = fmul <vscale x 8 x half> undef, undef
94+ ; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:3 SizeLat:1 for : %V16F16 = fmul <vscale x 16 x half> undef, undef
95+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V2F32 = fmul <vscale x 2 x float> undef, undef
96+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V4F32 = fmul <vscale x 4 x float> undef, undef
97+ ; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:3 SizeLat:1 for : %V8F32 = fmul <vscale x 8 x float> undef, undef
98+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:3 SizeLat:1 for : %V2F64 = fmul <vscale x 2 x double> undef, undef
99+ ; CHECK-NEXT: Cost Model: Found costs of RThru:4 CodeSize:1 Lat:3 SizeLat:1 for : %V4F64 = fmul <vscale x 4 x double> undef, undef
100+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
101101;
102102 %V4F16 = fmul <vscale x 4 x half > undef , undef
103103 %V8F16 = fmul <vscale x 8 x half > undef , undef
@@ -115,15 +115,15 @@ define void @fmul() {
115115
116116define void @fdiv () {
117117; CHECK-LABEL: 'fdiv'
118- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F16 = fdiv <vscale x 4 x half> undef, undef
119- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V8F16 = fdiv <vscale x 8 x half> undef, undef
120- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V16F16 = fdiv <vscale x 16 x half> undef, undef
121- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V2F32 = fdiv <vscale x 2 x float> undef, undef
122- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V4F32 = fdiv <vscale x 4 x float> undef, undef
123- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V8F32 = fdiv <vscale x 8 x float> undef, undef
124- ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction : %V2F64 = fdiv <vscale x 2 x double> undef, undef
125- ; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction : %V4F64 = fdiv <vscale x 4 x double> undef, undef
126- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
118+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:4 Lat:4 SizeLat:4 for : %V4F16 = fdiv <vscale x 4 x half> undef, undef
119+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:4 Lat:4 SizeLat:4 for : %V8F16 = fdiv <vscale x 8 x half> undef, undef
120+ ; CHECK-NEXT: Cost Model: Found costs of 4 for: %V16F16 = fdiv <vscale x 16 x half> undef, undef
121+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:4 Lat:4 SizeLat:4 for : %V2F32 = fdiv <vscale x 2 x float> undef, undef
122+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:4 Lat:4 SizeLat:4 for : %V4F32 = fdiv <vscale x 4 x float> undef, undef
123+ ; CHECK-NEXT: Cost Model: Found costs of 4 for: %V8F32 = fdiv <vscale x 8 x float> undef, undef
124+ ; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:4 Lat:4 SizeLat:4 for : %V2F64 = fdiv <vscale x 2 x double> undef, undef
125+ ; CHECK-NEXT: Cost Model: Found costs of 4 for: %V4F64 = fdiv <vscale x 4 x double> undef, undef
126+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
127127;
128128 %V4F16 = fdiv <vscale x 4 x half > undef , undef
129129 %V8F16 = fdiv <vscale x 8 x half > undef , undef
@@ -141,15 +141,15 @@ define void @fdiv() {
141141
142142define void @frem () {
143143; CHECK-LABEL: 'frem'
144- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V4F16 = frem <vscale x 4 x half> undef, undef
145- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V8F16 = frem <vscale x 8 x half> undef, undef
146- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V16F16 = frem <vscale x 16 x half> undef, undef
147- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V2F32 = frem <vscale x 2 x float> undef, undef
148- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V4F32 = frem <vscale x 4 x float> undef, undef
149- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V8F32 = frem <vscale x 8 x float> undef, undef
150- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V2F64 = frem <vscale x 2 x double> undef, undef
151- ; CHECK-NEXT: Cost Model: Invalid cost for instruction : %V4F64 = frem <vscale x 4 x double> undef, undef
152- ; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction : ret void
144+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V4F16 = frem <vscale x 4 x half> undef, undef
145+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V8F16 = frem <vscale x 8 x half> undef, undef
146+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V16F16 = frem <vscale x 16 x half> undef, undef
147+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V2F32 = frem <vscale x 2 x float> undef, undef
148+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V4F32 = frem <vscale x 4 x float> undef, undef
149+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V8F32 = frem <vscale x 8 x float> undef, undef
150+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V2F64 = frem <vscale x 2 x double> undef, undef
151+ ; CHECK-NEXT: Cost Model: Found costs of RThru: Invalid CodeSize:4 Lat:4 SizeLat:4 for : %V4F64 = frem <vscale x 4 x double> undef, undef
152+ ; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for : ret void
153153;
154154 %V4F16 = frem <vscale x 4 x half > undef , undef
155155 %V8F16 = frem <vscale x 8 x half > undef , undef
0 commit comments