From ed70aed107513f511d9e8be2b18f2b8cb8ad42d6 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jul 2025 17:29:14 +0800 Subject: [PATCH 1/3] Precommit test --- .../Analysis/CostModel/RISCV/vp-intrinsics.ll | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) diff --git a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll index ea3c47dc34201..c85333ed331cd 100644 --- a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll +++ b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll @@ -1648,3 +1648,74 @@ define void @splice() { %splice_nxv2i1 = call @llvm.experimental.vp.splice.nxv2i1( zeroinitializer, zeroinitializer, i32 1, zeroinitializer, i32 poison, i32 poison) ret void } + +define void @is.fpclass() { +; CHECK-LABEL: 'is.fpclass' +; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) +; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) + call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) + call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) + call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) + call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) + call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) + call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) + call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) + call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) + call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) + call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) + call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) + call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) + call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) + call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) + call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) + call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) + call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) + ret void +} From 1bc6898d159a50181eee97863ea274c453fd48e9 Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jul 2025 17:31:21 +0800 Subject: [PATCH 2/3] [TTI] Don't drop VP intrinsic args when delegating to non-vp equivalent Previously we only carried the type arguments which caused value-based costs to be inadvertantly changed into type-based costs. I'm just using vp.is.fpclass as an example intrinsic for now since the type based cost seems to differ from the value based cost, and most normal intrinsics e.g. min/max have the same value + type based cost. We still need to handle the cost properly for is.fpclass in a second patch. This is needed for an upcoming patch to handle the cost of llvm.experimental.vp.reverse which suffers from the same problem. --- llvm/include/llvm/CodeGen/BasicTTIImpl.h | 13 ++- .../Analysis/CostModel/RISCV/vp-intrinsics.ll | 103 ++++++++++++------ 2 files changed, 79 insertions(+), 37 deletions(-) diff --git a/llvm/include/llvm/CodeGen/BasicTTIImpl.h b/llvm/include/llvm/CodeGen/BasicTTIImpl.h index 2b9be43eadb7a..21da0311fa434 100644 --- a/llvm/include/llvm/CodeGen/BasicTTIImpl.h +++ b/llvm/include/llvm/CodeGen/BasicTTIImpl.h @@ -1781,6 +1781,10 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase { assert(ICA.getArgTypes().size() >= 2 && "Expected VPIntrinsic to have Mask and Vector Length args and " "types"); + + ArrayRef NewArgs = ArrayRef(ICA.getArgs()); + if (!ICA.isTypeBasedOnly()) + NewArgs = NewArgs.drop_back(2); ArrayRef NewTys = ArrayRef(ICA.getArgTypes()).drop_back(2); // VPReduction intrinsics have a start value argument that their non-vp @@ -1788,11 +1792,14 @@ class BasicTTIImplBase : public TargetTransformInfoImplCRTPBase { // counterpart. if (VPReductionIntrinsic::isVPReduction(ICA.getID()) && *FID != Intrinsic::vector_reduce_fadd && - *FID != Intrinsic::vector_reduce_fmul) + *FID != Intrinsic::vector_reduce_fmul) { + if (!ICA.isTypeBasedOnly()) + NewArgs = NewArgs.drop_front(); NewTys = NewTys.drop_front(); + } - IntrinsicCostAttributes NewICA(*FID, ICA.getReturnType(), NewTys, - ICA.getFlags()); + IntrinsicCostAttributes NewICA(*FID, ICA.getReturnType(), NewArgs, + NewTys, ICA.getFlags()); return thisT()->getIntrinsicInstrCost(NewICA, CostKind); } } diff --git a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll index c85333ed331cd..ad239a511d747 100644 --- a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll +++ b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll @@ -1650,40 +1650,75 @@ define void @splice() { } define void @is.fpclass() { -; CHECK-LABEL: 'is.fpclass' -; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) -; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; ARGBASED-LABEL: 'is.fpclass' +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; +; TYPEBASED-LABEL: 'is.fpclass' +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) From 97a562f43505d562a0e6f16e61f31887768979bf Mon Sep 17 00:00:00 2001 From: Luke Lau Date: Wed, 9 Jul 2025 18:13:50 +0800 Subject: [PATCH 3/3] undef -> poison --- .../Analysis/CostModel/RISCV/vp-intrinsics.ll | 192 +++++++++--------- 1 file changed, 96 insertions(+), 96 deletions(-) diff --git a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll index ad239a511d747..3a2e7d5580ac0 100644 --- a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll +++ b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll @@ -1651,106 +1651,106 @@ define void @splice() { define void @is.fpclass() { ; ARGBASED-LABEL: 'is.fpclass' -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) -; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> poison, i32 0, <2 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> poison, i32 0, <4 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> poison, i32 0, <8 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> poison, i32 0, <16 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> poison, i32 0, <2 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> poison, i32 0, <4 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> poison, i32 0, <8 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> poison, i32 0, <16 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> poison, i32 0, <2 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> poison, i32 0, <4 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> poison, i32 0, <8 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> poison, i32 0, <16 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 6 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> poison, i32 0, <2 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> poison, i32 0, <4 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> poison, i32 0, <8 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Found an estimated cost of 34 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> poison, i32 0, <16 x i1> poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( poison, i32 0, poison, i32 poison) +; ARGBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( poison, i32 0, poison, i32 poison) ; ARGBASED-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; ; TYPEBASED-LABEL: 'is.fpclass' -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) -; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %1 = call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> poison, i32 0, <2 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %2 = call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> poison, i32 0, <4 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %3 = call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> poison, i32 0, <8 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %4 = call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> poison, i32 0, <16 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %5 = call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> poison, i32 0, <2 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %6 = call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> poison, i32 0, <4 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %7 = call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> poison, i32 0, <8 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %8 = call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> poison, i32 0, <16 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %9 = call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> poison, i32 0, <2 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %10 = call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> poison, i32 0, <4 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %11 = call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> poison, i32 0, <8 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %12 = call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> poison, i32 0, <16 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %13 = call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> poison, i32 0, <2 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %14 = call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> poison, i32 0, <4 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %15 = call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> poison, i32 0, <8 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 65 for instruction: %16 = call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> poison, i32 0, <16 x i1> poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.vp.is.fpclass.nxv2bf16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.vp.is.fpclass.nxv4bf16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.vp.is.fpclass.nxv8bf16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.vp.is.fpclass.nxv16bf16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.vp.is.fpclass.nxv2f16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %22 = call @llvm.vp.is.fpclass.nxv4f16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %23 = call @llvm.vp.is.fpclass.nxv8f16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %24 = call @llvm.vp.is.fpclass.nxv16f16( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %25 = call @llvm.vp.is.fpclass.nxv2f32( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.vp.is.fpclass.nxv4f32( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.vp.is.fpclass.nxv8f32( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.vp.is.fpclass.nxv16f32( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.vp.is.fpclass.nxv2f64( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.vp.is.fpclass.nxv4f64( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %31 = call @llvm.vp.is.fpclass.nxv8f64( poison, i32 0, poison, i32 poison) +; TYPEBASED-NEXT: Cost Model: Invalid cost for instruction: %32 = call @llvm.vp.is.fpclass.nxv16f64( poison, i32 0, poison, i32 poison) ; TYPEBASED-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void ; - call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> undef, i32 0, <2 x i1> undef, i32 undef) - call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> undef, i32 0, <4 x i1> undef, i32 undef) - call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> undef, i32 0, <8 x i1> undef, i32 undef) - call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> undef, i32 0, <16 x i1> undef, i32 undef) - call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> undef, i32 0, <2 x i1> undef, i32 undef) - call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> undef, i32 0, <4 x i1> undef, i32 undef) - call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> undef, i32 0, <8 x i1> undef, i32 undef) - call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> undef, i32 0, <16 x i1> undef, i32 undef) - call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> undef, i32 0, <2 x i1> undef, i32 undef) - call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> undef, i32 0, <4 x i1> undef, i32 undef) - call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> undef, i32 0, <8 x i1> undef, i32 undef) - call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> undef, i32 0, <16 x i1> undef, i32 undef) - call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> undef, i32 0, <2 x i1> undef, i32 undef) - call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> undef, i32 0, <4 x i1> undef, i32 undef) - call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> undef, i32 0, <8 x i1> undef, i32 undef) - call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> undef, i32 0, <16 x i1> undef, i32 undef) - call @llvm.vp.is.fpclass.nxv2bf16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv4bf16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv8bf16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv16bf16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv2f16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv4f16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv8f16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv16f16( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv2f32( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv4f32( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv8f32( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv16f32( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv2f64( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv4f64( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv8f64( undef, i32 0, undef, i32 undef) - call @llvm.vp.is.fpclass.nxv16f64( undef, i32 0, undef, i32 undef) + call <2 x i1> @llvm.vp.is.fpclass.v2bf16(<2 x bfloat> poison, i32 0, <2 x i1> poison, i32 poison) + call <4 x i1> @llvm.vp.is.fpclass.v4bf16(<4 x bfloat> poison, i32 0, <4 x i1> poison, i32 poison) + call <8 x i1> @llvm.vp.is.fpclass.v8bf16(<8 x bfloat> poison, i32 0, <8 x i1> poison, i32 poison) + call <16 x i1> @llvm.vp.is.fpclass.v16bf16(<16 x bfloat> poison, i32 0, <16 x i1> poison, i32 poison) + call <2 x i1> @llvm.vp.is.fpclass.v2f16(<2 x half> poison, i32 0, <2 x i1> poison, i32 poison) + call <4 x i1> @llvm.vp.is.fpclass.v4f16(<4 x half> poison, i32 0, <4 x i1> poison, i32 poison) + call <8 x i1> @llvm.vp.is.fpclass.v8f16(<8 x half> poison, i32 0, <8 x i1> poison, i32 poison) + call <16 x i1> @llvm.vp.is.fpclass.v16f16(<16 x half> poison, i32 0, <16 x i1> poison, i32 poison) + call <2 x i1> @llvm.vp.is.fpclass.v2f32(<2 x float> poison, i32 0, <2 x i1> poison, i32 poison) + call <4 x i1> @llvm.vp.is.fpclass.v4f32(<4 x float> poison, i32 0, <4 x i1> poison, i32 poison) + call <8 x i1> @llvm.vp.is.fpclass.v8f32(<8 x float> poison, i32 0, <8 x i1> poison, i32 poison) + call <16 x i1> @llvm.vp.is.fpclass.v16f32(<16 x float> poison, i32 0, <16 x i1> poison, i32 poison) + call <2 x i1> @llvm.vp.is.fpclass.v2f64(<2 x double> poison, i32 0, <2 x i1> poison, i32 poison) + call <4 x i1> @llvm.vp.is.fpclass.v4f64(<4 x double> poison, i32 0, <4 x i1> poison, i32 poison) + call <8 x i1> @llvm.vp.is.fpclass.v8f64(<8 x double> poison, i32 0, <8 x i1> poison, i32 poison) + call <16 x i1> @llvm.vp.is.fpclass.v16f64(<16 x double> poison, i32 0, <16 x i1> poison, i32 poison) + call @llvm.vp.is.fpclass.nxv2bf16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv4bf16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv8bf16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv16bf16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv2f16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv4f16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv8f16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv16f16( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv2f32( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv4f32( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv8f32( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv16f32( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv2f64( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv4f64( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv8f64( poison, i32 0, poison, i32 poison) + call @llvm.vp.is.fpclass.nxv16f64( poison, i32 0, poison, i32 poison) ret void }