xref: /llvm-project/llvm/test/Analysis/CostModel/AMDGPU/fneg.ll (revision 38fffa630ee80163dc65e759392ad29798905679)
11f73f0c1SDaniil Fukalov; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py
24178e334SSimon Pilgrim; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck %s
34178e334SSimon Pilgrim; RUN: opt -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output -mtriple=amdgcn-unknown-amdhsa < %s | FileCheck -check-prefixes=SIZE %s
44f28a2ebSDaniil Fukalov; END.
5129388ddSdfukalov
63a2ef3a6SMatt Arsenaultdefine void @fneg_f16() {
71f73f0c1SDaniil Fukalov; CHECK-LABEL: 'fneg_f16'
81f73f0c1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f16 = fneg half undef
91f73f0c1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f16 = fneg <2 x half> undef
101f73f0c1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f16 = fneg <3 x half> undef
11cf362ff4SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f16 = fneg <4 x half> undef
12ab05ab59SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f16 = fneg <5 x half> undef
133a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f16 = fneg <8 x half> undef
14ab05ab59SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f16 = fneg <16 x half> undef
15ab05ab59SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v17f16 = fneg <17 x half> undef
161f73f0c1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
171f73f0c1SDaniil Fukalov;
181f73f0c1SDaniil Fukalov; SIZE-LABEL: 'fneg_f16'
191f73f0c1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f16 = fneg half undef
201f73f0c1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f16 = fneg <2 x half> undef
211f73f0c1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f16 = fneg <3 x half> undef
22cf362ff4SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f16 = fneg <4 x half> undef
23ab05ab59SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f16 = fneg <5 x half> undef
243a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f16 = fneg <8 x half> undef
25ab05ab59SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f16 = fneg <16 x half> undef
26ab05ab59SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v17f16 = fneg <17 x half> undef
271f73f0c1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
281f73f0c1SDaniil Fukalov;
294f28a2ebSDaniil Fukalov  %f16 = fneg half undef
304f28a2ebSDaniil Fukalov  %v2f16 = fneg <2 x half> undef
314f28a2ebSDaniil Fukalov  %v3f16 = fneg <3 x half> undef
32cf362ff4SDaniil Fukalov  %v4f16 = fneg <4 x half> undef
33cf362ff4SDaniil Fukalov  %v5f16 = fneg <5 x half> undef
343a2ef3a6SMatt Arsenault  %v8f16 = fneg <8 x half> undef
35ab05ab59SDaniil Fukalov  %v16f16 = fneg <16 x half> undef
36ab05ab59SDaniil Fukalov  %v17f16 = fneg <17 x half> undef
37129388ddSdfukalov  ret void
38129388ddSdfukalov}
39deaedab1SDaniil Fukalov
403a2ef3a6SMatt Arsenaultdefine void @fneg_bf16() {
413a2ef3a6SMatt Arsenault; CHECK-LABEL: 'fneg_bf16'
423a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f16 = fneg bfloat undef
433a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f16 = fneg <2 x bfloat> undef
443a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f16 = fneg <3 x bfloat> undef
453a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f16 = fneg <4 x bfloat> undef
463a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f16 = fneg <5 x bfloat> undef
473a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f16 = fneg <8 x bfloat> undef
483a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f16 = fneg <16 x bfloat> undef
493a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v17f16 = fneg <17 x bfloat> undef
503a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
513a2ef3a6SMatt Arsenault;
523a2ef3a6SMatt Arsenault; SIZE-LABEL: 'fneg_bf16'
533a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f16 = fneg bfloat undef
543a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f16 = fneg <2 x bfloat> undef
553a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f16 = fneg <3 x bfloat> undef
563a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f16 = fneg <4 x bfloat> undef
573a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f16 = fneg <5 x bfloat> undef
583a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f16 = fneg <8 x bfloat> undef
593a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f16 = fneg <16 x bfloat> undef
603a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v17f16 = fneg <17 x bfloat> undef
613a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
623a2ef3a6SMatt Arsenault;
633a2ef3a6SMatt Arsenault  %f16 = fneg bfloat undef
643a2ef3a6SMatt Arsenault  %v2f16 = fneg <2 x bfloat> undef
653a2ef3a6SMatt Arsenault  %v3f16 = fneg <3 x bfloat> undef
663a2ef3a6SMatt Arsenault  %v4f16 = fneg <4 x bfloat> undef
673a2ef3a6SMatt Arsenault  %v5f16 = fneg <5 x bfloat> undef
683a2ef3a6SMatt Arsenault  %v8f16 = fneg <8 x bfloat> undef
693a2ef3a6SMatt Arsenault  %v16f16 = fneg <16 x bfloat> undef
703a2ef3a6SMatt Arsenault  %v17f16 = fneg <17 x bfloat> undef
713a2ef3a6SMatt Arsenault  ret void
723a2ef3a6SMatt Arsenault}
733a2ef3a6SMatt Arsenault
743a2ef3a6SMatt Arsenaultdefine void @fneg_f32() {
753a2ef3a6SMatt Arsenault; CHECK-LABEL: 'fneg_f32'
763a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f32 = fneg float undef
773a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f32 = fneg <2 x float> undef
783a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f32 = fneg <3 x float> undef
793a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f32 = fneg <4 x float> undef
803a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f32 = fneg <5 x float> undef
813a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32 = fneg <8 x float> undef
823a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v9f32 = fneg <9 x float> undef
833a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32 = fneg <16 x float> undef
843a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
853a2ef3a6SMatt Arsenault;
863a2ef3a6SMatt Arsenault; SIZE-LABEL: 'fneg_f32'
873a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f32 = fneg float undef
883a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f32 = fneg <2 x float> undef
893a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f32 = fneg <3 x float> undef
903a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f32 = fneg <4 x float> undef
913a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f32 = fneg <5 x float> undef
923a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f32 = fneg <8 x float> undef
933a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v9f32 = fneg <9 x float> undef
943a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f32 = fneg <16 x float> undef
953a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
963a2ef3a6SMatt Arsenault;
973a2ef3a6SMatt Arsenault  %f32 = fneg float undef
983a2ef3a6SMatt Arsenault  %v2f32 = fneg <2 x float> undef
993a2ef3a6SMatt Arsenault  %v3f32 = fneg <3 x float> undef
1003a2ef3a6SMatt Arsenault  %v4f32 = fneg <4 x float> undef
1013a2ef3a6SMatt Arsenault  %v5f32 = fneg <5 x float> undef
1023a2ef3a6SMatt Arsenault  %v8f32 = fneg <8 x float> undef
1033a2ef3a6SMatt Arsenault  %v9f32 = fneg <9 x float> undef
1043a2ef3a6SMatt Arsenault  %v16f32 = fneg <16 x float> undef
1053a2ef3a6SMatt Arsenault  ret void
1063a2ef3a6SMatt Arsenault}
1073a2ef3a6SMatt Arsenault
1083a2ef3a6SMatt Arsenaultdefine void @fneg_f64() {
1093a2ef3a6SMatt Arsenault; CHECK-LABEL: 'fneg_f64'
1103a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f64 = fneg double undef
1113a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f64 = fneg <2 x double> undef
1123a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f64 = fneg <3 x double> undef
1133a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f64 = fneg <4 x double> undef
1143a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f64 = fneg <5 x double> undef
1153a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64 = fneg <8 x double> undef
1163a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f64 = fneg <16 x double> undef
1173a2ef3a6SMatt Arsenault; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret void
1183a2ef3a6SMatt Arsenault;
1193a2ef3a6SMatt Arsenault; SIZE-LABEL: 'fneg_f64'
1203a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %f64 = fneg double undef
1213a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v2f64 = fneg <2 x double> undef
1223a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v3f64 = fneg <3 x double> undef
1233a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v4f64 = fneg <4 x double> undef
1243a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v5f64 = fneg <5 x double> undef
1253a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v8f64 = fneg <8 x double> undef
1263a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 0 for instruction: %v16f64 = fneg <16 x double> undef
1273a2ef3a6SMatt Arsenault; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
1283a2ef3a6SMatt Arsenault;
1293a2ef3a6SMatt Arsenault  %f64 = fneg double undef
1303a2ef3a6SMatt Arsenault  %v2f64 = fneg <2 x double> undef
1313a2ef3a6SMatt Arsenault  %v3f64 = fneg <3 x double> undef
1323a2ef3a6SMatt Arsenault  %v4f64 = fneg <4 x double> undef
1333a2ef3a6SMatt Arsenault  %v5f64 = fneg <5 x double> undef
1343a2ef3a6SMatt Arsenault  %v8f64 = fneg <8 x double> undef
1353a2ef3a6SMatt Arsenault  %v16f64 = fneg <16 x double> undef
1363a2ef3a6SMatt Arsenault  ret void
1373a2ef3a6SMatt Arsenault}
1383a2ef3a6SMatt Arsenault
139deaedab1SDaniil Fukalovdefine i32 @fneg_idiom(i32 %arg) {
140deaedab1SDaniil Fukalov; CHECK-LABEL: 'fneg_idiom'
141deaedab1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %F32 = fsub float -0.000000e+00, undef
142*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4F32 = fsub <4 x float> splat (float -0.000000e+00), undef
143*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8F32 = fsub <8 x float> splat (float -0.000000e+00), undef
144*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16F32 = fsub <16 x float> splat (float -0.000000e+00), undef
145deaedab1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %F64 = fsub double -0.000000e+00, undef
146*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V2F64 = fsub <2 x double> splat (double -0.000000e+00), undef
147*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 16 for instruction: %V4F64 = fsub <4 x double> splat (double -0.000000e+00), undef
148*38fffa63SPaul Walker; CHECK-NEXT:  Cost Model: Found an estimated cost of 96 for instruction: %V8F64 = fsub <8 x double> splat (double -0.000000e+00), undef
149deaedab1SDaniil Fukalov; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: ret i32 undef
150deaedab1SDaniil Fukalov;
151deaedab1SDaniil Fukalov; SIZE-LABEL: 'fneg_idiom'
152deaedab1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: %F32 = fsub float -0.000000e+00, undef
153*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V4F32 = fsub <4 x float> splat (float -0.000000e+00), undef
154*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V8F32 = fsub <8 x float> splat (float -0.000000e+00), undef
155*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V16F32 = fsub <16 x float> splat (float -0.000000e+00), undef
156deaedab1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 2 for instruction: %F64 = fsub double -0.000000e+00, undef
157*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 4 for instruction: %V2F64 = fsub <2 x double> splat (double -0.000000e+00), undef
158*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %V4F64 = fsub <4 x double> splat (double -0.000000e+00), undef
159*38fffa63SPaul Walker; SIZE-NEXT:  Cost Model: Found an estimated cost of 48 for instruction: %V8F64 = fsub <8 x double> splat (double -0.000000e+00), undef
160deaedab1SDaniil Fukalov; SIZE-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret i32 undef
161deaedab1SDaniil Fukalov;
162deaedab1SDaniil Fukalov  %F32 = fsub float -0.0, undef
163deaedab1SDaniil Fukalov  %V4F32 = fsub <4 x float> <float -0.0, float -0.0, float -0.0, float -0.0>, undef
164deaedab1SDaniil Fukalov  %V8F32 = fsub <8 x float> <float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0>, undef
165deaedab1SDaniil Fukalov  %V16F32 = fsub <16 x float> <float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0, float -0.0>, undef
166deaedab1SDaniil Fukalov
167deaedab1SDaniil Fukalov  %F64 = fsub double -0.0, undef
168deaedab1SDaniil Fukalov  %V2F64 = fsub <2 x double> <double -0.0, double -0.0>, undef
169deaedab1SDaniil Fukalov  %V4F64 = fsub <4 x double> <double -0.0, double -0.0, double -0.0, double -0.0>, undef
170deaedab1SDaniil Fukalov  %V8F64 = fsub <8 x double> <double -0.0, double -0.0, double -0.0, double -0.0, double -0.0, double -0.0, double -0.0, double -0.0>, undef
171deaedab1SDaniil Fukalov
172deaedab1SDaniil Fukalov  ret i32 undef
173deaedab1SDaniil Fukalov}
174