641 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py2; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=slm | FileCheck %s --check-prefixes=CHECK,SLM3; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=goldmont | FileCheck %s --check-prefixes=CHECK,GLM4; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=goldmont-plus | FileCheck %s --check-prefixes=CHECK,GLM5; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mcpu=tremont | FileCheck %s --check-prefixes=CHECK,GLM6 7target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"8target triple = "x86_64-unknown-linux-gnu"9 10define <2 x i64> @slm-costs_64_vector_add(<2 x i64> %a, <2 x i64> %b) {11; SLM-LABEL: 'slm-costs_64_vector_add'12; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = add <2 x i64> %a, %b13; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res14;15; GLM-LABEL: 'slm-costs_64_vector_add'16; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = add <2 x i64> %a, %b17; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res18;19entry:20 %res = add <2 x i64> %a, %b21 ret <2 x i64> %res22}23 24define <2 x i64> @slm-costs_64_vector_sub(<2 x i64> %a, <2 x i64> %b) {25; SLM-LABEL: 'slm-costs_64_vector_sub'26; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = sub <2 x i64> %a, %b27; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res28;29; GLM-LABEL: 'slm-costs_64_vector_sub'30; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = sub <2 x i64> %a, %b31; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res32;33entry:34 %res = sub <2 x i64> %a, %b35 ret <2 x i64> %res36}37 38; 8bit mul39define i8 @slm-costs_8_scalar_mul(i8 %a, i8 %b) {40; CHECK-LABEL: 'slm-costs_8_scalar_mul'41; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %res = mul nsw i8 %a, %b42; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i8 %res43;44entry:45 %res = mul nsw i8 %a, %b46 ret i8 %res47}48 49define <2 x i8> @slm-costs_8_v2_mul(<2 x i8> %a, <2 x i8> %b) {50; SLM-LABEL: 'slm-costs_8_v2_mul'51; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <2 x i8> %a, %b52; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res53;54; GLM-LABEL: 'slm-costs_8_v2_mul'55; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <2 x i8> %a, %b56; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i8> %res57;58entry:59 %res = mul nsw <2 x i8> %a, %b60 ret <2 x i8> %res61}62 63define <4 x i8> @slm-costs_8_v4_mul(<4 x i8> %a, <4 x i8> %b) {64; SLM-LABEL: 'slm-costs_8_v4_mul'65; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i8> %a, %b66; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res67;68; GLM-LABEL: 'slm-costs_8_v4_mul'69; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <4 x i8> %a, %b70; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i8> %res71;72entry:73 %res = mul nsw <4 x i8> %a, %b74 ret <4 x i8> %res75}76 77define <4 x i32> @slm-costs_8_v4_zext_mul(<4 x i8> %a) {78; SLM-LABEL: 'slm-costs_8_v4_zext_mul'79; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>80; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, splat (i32 255)81; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res82;83; GLM-LABEL: 'slm-costs_8_v4_zext_mul'84; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>85; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, splat (i32 255)86; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res87;88entry:89 %zext = zext <4 x i8> %a to <4 x i32>90 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 255, i32 255>91 ret <4 x i32> %res92}93 94define <4 x i32> @slm-costs_8_v4_zext_mul_fail(<4 x i8> %a) {95; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'96; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>97; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>98; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res99;100; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail'101; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>102; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>103; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res104;105entry:106 %zext = zext <4 x i8> %a to <4 x i32>107 %res = mul nsw <4 x i32> %zext, <i32 255, i32 255, i32 -1, i32 255>108 ret <4 x i32> %res109}110 111define <4 x i32> @slm-costs_8_v4_zext_mul_fail_2(<4 x i8> %a) {112; SLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'113; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>114; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>115; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res116;117; GLM-LABEL: 'slm-costs_8_v4_zext_mul_fail_2'118; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i8> %a to <4 x i32>119; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>120; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res121;122entry:123 %zext = zext <4 x i8> %a to <4 x i32>124 %res = mul nsw <4 x i32> %zext, <i32 255, i32 256, i32 255, i32 255>125 ret <4 x i32> %res126}127 128define <4 x i32> @slm-costs_8_v4_sext_mul(<4 x i8> %a) {129; SLM-LABEL: 'slm-costs_8_v4_sext_mul'130; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>131; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>132; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res133;134; GLM-LABEL: 'slm-costs_8_v4_sext_mul'135; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>136; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>137; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res138;139entry:140 %sext = sext <4 x i8> %a to <4 x i32>141 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 127, i32 -128>142 ret <4 x i32> %res143}144 145define <4 x i32> @slm-costs_8_v4_sext_mul_fail(<4 x i8> %a) {146; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'147; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>148; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>149; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res150;151; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail'152; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>153; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>154; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res155;156entry:157 %sext = sext <4 x i8> %a to <4 x i32>158 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -128, i32 128, i32 -128>159 ret <4 x i32> %res160}161 162define <4 x i32> @slm-costs_8_v4_sext_mul_fail_2(<4 x i8> %a) {163; SLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'164; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>165; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>166; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res167;168; GLM-LABEL: 'slm-costs_8_v4_sext_mul_fail_2'169; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i8> %a to <4 x i32>170; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>171; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res172;173entry:174 %sext = sext <4 x i8> %a to <4 x i32>175 %res = mul nsw <4 x i32> %sext, <i32 127, i32 -129, i32 127, i32 -128>176 ret <4 x i32> %res177}178 179define <8 x i8> @slm-costs_8_v8_mul(<8 x i8> %a, <8 x i8> %b) {180; SLM-LABEL: 'slm-costs_8_v8_mul'181; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <8 x i8> %a, %b182; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res183;184; GLM-LABEL: 'slm-costs_8_v8_mul'185; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <8 x i8> %a, %b186; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i8> %res187;188entry:189 %res = mul nsw <8 x i8> %a, %b190 ret <8 x i8> %res191}192 193define <16 x i8> @slm-costs_8_v16_mul(<16 x i8> %a, <16 x i8> %b) {194; CHECK-LABEL: 'slm-costs_8_v16_mul'195; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <16 x i8> %a, %b196; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i8> %res197;198entry:199 %res = mul nsw <16 x i8> %a, %b200 ret <16 x i8> %res201}202 203; 16bit mul204define i16 @slm-costs_16_scalar_mul(i16 %a, i16 %b) {205; CHECK-LABEL: 'slm-costs_16_scalar_mul'206; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw i16 %a, %b207; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i16 %res208;209entry:210 %res = mul nsw i16 %a, %b211 ret i16 %res212}213 214define <2 x i16> @slm-costs_16_v2_mul(<2 x i16> %a, <2 x i16> %b) {215; SLM-LABEL: 'slm-costs_16_v2_mul'216; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i16> %a, %b217; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res218;219; GLM-LABEL: 'slm-costs_16_v2_mul'220; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <2 x i16> %a, %b221; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i16> %res222;223entry:224 %res = mul nsw <2 x i16> %a, %b225 ret <2 x i16> %res226}227 228define <4 x i16> @slm-costs_16_v4_mul(<4 x i16> %a, <4 x i16> %b) {229; SLM-LABEL: 'slm-costs_16_v4_mul'230; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i16> %a, %b231; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res232;233; GLM-LABEL: 'slm-costs_16_v4_mul'234; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i16> %a, %b235; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i16> %res236;237entry:238 %res = mul nsw <4 x i16> %a, %b239 ret <4 x i16> %res240}241 242define <4 x i32> @slm-costs_16_v4_zext_mul(<4 x i16> %a) {243; SLM-LABEL: 'slm-costs_16_v4_zext_mul'244; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>245; SLM-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %res = mul nsw <4 x i32> %zext, splat (i32 65535)246; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res247;248; GLM-LABEL: 'slm-costs_16_v4_zext_mul'249; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>250; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, splat (i32 65535)251; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res252;253entry:254 %zext = zext <4 x i16> %a to <4 x i32>255 %res = mul nsw <4 x i32> %zext, <i32 65535, i32 65535, i32 65535, i32 65535>256 ret <4 x i32> %res257}258 259define <4 x i32> @slm-costs_16_v4_zext_mul_fail(<4 x i16> %a) {260; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'261; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>262; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>263; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res264;265; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail'266; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>267; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>268; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res269;270entry:271 %zext = zext <4 x i16> %a to <4 x i32>272 %res = mul nsw <4 x i32> %zext, <i32 -1, i32 65535, i32 65535, i32 65535>273 ret <4 x i32> %res274}275 276define <4 x i32> @slm-costs_16_v4_zext_mul_fail_2(<4 x i16> %a) {277; SLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'278; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>279; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>280; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res281;282; GLM-LABEL: 'slm-costs_16_v4_zext_mul_fail_2'283; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %zext = zext <4 x i16> %a to <4 x i32>284; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>285; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res286;287entry:288 %zext = zext <4 x i16> %a to <4 x i32>289 %res = mul nsw <4 x i32> %zext, <i32 65536, i32 65535, i32 65535, i32 65535>290 ret <4 x i32> %res291}292 293define <4 x i32> @slm-costs_16_v4_sext_mul(<4 x i16> %a) {294; SLM-LABEL: 'slm-costs_16_v4_sext_mul'295; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>296; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>297; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res298;299; GLM-LABEL: 'slm-costs_16_v4_sext_mul'300; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>301; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>302; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res303;304entry:305 %sext = sext <4 x i16> %a to <4 x i32>306 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32768>307 ret <4 x i32> %res308}309 310define <4 x i32> @slm-costs_16_v4_sext_mul_fail(<4 x i16> %a) {311; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'312; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>313; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>314; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res315;316; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail'317; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>318; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>319; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res320;321entry:322 %sext = sext <4 x i16> %a to <4 x i32>323 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32768, i32 -32768>324 ret <4 x i32> %res325}326 327define <4 x i32> @slm-costs_16_v4_sext_mul_fail_2(<4 x i16> %a) {328; SLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'329; SLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>330; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>331; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res332;333; GLM-LABEL: 'slm-costs_16_v4_sext_mul_fail_2'334; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %sext = sext <4 x i16> %a to <4 x i32>335; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>336; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res337;338entry:339 %sext = sext <4 x i16> %a to <4 x i32>340 %res = mul nsw <4 x i32> %sext, <i32 32767, i32 -32768, i32 32767, i32 -32769>341 ret <4 x i32> %res342}343 344define <8 x i16> @slm-costs_16_v8_mul(<8 x i16> %a, <8 x i16> %b) {345; SLM-LABEL: 'slm-costs_16_v8_mul'346; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <8 x i16> %a, %b347; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res348;349; GLM-LABEL: 'slm-costs_16_v8_mul'350; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw <8 x i16> %a, %b351; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i16> %res352;353entry:354 %res = mul nsw <8 x i16> %a, %b355 ret <8 x i16> %res356}357 358define <16 x i16> @slm-costs_16_v16_mul(<16 x i16> %a, <16 x i16> %b) {359; SLM-LABEL: 'slm-costs_16_v16_mul'360; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <16 x i16> %a, %b361; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res362;363; GLM-LABEL: 'slm-costs_16_v16_mul'364; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <16 x i16> %a, %b365; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i16> %res366;367entry:368 %res = mul nsw <16 x i16> %a, %b369 ret <16 x i16> %res370}371 372; 32bit mul373define i32 @slm-costs_32_scalar_mul(i32 %a, i32 %b) {374; CHECK-LABEL: 'slm-costs_32_scalar_mul'375; CHECK-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = mul nsw i32 %a, %b376; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i32 %res377;378entry:379 %res = mul nsw i32 %a, %b380 ret i32 %res381}382 383define <2 x i32> @slm-costs_32_v2_mul(<2 x i32> %a, <2 x i32> %b) {384; SLM-LABEL: 'slm-costs_32_v2_mul'385; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <2 x i32> %a, %b386; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res387;388; GLM-LABEL: 'slm-costs_32_v2_mul'389; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <2 x i32> %a, %b390; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i32> %res391;392entry:393 %res = mul nsw <2 x i32> %a, %b394 ret <2 x i32> %res395}396 397define <4 x i32> @slm-costs_32_v4_mul(<4 x i32> %a, <4 x i32> %b) {398; SLM-LABEL: 'slm-costs_32_v4_mul'399; SLM-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %res = mul nsw <4 x i32> %a, %b400; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res401;402; GLM-LABEL: 'slm-costs_32_v4_mul'403; GLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw <4 x i32> %a, %b404; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i32> %res405;406entry:407 %res = mul nsw <4 x i32> %a, %b408 ret <4 x i32> %res409}410 411define <8 x i32> @slm-costs_32_v8_mul(<8 x i32> %a, <8 x i32> %b) {412; SLM-LABEL: 'slm-costs_32_v8_mul'413; SLM-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %res = mul nsw <8 x i32> %a, %b414; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res415;416; GLM-LABEL: 'slm-costs_32_v8_mul'417; GLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = mul nsw <8 x i32> %a, %b418; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i32> %res419;420entry:421 %res = mul nsw <8 x i32> %a, %b422 ret <8 x i32> %res423}424 425define <16 x i32> @slm-costs_32_v16_mul(<16 x i32> %a, <16 x i32> %b) {426; SLM-LABEL: 'slm-costs_32_v16_mul'427; SLM-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %res = mul nsw <16 x i32> %a, %b428; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res429;430; GLM-LABEL: 'slm-costs_32_v16_mul'431; GLM-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %res = mul nsw <16 x i32> %a, %b432; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i32> %res433;434entry:435 %res = mul nsw <16 x i32> %a, %b436 ret <16 x i32> %res437}438 439; 64bit mul440define i64 @slm-costs_64_scalar_mul(i64 %a, i64 %b) {441; CHECK-LABEL: 'slm-costs_64_scalar_mul'442; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = mul nsw i64 %a, %b443; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret i64 %res444;445entry:446 %res = mul nsw i64 %a, %b447 ret i64 %res448}449 450define <2 x i64> @slm-costs_64_v2_mul(<2 x i64> %a, <2 x i64> %b) {451; SLM-LABEL: 'slm-costs_64_v2_mul'452; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = mul nsw <2 x i64> %a, %b453; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res454;455; GLM-LABEL: 'slm-costs_64_v2_mul'456; GLM-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %res = mul nsw <2 x i64> %a, %b457; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x i64> %res458;459entry:460 %res = mul nsw <2 x i64> %a, %b461 ret <2 x i64> %res462}463 464define <4 x i64> @slm-costs_64_v4_mul(<4 x i64> %a, <4 x i64> %b) {465; SLM-LABEL: 'slm-costs_64_v4_mul'466; SLM-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %res = mul nsw <4 x i64> %a, %b467; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res468;469; GLM-LABEL: 'slm-costs_64_v4_mul'470; GLM-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %res = mul nsw <4 x i64> %a, %b471; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x i64> %res472;473entry:474 %res = mul nsw <4 x i64> %a, %b475 ret <4 x i64> %res476}477 478define <8 x i64> @slm-costs_64_v8_mul(<8 x i64> %a, <8 x i64> %b) {479; SLM-LABEL: 'slm-costs_64_v8_mul'480; SLM-NEXT: Cost Model: Found an estimated cost of 68 for instruction: %res = mul nsw <8 x i64> %a, %b481; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res482;483; GLM-LABEL: 'slm-costs_64_v8_mul'484; GLM-NEXT: Cost Model: Found an estimated cost of 24 for instruction: %res = mul nsw <8 x i64> %a, %b485; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <8 x i64> %res486;487entry:488 %res = mul nsw <8 x i64> %a, %b489 ret <8 x i64> %res490}491 492define <16 x i64> @slm-costs_64_v16_mul(<16 x i64> %a, <16 x i64> %b) {493; SLM-LABEL: 'slm-costs_64_v16_mul'494; SLM-NEXT: Cost Model: Found an estimated cost of 136 for instruction: %res = mul nsw <16 x i64> %a, %b495; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res496;497; GLM-LABEL: 'slm-costs_64_v16_mul'498; GLM-NEXT: Cost Model: Found an estimated cost of 48 for instruction: %res = mul nsw <16 x i64> %a, %b499; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <16 x i64> %res500;501entry:502 %res = mul nsw <16 x i64> %a, %b503 ret <16 x i64> %res504}505 506; mulsd507define double @slm-costs_mulsd(double %a, double %b) {508; SLM-LABEL: 'slm-costs_mulsd'509; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul double %a, %b510; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res511;512; GLM-LABEL: 'slm-costs_mulsd'513; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul double %a, %b514; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res515;516entry:517 %res = fmul double %a, %b518 ret double %res519}520 521; mulpd522define <2 x double> @slm-costs_mulpd(<2 x double> %a, <2 x double> %b) {523; SLM-LABEL: 'slm-costs_mulpd'524; SLM-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %res = fmul <2 x double> %a, %b525; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res526;527; GLM-LABEL: 'slm-costs_mulpd'528; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <2 x double> %a, %b529; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res530;531entry:532 %res = fmul <2 x double> %a, %b533 ret <2 x double> %res534}535 536; mulps537define <4 x float> @slm-costs_mulps(<4 x float> %a, <4 x float> %b) {538; SLM-LABEL: 'slm-costs_mulps'539; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fmul <4 x float> %a, %b540; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res541;542; GLM-LABEL: 'slm-costs_mulps'543; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fmul <4 x float> %a, %b544; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res545;546entry:547 %res = fmul <4 x float> %a, %b548 ret <4 x float> %res549}550 551; divss552define float @slm-costs_divss(float %a, float %b) {553; SLM-LABEL: 'slm-costs_divss'554; SLM-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %res = fdiv float %a, %b555; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res556;557; GLM-LABEL: 'slm-costs_divss'558; GLM-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %res = fdiv float %a, %b559; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float %res560;561entry:562 %res = fdiv float %a, %b563 ret float %res564}565 566; divps567define <4 x float> @slm-costs_divps(<4 x float> %a, <4 x float> %b) {568; SLM-LABEL: 'slm-costs_divps'569; SLM-NEXT: Cost Model: Found an estimated cost of 39 for instruction: %res = fdiv <4 x float> %a, %b570; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res571;572; GLM-LABEL: 'slm-costs_divps'573; GLM-NEXT: Cost Model: Found an estimated cost of 35 for instruction: %res = fdiv <4 x float> %a, %b574; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <4 x float> %res575;576entry:577 %res = fdiv <4 x float> %a, %b578 ret <4 x float> %res579}580 581; divsd582define double @slm-costs_divsd(double %a, double %b) {583; SLM-LABEL: 'slm-costs_divsd'584; SLM-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %res = fdiv double %a, %b585; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res586;587; GLM-LABEL: 'slm-costs_divsd'588; GLM-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %res = fdiv double %a, %b589; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double %res590;591entry:592 %res = fdiv double %a, %b593 ret double %res594}595 596; divpd597define <2 x double> @slm-costs_divpd(<2 x double> %a, <2 x double> %b) {598; SLM-LABEL: 'slm-costs_divpd'599; SLM-NEXT: Cost Model: Found an estimated cost of 69 for instruction: %res = fdiv <2 x double> %a, %b600; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res601;602; GLM-LABEL: 'slm-costs_divpd'603; GLM-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %res = fdiv <2 x double> %a, %b604; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res605;606entry:607 %res = fdiv <2 x double> %a, %b608 ret <2 x double> %res609}610 611; addpd612define <2 x double> @slm-costs_addpd(<2 x double> %a, <2 x double> %b) {613; SLM-LABEL: 'slm-costs_addpd'614; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fadd <2 x double> %a, %b615; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res616;617; GLM-LABEL: 'slm-costs_addpd'618; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fadd <2 x double> %a, %b619; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res620;621entry:622 %res = fadd <2 x double> %a, %b623 ret <2 x double> %res624}625 626; subpd627define <2 x double> @slm-costs_subpd(<2 x double> %a, <2 x double> %b) {628; SLM-LABEL: 'slm-costs_subpd'629; SLM-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %res = fsub <2 x double> %a, %b630; SLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res631;632; GLM-LABEL: 'slm-costs_subpd'633; GLM-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %res = fsub <2 x double> %a, %b634; GLM-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret <2 x double> %res635;636entry:637 %res = fsub <2 x double> %a, %b638 ret <2 x double> %res639}640 641