1; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py UTC_ARGS: --version 4 2; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s 3; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=throughput 2>&1 -disable-output | FileCheck %s 4; RUN: opt < %s -mtriple=riscv32 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE 5; RUN: opt < %s -mtriple=riscv64 -mattr=+v -passes="print<cost-model>" -cost-kind=code-size 2>&1 -disable-output | FileCheck %s --check-prefix=SIZE 6 7define float @reduce_fmaximum_f32(float %arg) { 8; CHECK-LABEL: 'reduce_fmaximum_f32' 9; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V2 = call float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 10; CHECK-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V4 = call float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 11; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %V8 = call float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 12; CHECK-NEXT: Cost Model: Found an estimated cost of 12 for instruction: %V16 = call float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 13; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V32 = call float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 14; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V64 = call float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 15; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %V128 = call float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 16; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = call fast float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 17; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = call fast float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 18; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %3 = call fast float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 19; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %4 = call fast float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 20; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %5 = call fast float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 21; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %6 = call fast float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 22; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %7 = call fast float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 23; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret float undef 24; 25; SIZE-LABEL: 'reduce_fmaximum_f32' 26; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V2 = call float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 27; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V4 = call float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 28; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V8 = call float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 29; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 30; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V32 = call float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 31; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V64 = call float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 32; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V128 = call float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 33; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = call fast float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 34; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = call fast float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 35; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %3 = call fast float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 36; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %4 = call fast float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 37; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call fast float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 38; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %6 = call fast float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 39; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %7 = call fast float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 40; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret float undef 41; 42%V2 = call float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 43%V4 = call float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 44%V8 = call float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 45%V16 = call float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 46%V32 = call float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 47%V64 = call float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 48%V128 = call float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 49call fast float @llvm.vector.reduce.fmaximum.v2f32(<2 x float> undef) 50call fast float @llvm.vector.reduce.fmaximum.v4f32(<4 x float> undef) 51call fast float @llvm.vector.reduce.fmaximum.v8f32(<8 x float> undef) 52call fast float @llvm.vector.reduce.fmaximum.v16f32(<16 x float> undef) 53call fast float @llvm.vector.reduce.fmaximum.v32f32(<32 x float> undef) 54call fast float @llvm.vector.reduce.fmaximum.v64f32(<64 x float> undef) 55call fast float @llvm.vector.reduce.fmaximum.v128f32(<128 x float> undef) 56ret float undef 57} 58declare float @llvm.vector.reduce.fmaximum.v2f32(<2 x float>) 59declare float @llvm.vector.reduce.fmaximum.v4f32(<4 x float>) 60declare float @llvm.vector.reduce.fmaximum.v8f32(<8 x float>) 61declare float @llvm.vector.reduce.fmaximum.v16f32(<16 x float>) 62declare float @llvm.vector.reduce.fmaximum.v32f32(<32 x float>) 63declare float @llvm.vector.reduce.fmaximum.v64f32(<64 x float>) 64declare float @llvm.vector.reduce.fmaximum.v128f32(<128 x float>) 65 66define double @reduce_fmaximum_f64(double %arg) { 67; CHECK-LABEL: 'reduce_fmaximum_f64' 68; CHECK-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %V2 = call double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 69; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V4 = call double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 70; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %V8 = call double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 71; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V16 = call double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 72; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V32 = call double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 73; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V64 = call double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 74; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = call fast double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 75; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %2 = call fast double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 76; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %3 = call fast double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 77; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %4 = call fast double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 78; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %5 = call fast double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 79; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %6 = call fast double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 80; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret double undef 81; 82; SIZE-LABEL: 'reduce_fmaximum_f64' 83; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V2 = call double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 84; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V4 = call double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 85; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V8 = call double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 86; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V16 = call double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 87; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V32 = call double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 88; SIZE-NEXT: Cost Model: Found an estimated cost of 7 for instruction: %V64 = call double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 89; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = call fast double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 90; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = call fast double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 91; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %3 = call fast double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 92; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %4 = call fast double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 93; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call fast double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 94; SIZE-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %6 = call fast double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 95; SIZE-NEXT: Cost Model: Found an estimated cost of 1 for instruction: ret double undef 96; 97%V2 = call double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 98%V4 = call double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 99%V8 = call double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 100%V16 = call double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 101%V32 = call double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 102%V64 = call double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 103call fast double @llvm.vector.reduce.fmaximum.v2f64(<2 x double> undef) 104call fast double @llvm.vector.reduce.fmaximum.v4f64(<4 x double> undef) 105call fast double @llvm.vector.reduce.fmaximum.v8f64(<8 x double> undef) 106call fast double @llvm.vector.reduce.fmaximum.v16f64(<16 x double> undef) 107call fast double @llvm.vector.reduce.fmaximum.v32f64(<32 x double> undef) 108call fast double @llvm.vector.reduce.fmaximum.v64f64(<64 x double> undef) 109ret double undef 110} 111declare double @llvm.vector.reduce.fmaximum.v2f64(<2 x double>) 112declare double @llvm.vector.reduce.fmaximum.v4f64(<4 x double>) 113declare double @llvm.vector.reduce.fmaximum.v8f64(<8 x double>) 114declare double @llvm.vector.reduce.fmaximum.v16f64(<16 x double>) 115declare double @llvm.vector.reduce.fmaximum.v32f64(<32 x double>) 116declare double @llvm.vector.reduce.fmaximum.v64f64(<64 x double>) 117