brintos

brintos / llvm-project-archived public Read only

0
0
Text · 8.7 KiB · c0c21ec Raw
139 lines · plain
1; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z13 \2; RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-Z13 %s3; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output -mtriple=systemz-unknown -mcpu=z14 \4; RUN:   | FileCheck -check-prefix=CHECK -check-prefix=CHECK-Z14 %s5;6; Note: The scalarized vector instructions cost is not including any7; extracts, due to the undef operands8;9; Note: FRem is implemented with libcall, so not included here.10 11define void @fadd() {12  %res0 = fadd float undef, undef13  %res1 = fadd double undef, undef14  %res2 = fadd fp128 undef, undef15  %res3 = fadd <2 x float> undef, undef16  %res4 = fadd <2 x double> undef, undef17  %res5 = fadd <4 x float> undef, undef18  %res6 = fadd <4 x double> undef, undef19  %res7 = fadd <8 x float> undef, undef20  %res8 = fadd <8 x double> undef, undef21  %res9 = fadd <16 x float> undef, undef22  %res10 = fadd <16 x double> undef, undef23 24; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = fadd float undef, undef25; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = fadd double undef, undef26; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = fadd fp128 undef, undef27; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res3 = fadd <2 x float> undef, undef28; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = fadd <2 x float> undef, undef29; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = fadd <2 x double> undef, undef30; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res5 = fadd <4 x float> undef, undef31; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = fadd <4 x float> undef, undef32; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res6 = fadd <4 x double> undef, undef33; CHECK-Z13: Cost Model: Found an estimated cost of 16 for instruction:   %res7 = fadd <8 x float> undef, undef34; CHECK-Z14: Cost Model: Found an estimated cost of 2 for instruction:   %res7 = fadd <8 x float> undef, undef35; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res8 = fadd <8 x double> undef, undef36; CHECK-Z13: Cost Model: Found an estimated cost of 32 for instruction:   %res9 = fadd <16 x float> undef, undef37; CHECK-Z14: Cost Model: Found an estimated cost of 4 for instruction:   %res9 = fadd <16 x float> undef, undef38; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res10 = fadd <16 x double> undef, undef39 40  ret void;41}42 43define void @fsub() {44  %res0 = fsub float undef, undef45  %res1 = fsub double undef, undef46  %res2 = fsub fp128 undef, undef47  %res3 = fsub <2 x float> undef, undef48  %res4 = fsub <2 x double> undef, undef49  %res5 = fsub <4 x float> undef, undef50  %res6 = fsub <4 x double> undef, undef51  %res7 = fsub <8 x float> undef, undef52  %res8 = fsub <8 x double> undef, undef53  %res9 = fsub <16 x float> undef, undef54  %res10 = fsub <16 x double> undef, undef55 56; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = fsub float undef, undef57; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = fsub double undef, undef58; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = fsub fp128 undef, undef59; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res3 = fsub <2 x float> undef, undef60; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = fsub <2 x float> undef, undef61; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = fsub <2 x double> undef, undef62; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res5 = fsub <4 x float> undef, undef63; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = fsub <4 x float> undef, undef64; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res6 = fsub <4 x double> undef, undef65; CHECK-Z13: Cost Model: Found an estimated cost of 16 for instruction:   %res7 = fsub <8 x float> undef, undef66; CHECK-Z14: Cost Model: Found an estimated cost of 2 for instruction:   %res7 = fsub <8 x float> undef, undef67; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res8 = fsub <8 x double> undef, undef68; CHECK-Z13: Cost Model: Found an estimated cost of 32 for instruction:   %res9 = fsub <16 x float> undef, undef69; CHECK-Z14: Cost Model: Found an estimated cost of 4 for instruction:   %res9 = fsub <16 x float> undef, undef70; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res10 = fsub <16 x double> undef, undef71 72  ret void;73}74 75define void @fmul() {76  %res0 = fmul float undef, undef77  %res1 = fmul double undef, undef78  %res2 = fmul fp128 undef, undef79  %res3 = fmul <2 x float> undef, undef80  %res4 = fmul <2 x double> undef, undef81  %res5 = fmul <4 x float> undef, undef82  %res6 = fmul <4 x double> undef, undef83  %res7 = fmul <8 x float> undef, undef84  %res8 = fmul <8 x double> undef, undef85  %res9 = fmul <16 x float> undef, undef86  %res10 = fmul <16 x double> undef, undef87 88; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = fmul float undef, undef89; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = fmul double undef, undef90; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = fmul fp128 undef, undef91; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res3 = fmul <2 x float> undef, undef92; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = fmul <2 x float> undef, undef93; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = fmul <2 x double> undef, undef94; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res5 = fmul <4 x float> undef, undef95; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = fmul <4 x float> undef, undef96; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res6 = fmul <4 x double> undef, undef97; CHECK-Z13: Cost Model: Found an estimated cost of 16 for instruction:   %res7 = fmul <8 x float> undef, undef98; CHECK-Z14: Cost Model: Found an estimated cost of 2 for instruction:   %res7 = fmul <8 x float> undef, undef99; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res8 = fmul <8 x double> undef, undef100; CHECK-Z13: Cost Model: Found an estimated cost of 32 for instruction:   %res9 = fmul <16 x float> undef, undef101; CHECK-Z14: Cost Model: Found an estimated cost of 4 for instruction:   %res9 = fmul <16 x float> undef, undef102; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res10 = fmul <16 x double> undef, undef103 104  ret void;105}106 107define void @fdiv() {108  %res0 = fdiv float undef, undef109  %res1 = fdiv double undef, undef110  %res2 = fdiv fp128 undef, undef111  %res3 = fdiv <2 x float> undef, undef112  %res4 = fdiv <2 x double> undef, undef113  %res5 = fdiv <4 x float> undef, undef114  %res6 = fdiv <4 x double> undef, undef115  %res7 = fdiv <8 x float> undef, undef116  %res8 = fdiv <8 x double> undef, undef117  %res9 = fdiv <16 x float> undef, undef118  %res10 = fdiv <16 x double> undef, undef119 120; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res0 = fdiv float undef, undef121; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res1 = fdiv double undef, undef122; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res2 = fdiv fp128 undef, undef123; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res3 = fdiv <2 x float> undef, undef124; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res3 = fdiv <2 x float> undef, undef125; CHECK: Cost Model: Found an estimated cost of 1 for instruction:   %res4 = fdiv <2 x double> undef, undef126; CHECK-Z13: Cost Model: Found an estimated cost of 8 for instruction:   %res5 = fdiv <4 x float> undef, undef127; CHECK-Z14: Cost Model: Found an estimated cost of 1 for instruction:   %res5 = fdiv <4 x float> undef, undef128; CHECK: Cost Model: Found an estimated cost of 2 for instruction:   %res6 = fdiv <4 x double> undef, undef129; CHECK-Z13: Cost Model: Found an estimated cost of 16 for instruction:   %res7 = fdiv <8 x float> undef, undef130; CHECK-Z14: Cost Model: Found an estimated cost of 2 for instruction:   %res7 = fdiv <8 x float> undef, undef131; CHECK: Cost Model: Found an estimated cost of 4 for instruction:   %res8 = fdiv <8 x double> undef, undef132; CHECK-Z13: Cost Model: Found an estimated cost of 32 for instruction:   %res9 = fdiv <16 x float> undef, undef133; CHECK-Z14: Cost Model: Found an estimated cost of 4 for instruction:   %res9 = fdiv <16 x float> undef, undef134; CHECK: Cost Model: Found an estimated cost of 8 for instruction:   %res10 = fdiv <16 x double> undef, undef135 136  ret void;137}138 139