diff --git a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp --- a/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64TargetTransformInfo.cpp @@ -401,7 +401,9 @@ case Intrinsic::smin: case Intrinsic::smax: { static const auto ValidMinMaxTys = {MVT::v8i8, MVT::v16i8, MVT::v4i16, - MVT::v8i16, MVT::v2i32, MVT::v4i32}; + MVT::v8i16, MVT::v2i32, MVT::v4i32, + MVT::nxv16i8, MVT::nxv8i16, MVT::nxv4i32, + MVT::nxv2i64}; auto LT = getTypeLegalizationCost(RetTy); // v2i64 types get converted to cmp+bif hence the cost of 2 if (LT.second == MVT::v2i64) diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll b/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll --- a/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll +++ b/llvm/test/Analysis/CostModel/AArch64/sve-intrinsics.ll @@ -44,13 +44,13 @@ ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xor_nxv4i32 = call i32 @llvm.vector.reduce.xor.nxv4i32( %v0) ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xor_nxv4i64 = call i64 @llvm.vector.reduce.xor.nxv4i64( %v1) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %umin_nxv4i32 = call i32 @llvm.vector.reduce.umin.nxv4i32( %v0) -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %umin_nxv4i64 = call i64 @llvm.vector.reduce.umin.nxv4i64( %v1) +; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %umin_nxv4i64 = call i64 @llvm.vector.reduce.umin.nxv4i64( %v1) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %smin_nxv4i32 = call i32 @llvm.vector.reduce.smin.nxv4i32( %v0) -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %smin_nxv4i64 = call i64 @llvm.vector.reduce.smin.nxv4i64( %v1) +; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %smin_nxv4i64 = call i64 @llvm.vector.reduce.smin.nxv4i64( %v1) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %umax_nxv4i32 = call i32 @llvm.vector.reduce.umax.nxv4i32( %v0) -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %umax_nxv4i64 = call i64 @llvm.vector.reduce.umax.nxv4i64( %v1) +; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %umax_nxv4i64 = call i64 @llvm.vector.reduce.umax.nxv4i64( %v1) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %smax_nxv4i32 = call i32 @llvm.vector.reduce.smax.nxv4i32( %v0) -; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %smax_nxv4i64 = call i64 @llvm.vector.reduce.smax.nxv4i64( %v1) +; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %smax_nxv4i64 = call i64 @llvm.vector.reduce.smax.nxv4i64( %v1) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %fadd_nxv4f32 = call fast float @llvm.vector.reduce.fadd.nxv4f32(float 0.000000e+00, %v2) ; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %fadd_nxv4f64 = call fast double @llvm.vector.reduce.fadd.nxv4f64(double 0.000000e+00, %v3) ; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %fmin_nxv4f32 = call fast float @llvm.vector.reduce.fmin.nxv4f32( %v2) @@ -71,13 +71,13 @@ ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %xor_nxv4i32 = call i32 @llvm.vector.reduce.xor.nxv4i32( %v0) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %xor_nxv4i64 = call i64 @llvm.vector.reduce.xor.nxv4i64( %v1) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %umin_nxv4i32 = call i32 @llvm.vector.reduce.umin.nxv4i32( %v0) -; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %umin_nxv4i64 = call i64 @llvm.vector.reduce.umin.nxv4i64( %v1) +; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %umin_nxv4i64 = call i64 @llvm.vector.reduce.umin.nxv4i64( %v1) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %smin_nxv4i32 = call i32 @llvm.vector.reduce.smin.nxv4i32( %v0) -; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %smin_nxv4i64 = call i64 @llvm.vector.reduce.smin.nxv4i64( %v1) +; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %smin_nxv4i64 = call i64 @llvm.vector.reduce.smin.nxv4i64( %v1) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %umax_nxv4i32 = call i32 @llvm.vector.reduce.umax.nxv4i32( %v0) -; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %umax_nxv4i64 = call i64 @llvm.vector.reduce.umax.nxv4i64( %v1) +; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %umax_nxv4i64 = call i64 @llvm.vector.reduce.umax.nxv4i64( %v1) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %smax_nxv4i32 = call i32 @llvm.vector.reduce.smax.nxv4i32( %v0) -; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %smax_nxv4i64 = call i64 @llvm.vector.reduce.smax.nxv4i64( %v1) +; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %smax_nxv4i64 = call i64 @llvm.vector.reduce.smax.nxv4i64( %v1) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %fadd_nxv4f32 = call fast float @llvm.vector.reduce.fadd.nxv4f32(float 0.000000e+00, %v2) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %fadd_nxv4f64 = call fast double @llvm.vector.reduce.fadd.nxv4f64(double 0.000000e+00, %v3) ; TYPE_BASED_ONLY-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %fmin_nxv4f32 = call fast float @llvm.vector.reduce.fmin.nxv4f32( %v2) diff --git a/llvm/test/Analysis/CostModel/AArch64/sve-min-max.ll b/llvm/test/Analysis/CostModel/AArch64/sve-min-max.ll new file mode 100644 --- /dev/null +++ b/llvm/test/Analysis/CostModel/AArch64/sve-min-max.ll @@ -0,0 +1,346 @@ +; NOTE: Assertions have been autogenerated by utils/update_analyze_test_checks.py +; RUN: opt < %s -mtriple=aarch64-unknown-linux-gnu -mattr=+sve -passes="print" 2>&1 -disable-output -cost-kind=throughput | FileCheck %s --check-prefixes=CHECK,CHECK-NOF16 + +target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128" + +define void @umin() { +; CHECK-LABEL: 'umin' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call @llvm.umin.nxv4i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call @llvm.umin.nxv8i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call @llvm.umin.nxv16i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32i8 = call @llvm.umin.nxv32i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64i8 = call @llvm.umin.nxv64i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call @llvm.umin.nxv2i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call @llvm.umin.nxv4i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call @llvm.umin.nxv8i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16i16 = call @llvm.umin.nxv16i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call @llvm.umin.nxv2i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call @llvm.umin.nxv4i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8i32 = call @llvm.umin.nxv8i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call @llvm.umin.nxv2i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call @llvm.umin.nxv4i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V4i8 = call @llvm.umin.nxv4i8( undef, undef) + %V8i8 = call @llvm.umin.nxv8i8( undef, undef) + %V16i8 = call @llvm.umin.nxv16i8( undef, undef) + %V32i8 = call @llvm.umin.nxv32i8( undef, undef) + %V64i8 = call @llvm.umin.nxv64i8( undef, undef) + %V2i16 = call @llvm.umin.nxv2i16( undef, undef) + %V4i16 = call @llvm.umin.nxv4i16( undef, undef) + %V8i16 = call @llvm.umin.nxv8i16( undef, undef) + %V16i16 = call @llvm.umin.nxv16i16( undef, undef) + %V2i32 = call @llvm.umin.nxv2i32( undef, undef) + %V4i32 = call @llvm.umin.nxv4i32( undef, undef) + %V8i32 = call @llvm.umin.nxv8i32( undef, undef) + %V2i64 = call @llvm.umin.nxv2i64( undef, undef) + %V4i64 = call @llvm.umin.nxv4i64( undef, undef) + ret void +} + +define void @umax() { +; CHECK-LABEL: 'umax' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call @llvm.umax.nxv4i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call @llvm.umax.nxv8i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call @llvm.umax.nxv16i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32i8 = call @llvm.umax.nxv32i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64i8 = call @llvm.umax.nxv64i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call @llvm.umax.nxv2i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call @llvm.umax.nxv4i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call @llvm.umax.nxv8i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16i16 = call @llvm.umax.nxv16i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call @llvm.umax.nxv2i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call @llvm.umax.nxv4i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8i32 = call @llvm.umax.nxv8i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call @llvm.umax.nxv2i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call @llvm.umax.nxv4i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V4i8 = call @llvm.umax.nxv4i8( undef, undef) + %V8i8 = call @llvm.umax.nxv8i8( undef, undef) + %V16i8 = call @llvm.umax.nxv16i8( undef, undef) + %V32i8 = call @llvm.umax.nxv32i8( undef, undef) + %V64i8 = call @llvm.umax.nxv64i8( undef, undef) + %V2i16 = call @llvm.umax.nxv2i16( undef, undef) + %V4i16 = call @llvm.umax.nxv4i16( undef, undef) + %V8i16 = call @llvm.umax.nxv8i16( undef, undef) + %V16i16 = call @llvm.umax.nxv16i16( undef, undef) + %V2i32 = call @llvm.umax.nxv2i32( undef, undef) + %V4i32 = call @llvm.umax.nxv4i32( undef, undef) + %V8i32 = call @llvm.umax.nxv8i32( undef, undef) + %V2i64 = call @llvm.umax.nxv2i64( undef, undef) + %V4i64 = call @llvm.umax.nxv4i64( undef, undef) + ret void +} + +define void @smin() { +; CHECK-LABEL: 'smin' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call @llvm.smin.nxv4i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call @llvm.smin.nxv8i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call @llvm.smin.nxv16i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32i8 = call @llvm.smin.nxv32i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64i8 = call @llvm.smin.nxv64i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call @llvm.smin.nxv2i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call @llvm.smin.nxv4i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call @llvm.smin.nxv8i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16i16 = call @llvm.smin.nxv16i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call @llvm.smin.nxv2i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call @llvm.smin.nxv4i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8i32 = call @llvm.smin.nxv8i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call @llvm.smin.nxv2i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call @llvm.smin.nxv4i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V4i8 = call @llvm.smin.nxv4i8( undef, undef) + %V8i8 = call @llvm.smin.nxv8i8( undef, undef) + %V16i8 = call @llvm.smin.nxv16i8( undef, undef) + %V32i8 = call @llvm.smin.nxv32i8( undef, undef) + %V64i8 = call @llvm.smin.nxv64i8( undef, undef) + %V2i16 = call @llvm.smin.nxv2i16( undef, undef) + %V4i16 = call @llvm.smin.nxv4i16( undef, undef) + %V8i16 = call @llvm.smin.nxv8i16( undef, undef) + %V16i16 = call @llvm.smin.nxv16i16( undef, undef) + %V2i32 = call @llvm.smin.nxv2i32( undef, undef) + %V4i32 = call @llvm.smin.nxv4i32( undef, undef) + %V8i32 = call @llvm.smin.nxv8i32( undef, undef) + %V2i64 = call @llvm.smin.nxv2i64( undef, undef) + %V4i64 = call @llvm.smin.nxv4i64( undef, undef) + ret void +} + +define void @smax() { +; CHECK-LABEL: 'smax' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i8 = call @llvm.smax.nxv4i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i8 = call @llvm.smax.nxv8i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V16i8 = call @llvm.smax.nxv16i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V32i8 = call @llvm.smax.nxv32i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V64i8 = call @llvm.smax.nxv64i8( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i16 = call @llvm.smax.nxv2i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i16 = call @llvm.smax.nxv4i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8i16 = call @llvm.smax.nxv8i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16i16 = call @llvm.smax.nxv16i16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i32 = call @llvm.smax.nxv2i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4i32 = call @llvm.smax.nxv4i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8i32 = call @llvm.smax.nxv8i32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2i64 = call @llvm.smax.nxv2i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4i64 = call @llvm.smax.nxv4i64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V4i8 = call @llvm.smax.nxv4i8( undef, undef) + %V8i8 = call @llvm.smax.nxv8i8( undef, undef) + %V16i8 = call @llvm.smax.nxv16i8( undef, undef) + %V32i8 = call @llvm.smax.nxv32i8( undef, undef) + %V64i8 = call @llvm.smax.nxv64i8( undef, undef) + %V2i16 = call @llvm.smax.nxv2i16( undef, undef) + %V4i16 = call @llvm.smax.nxv4i16( undef, undef) + %V8i16 = call @llvm.smax.nxv8i16( undef, undef) + %V16i16 = call @llvm.smax.nxv16i16( undef, undef) + %V2i32 = call @llvm.smax.nxv2i32( undef, undef) + %V4i32 = call @llvm.smax.nxv4i32( undef, undef) + %V8i32 = call @llvm.smax.nxv8i32( undef, undef) + %V2i64 = call @llvm.smax.nxv2i64( undef, undef) + %V4i64 = call @llvm.smax.nxv4i64( undef, undef) + ret void +} + +define void @minnum() { +; CHECK-LABEL: 'minnum' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call @llvm.minnum.nxv2f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call @llvm.minnum.nxv4f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call @llvm.minnum.nxv8f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call @llvm.minnum.nxv2f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call @llvm.minnum.nxv4f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call @llvm.minnum.nxv2f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call @llvm.minnum.nxv4f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call @llvm.minnum.nxv8f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call @llvm.minnum.nxv16f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V2f32 = call @llvm.minnum.nxv2f32( undef, undef) + %V4f32 = call @llvm.minnum.nxv4f32( undef, undef) + %V8f32 = call @llvm.minnum.nxv8f32( undef, undef) + %V2f64 = call @llvm.minnum.nxv2f64( undef, undef) + %V4f64 = call @llvm.minnum.nxv4f64( undef, undef) + %V2f16 = call @llvm.minnum.nxv2f16( undef, undef) + %V4f16 = call @llvm.minnum.nxv4f16( undef, undef) + %V8f16 = call @llvm.minnum.nxv8f16( undef, undef) + %V16f16 = call @llvm.minnum.nxv16f16( undef, undef) + ret void +} + +define void @maxnum() { +; CHECK-LABEL: 'maxnum' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call @llvm.maxnum.nxv2f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call @llvm.maxnum.nxv4f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call @llvm.maxnum.nxv8f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call @llvm.maxnum.nxv2f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call @llvm.maxnum.nxv4f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call @llvm.maxnum.nxv2f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call @llvm.maxnum.nxv4f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call @llvm.maxnum.nxv8f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call @llvm.maxnum.nxv16f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V2f32 = call @llvm.maxnum.nxv2f32( undef, undef) + %V4f32 = call @llvm.maxnum.nxv4f32( undef, undef) + %V8f32 = call @llvm.maxnum.nxv8f32( undef, undef) + %V2f64 = call @llvm.maxnum.nxv2f64( undef, undef) + %V4f64 = call @llvm.maxnum.nxv4f64( undef, undef) + %V2f16 = call @llvm.maxnum.nxv2f16( undef, undef) + %V4f16 = call @llvm.maxnum.nxv4f16( undef, undef) + %V8f16 = call @llvm.maxnum.nxv8f16( undef, undef) + %V16f16 = call @llvm.maxnum.nxv16f16( undef, undef) + ret void +} + +define void @minimum() { +; CHECK-LABEL: 'minimum' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call @llvm.minimum.nxv2f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call @llvm.minimum.nxv4f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call @llvm.minimum.nxv8f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call @llvm.minimum.nxv2f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call @llvm.minimum.nxv4f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call @llvm.minimum.nxv2f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call @llvm.minimum.nxv4f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call @llvm.minimum.nxv8f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call @llvm.minimum.nxv16f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V2f32 = call @llvm.minimum.nxv2f32( undef, undef) + %V4f32 = call @llvm.minimum.nxv4f32( undef, undef) + %V8f32 = call @llvm.minimum.nxv8f32( undef, undef) + %V2f64 = call @llvm.minimum.nxv2f64( undef, undef) + %V4f64 = call @llvm.minimum.nxv4f64( undef, undef) + %V2f16 = call @llvm.minimum.nxv2f16( undef, undef) + %V4f16 = call @llvm.minimum.nxv4f16( undef, undef) + %V8f16 = call @llvm.minimum.nxv8f16( undef, undef) + %V16f16 = call @llvm.minimum.nxv16f16( undef, undef) + ret void +} + +define void @maximum() { +; CHECK-LABEL: 'maximum' +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f32 = call @llvm.maximum.nxv2f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f32 = call @llvm.maximum.nxv4f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8f32 = call @llvm.maximum.nxv8f32( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f64 = call @llvm.maximum.nxv2f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4f64 = call @llvm.maximum.nxv4f64( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2f16 = call @llvm.maximum.nxv2f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4f16 = call @llvm.maximum.nxv4f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8f16 = call @llvm.maximum.nxv8f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16f16 = call @llvm.maximum.nxv16f16( undef, undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + %V2f32 = call @llvm.maximum.nxv2f32( undef, undef) + %V4f32 = call @llvm.maximum.nxv4f32( undef, undef) + %V8f32 = call @llvm.maximum.nxv8f32( undef, undef) + %V2f64 = call @llvm.maximum.nxv2f64( undef, undef) + %V4f64 = call @llvm.maximum.nxv4f64( undef, undef) + %V2f16 = call @llvm.maximum.nxv2f16( undef, undef) + %V4f16 = call @llvm.maximum.nxv4f16( undef, undef) + %V8f16 = call @llvm.maximum.nxv8f16( undef, undef) + %V16f16 = call @llvm.maximum.nxv16f16( undef, undef) + ret void +} + +declare @llvm.umin.nxv4i8(, ) +declare @llvm.umin.nxv8i8(, ) +declare @llvm.umin.nxv16i8(, ) +declare @llvm.umin.nxv32i8(, ) +declare @llvm.umin.nxv64i8(, ) +declare @llvm.umin.nxv2i16(, ) +declare @llvm.umin.nxv4i16(, ) +declare @llvm.umin.nxv8i16(, ) +declare @llvm.umin.nxv16i16(, ) +declare @llvm.umin.nxv2i32(, ) +declare @llvm.umin.nxv4i32(, ) +declare @llvm.umin.nxv8i32(, ) +declare @llvm.umin.nxv2i64(, ) +declare @llvm.umin.nxv4i64(, ) + +declare @llvm.umax.nxv4i8(, ) +declare @llvm.umax.nxv8i8(, ) +declare @llvm.umax.nxv16i8(, ) +declare @llvm.umax.nxv32i8(, ) +declare @llvm.umax.nxv64i8(, ) +declare @llvm.umax.nxv2i16(, ) +declare @llvm.umax.nxv4i16(, ) +declare @llvm.umax.nxv8i16(, ) +declare @llvm.umax.nxv16i16(, ) +declare @llvm.umax.nxv2i32(, ) +declare @llvm.umax.nxv4i32(, ) +declare @llvm.umax.nxv8i32(, ) +declare @llvm.umax.nxv2i64(, ) +declare @llvm.umax.nxv4i64(, ) + +declare @llvm.smin.nxv4i8(, ) +declare @llvm.smin.nxv8i8(, ) +declare @llvm.smin.nxv16i8(, ) +declare @llvm.smin.nxv32i8(, ) +declare @llvm.smin.nxv64i8(, ) +declare @llvm.smin.nxv2i16(, ) +declare @llvm.smin.nxv4i16(, ) +declare @llvm.smin.nxv8i16(, ) +declare @llvm.smin.nxv16i16(, ) +declare @llvm.smin.nxv2i32(, ) +declare @llvm.smin.nxv4i32(, ) +declare @llvm.smin.nxv8i32(, ) +declare @llvm.smin.nxv2i64(, ) +declare @llvm.smin.nxv4i64(, ) + +declare @llvm.smax.nxv4i8(, ) +declare @llvm.smax.nxv8i8(, ) +declare @llvm.smax.nxv16i8(, ) +declare @llvm.smax.nxv32i8(, ) +declare @llvm.smax.nxv64i8(, ) +declare @llvm.smax.nxv2i16(, ) +declare @llvm.smax.nxv4i16(, ) +declare @llvm.smax.nxv8i16(, ) +declare @llvm.smax.nxv16i16(, ) +declare @llvm.smax.nxv2i32(, ) +declare @llvm.smax.nxv4i32(, ) +declare @llvm.smax.nxv8i32(, ) +declare @llvm.smax.nxv2i64(, ) +declare @llvm.smax.nxv4i64(, ) + +declare @llvm.minnum.nxv2f16(, ) +declare @llvm.minnum.nxv4f16(, ) +declare @llvm.minnum.nxv8f16(, ) +declare @llvm.minnum.nxv16f16(, ) +declare @llvm.minnum.nxv2f32(, ) +declare @llvm.minnum.nxv4f32(, ) +declare @llvm.minnum.nxv8f32(, ) +declare @llvm.minnum.nxv2f64(, ) +declare @llvm.minnum.nxv4f64(, ) + +declare @llvm.maxnum.nxv2f16(, ) +declare @llvm.maxnum.nxv4f16(, ) +declare @llvm.maxnum.nxv8f16(, ) +declare @llvm.maxnum.nxv16f16(, ) +declare @llvm.maxnum.nxv2f32(, ) +declare @llvm.maxnum.nxv4f32(, ) +declare @llvm.maxnum.nxv8f32(, ) +declare @llvm.maxnum.nxv2f64(, ) +declare @llvm.maxnum.nxv4f64(, ) + +declare @llvm.minimum.nxv2f16(, ) +declare @llvm.minimum.nxv4f16(, ) +declare @llvm.minimum.nxv8f16(, ) +declare @llvm.minimum.nxv16f16(, ) +declare @llvm.minimum.nxv2f32(, ) +declare @llvm.minimum.nxv4f32(, ) +declare @llvm.minimum.nxv8f32(, ) +declare @llvm.minimum.nxv2f64(, ) +declare @llvm.minimum.nxv4f64(, ) + +declare @llvm.maximum.nxv2f16(, ) +declare @llvm.maximum.nxv4f16(, ) +declare @llvm.maximum.nxv8f16(, ) +declare @llvm.maximum.nxv16f16(, ) +declare @llvm.maximum.nxv2f32(, ) +declare @llvm.maximum.nxv4f32(, ) +declare @llvm.maximum.nxv8f32(, ) +declare @llvm.maximum.nxv2f64(, ) +declare @llvm.maximum.nxv4f64(, ) +;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: +; CHECK-NOF16: {{.*}}