133 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt -passes="print<cost-model>" 2>&1 -disable-output -cost-kind=all -mtriple=aarch64 < %s | FileCheck %s3 4; Verify the cost of (vector) multiply instructions.5 6target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"7 8define <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b) {9; CHECK-LABEL: 't1'10; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <2 x i8> %a, %b11; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i8> %112;13 %1 = mul <2 x i8> %a, %b14 ret <2 x i8> %115}16 17define <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b) {18; CHECK-LABEL: 't2'19; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <4 x i8> %a, %b20; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i8> %121;22 %1 = mul <4 x i8> %a, %b23 ret <4 x i8> %124}25 26define <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b) {27; CHECK-LABEL: 't3'28; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <8 x i8> %a, %b29; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i8> %130;31 %1 = mul <8 x i8> %a, %b32 ret <8 x i8> %133}34 35define <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b) {36; CHECK-LABEL: 't4'37; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <16 x i8> %a, %b38; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <16 x i8> %139;40 %1 = mul <16 x i8> %a, %b41 ret <16 x i8> %142}43 44define <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b) {45; CHECK-LABEL: 't5'46; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %1 = mul <32 x i8> %a, %b47; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <32 x i8> %148;49 %1 = mul <32 x i8> %a, %b50 ret <32 x i8> %151}52 53define <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b) {54; CHECK-LABEL: 't6'55; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <2 x i16> %a, %b56; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i16> %157;58 %1 = mul <2 x i16> %a, %b59 ret <2 x i16> %160}61 62define <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b) {63; CHECK-LABEL: 't7'64; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <4 x i16> %a, %b65; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i16> %166;67 %1 = mul <4 x i16> %a, %b68 ret <4 x i16> %169}70 71define <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b) {72; CHECK-LABEL: 't8'73; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <8 x i16> %a, %b74; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i16> %175;76 %1 = mul <8 x i16> %a, %b77 ret <8 x i16> %178}79 80define <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b) {81; CHECK-LABEL: 't9'82; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %1 = mul <16 x i16> %a, %b83; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <16 x i16> %184;85 %1 = mul <16 x i16> %a, %b86 ret <16 x i16> %187}88 89define <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b) {90; CHECK-LABEL: 't10'91; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <2 x i32> %a, %b92; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i32> %193;94 %1 = mul <2 x i32> %a, %b95 ret <2 x i32> %196}97 98define <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b) {99; CHECK-LABEL: 't11'100; CHECK-NEXT: Cost Model: Found costs of 1 for: %1 = mul <4 x i32> %a, %b101; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i32> %1102;103 %1 = mul <4 x i32> %a, %b104 ret <4 x i32> %1105}106 107define <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b) {108; CHECK-LABEL: 't12'109; CHECK-NEXT: Cost Model: Found costs of RThru:2 CodeSize:1 Lat:1 SizeLat:1 for: %1 = mul <8 x i32> %a, %b110; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <8 x i32> %1111;112 %1 = mul <8 x i32> %a, %b113 ret <8 x i32> %1114}115 116define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) {117; CHECK-LABEL: 't13'118; CHECK-NEXT: Cost Model: Found costs of RThru:14 CodeSize:1 Lat:1 SizeLat:1 for: %1 = mul nsw <2 x i64> %a, %b119; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <2 x i64> %1120;121 %1 = mul nsw <2 x i64> %a, %b122 ret <2 x i64> %1123}124 125define <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b) {126; CHECK-LABEL: 't14'127; CHECK-NEXT: Cost Model: Found costs of RThru:28 CodeSize:1 Lat:1 SizeLat:1 for: %1 = mul nsw <4 x i64> %a, %b128; CHECK-NEXT: Cost Model: Found costs of RThru:0 CodeSize:1 Lat:1 SizeLat:1 for: ret <4 x i64> %1129;130 %1 = mul nsw <4 x i64> %a, %b131 ret <4 x i64> %1132}133