1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py 2; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -passes='print<cost-model>' -cost-kind=throughput 2>&1 -disable-output | FileCheck %s --check-prefix=THROUGHPUT 3 4; Verify the cost of (vector) multiply instructions. 5 6define <2 x i8> @t1(<2 x i8> %a, <2 x i8> %b) { 7; THROUGHPUT-LABEL: 't1' 8; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i8> %a, %b 9; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %1 10; 11 %1 = mul <2 x i8> %a, %b 12 ret <2 x i8> %1 13} 14 15define <4 x i8> @t2(<4 x i8> %a, <4 x i8> %b) { 16; THROUGHPUT-LABEL: 't2' 17; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i8> %a, %b 18; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %1 19; 20 %1 = mul <4 x i8> %a, %b 21 ret <4 x i8> %1 22} 23 24define <8 x i8> @t3(<8 x i8> %a, <8 x i8> %b) { 25; THROUGHPUT-LABEL: 't3' 26; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i8> %a, %b 27; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %1 28; 29 %1 = mul <8 x i8> %a, %b 30 ret <8 x i8> %1 31} 32 33define <16 x i8> @t4(<16 x i8> %a, <16 x i8> %b) { 34; THROUGHPUT-LABEL: 't4' 35; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <16 x i8> %a, %b 36; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %1 37; 38 %1 = mul <16 x i8> %a, %b 39 ret <16 x i8> %1 40} 41 42define <32 x i8> @t5(<32 x i8> %a, <32 x i8> %b) { 43; THROUGHPUT-LABEL: 't5' 44; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <32 x i8> %a, %b 45; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <32 x i8> %1 46; 47 %1 = mul <32 x i8> %a, %b 48 ret <32 x i8> %1 49} 50 51define <2 x i16> @t6(<2 x i16> %a, <2 x i16> %b) { 52; THROUGHPUT-LABEL: 't6' 53; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i16> %a, %b 54; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %1 55; 56 %1 = mul <2 x i16> %a, %b 57 ret <2 x i16> %1 58} 59 60define <4 x i16> @t7(<4 x i16> %a, <4 x i16> %b) { 61; THROUGHPUT-LABEL: 't7' 62; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i16> %a, %b 63; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %1 64; 65 %1 = mul <4 x i16> %a, %b 66 ret <4 x i16> %1 67} 68 69define <8 x i16> @t8(<8 x i16> %a, <8 x i16> %b) { 70; THROUGHPUT-LABEL: 't8' 71; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <8 x i16> %a, %b 72; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %1 73; 74 %1 = mul <8 x i16> %a, %b 75 ret <8 x i16> %1 76} 77 78define <16 x i16> @t9(<16 x i16> %a, <16 x i16> %b) { 79; THROUGHPUT-LABEL: 't9' 80; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <16 x i16> %a, %b 81; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %1 82; 83 %1 = mul <16 x i16> %a, %b 84 ret <16 x i16> %1 85} 86 87define <2 x i32> @t10(<2 x i32> %a, <2 x i32> %b) { 88; THROUGHPUT-LABEL: 't10' 89; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <2 x i32> %a, %b 90; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %1 91; 92 %1 = mul <2 x i32> %a, %b 93 ret <2 x i32> %1 94} 95 96define <4 x i32> @t11(<4 x i32> %a, <4 x i32> %b) { 97; THROUGHPUT-LABEL: 't11' 98; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = mul <4 x i32> %a, %b 99; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %1 100; 101 %1 = mul <4 x i32> %a, %b 102 ret <4 x i32> %1 103} 104 105define <8 x i32> @t12(<8 x i32> %a, <8 x i32> %b) { 106; THROUGHPUT-LABEL: 't12' 107; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = mul <8 x i32> %a, %b 108; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %1 109; 110 %1 = mul <8 x i32> %a, %b 111 ret <8 x i32> %1 112} 113 114define <2 x i64> @t13(<2 x i64> %a, <2 x i64> %b) { 115; THROUGHPUT-LABEL: 't13' 116; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 14 for instruction: %1 = mul nsw <2 x i64> %a, %b 117; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %1 118; 119 %1 = mul nsw <2 x i64> %a, %b 120 ret <2 x i64> %1 121} 122 123define <4 x i64> @t14(<4 x i64> %a, <4 x i64> %b) { 124; THROUGHPUT-LABEL: 't14' 125; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 28 for instruction: %1 = mul nsw <4 x i64> %a, %b 126; THROUGHPUT-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %1 127; 128 %1 = mul nsw <4 x i64> %a, %b 129 ret <4 x i64> %1 130} 131