diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp index 4edaeef354a59..c6960524fa8be 100644 --- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp +++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp @@ -1013,6 +1013,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA, return LT.first; break; } + case Intrinsic::cttz: + case Intrinsic::ctlz: case Intrinsic::ctpop: { auto LT = getTypeLegalizationCost(RetTy); if (ST->hasVInstructions() && ST->hasStdExtZvbb() && LT.second.isVector()) diff --git a/llvm/test/Analysis/CostModel/RISCV/int-bit-manip.ll b/llvm/test/Analysis/CostModel/RISCV/int-bit-manip.ll index ea05464b08408..911993caba4d6 100644 --- a/llvm/test/Analysis/CostModel/RISCV/int-bit-manip.ll +++ b/llvm/test/Analysis/CostModel/RISCV/int-bit-manip.ll @@ -157,6 +157,260 @@ define void @bitreverse() { ret void } +define void @ctlz() { +; NOZVBB-LABEL: 'ctlz' +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %1 = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %2 = call <4 x i8> @llvm.ctlz.v4i8(<4 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %3 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %4 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %5 = call @llvm.ctlz.nxv1i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %6 = call @llvm.ctlz.nxv2i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %7 = call @llvm.ctlz.nxv4i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %8 = call @llvm.ctlz.nxv8i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %9 = call @llvm.ctlz.nxv16i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %10 = call @llvm.ctlz.nxv32i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %11 = call @llvm.ctlz.nxv64i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %12 = call <2 x i16> @llvm.ctlz.v2i16(<2 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %13 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %14 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %15 = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %16 = call @llvm.ctlz.nxv1i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %17 = call @llvm.ctlz.nxv2i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %18 = call @llvm.ctlz.nxv4i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %19 = call @llvm.ctlz.nxv8i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %20 = call @llvm.ctlz.nxv16i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.ctlz.nxv32i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %22 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %23 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %24 = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %25 = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %26 = call @llvm.ctlz.nxv1i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %27 = call @llvm.ctlz.nxv2i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %28 = call @llvm.ctlz.nxv4i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %29 = call @llvm.ctlz.nxv8i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %30 = call @llvm.ctlz.nxv16i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %31 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %32 = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %33 = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %34 = call <16 x i64> @llvm.ctlz.v16i64(<16 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %35 = call @llvm.ctlz.nxv1i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %36 = call @llvm.ctlz.nxv2i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %37 = call @llvm.ctlz.nxv4i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %38 = call @llvm.ctlz.nxv8i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %39 = call @llvm.ctlz.nxv16i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; +; ZVBB-LABEL: 'ctlz' +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call <4 x i8> @llvm.ctlz.v4i8(<4 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = call @llvm.ctlz.nxv1i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call @llvm.ctlz.nxv2i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call @llvm.ctlz.nxv4i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call @llvm.ctlz.nxv8i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = call @llvm.ctlz.nxv16i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call @llvm.ctlz.nxv32i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call @llvm.ctlz.nxv64i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = call <2 x i16> @llvm.ctlz.v2i16(<2 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = call @llvm.ctlz.nxv1i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = call @llvm.ctlz.nxv2i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = call @llvm.ctlz.nxv4i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = call @llvm.ctlz.nxv8i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = call @llvm.ctlz.nxv16i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = call @llvm.ctlz.nxv32i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = call @llvm.ctlz.nxv1i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = call @llvm.ctlz.nxv2i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = call @llvm.ctlz.nxv4i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = call @llvm.ctlz.nxv8i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = call @llvm.ctlz.nxv16i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %31 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %32 = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %33 = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = call <16 x i64> @llvm.ctlz.v16i64(<16 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = call @llvm.ctlz.nxv1i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %36 = call @llvm.ctlz.nxv2i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %37 = call @llvm.ctlz.nxv4i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %38 = call @llvm.ctlz.nxv8i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %39 = call @llvm.ctlz.nxv16i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> undef, i1 false) + call <4 x i8> @llvm.ctlz.v4i8(<4 x i8> undef, i1 false) + call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> undef, i1 false) + call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> undef, i1 false) + call @llvm.ctlz.nxv1i8( undef, i1 false) + call @llvm.ctlz.nxv2i8( undef, i1 false) + call @llvm.ctlz.nxv4i8( undef, i1 false) + call @llvm.ctlz.nxv8i8( undef, i1 false) + call @llvm.ctlz.nxv16i8( undef, i1 false) + call @llvm.ctlz.nxv32i8( undef, i1 false) + call @llvm.ctlz.nxv64i8( undef, i1 false) + call <2 x i16> @llvm.ctlz.v2i16(<2 x i16> undef, i1 false) + call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> undef, i1 false) + call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> undef, i1 false) + call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> undef, i1 false) + call @llvm.ctlz.nxv1i16( undef, i1 false) + call @llvm.ctlz.nxv2i16( undef, i1 false) + call @llvm.ctlz.nxv4i16( undef, i1 false) + call @llvm.ctlz.nxv8i16( undef, i1 false) + call @llvm.ctlz.nxv16i16( undef, i1 false) + call @llvm.ctlz.nxv32i16( undef, i1 false) + call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> undef, i1 false) + call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> undef, i1 false) + call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> undef, i1 false) + call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> undef, i1 false) + call @llvm.ctlz.nxv1i32( undef, i1 false) + call @llvm.ctlz.nxv2i32( undef, i1 false) + call @llvm.ctlz.nxv4i32( undef, i1 false) + call @llvm.ctlz.nxv8i32( undef, i1 false) + call @llvm.ctlz.nxv16i32( undef, i1 false) + call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> undef, i1 false) + call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> undef, i1 false) + call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> undef, i1 false) + call <16 x i64> @llvm.ctlz.v16i64(<16 x i64> undef, i1 false) + call @llvm.ctlz.nxv1i64( undef, i1 false) + call @llvm.ctlz.nxv2i64( undef, i1 false) + call @llvm.ctlz.nxv4i64( undef, i1 false) + call @llvm.ctlz.nxv8i64( undef, i1 false) + call @llvm.ctlz.nxv16i64( undef, i1 false) + ret void +} + +define void @cttz() { +; NOZVBB-LABEL: 'cttz' +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %1 = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %2 = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %3 = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 176 for instruction: %4 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %5 = call @llvm.cttz.nxv1i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %6 = call @llvm.cttz.nxv2i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %7 = call @llvm.cttz.nxv4i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %8 = call @llvm.cttz.nxv8i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %9 = call @llvm.cttz.nxv16i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %10 = call @llvm.cttz.nxv32i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %11 = call @llvm.cttz.nxv64i8( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %12 = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %13 = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 88 for instruction: %14 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %15 = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %16 = call @llvm.cttz.nxv1i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %17 = call @llvm.cttz.nxv2i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %18 = call @llvm.cttz.nxv4i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %19 = call @llvm.cttz.nxv8i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %20 = call @llvm.cttz.nxv16i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %21 = call @llvm.cttz.nxv32i16( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %22 = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 44 for instruction: %23 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %24 = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %25 = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %26 = call @llvm.cttz.nxv1i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %27 = call @llvm.cttz.nxv2i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %28 = call @llvm.cttz.nxv4i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %29 = call @llvm.cttz.nxv8i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %30 = call @llvm.cttz.nxv16i32( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %31 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 47 for instruction: %32 = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 95 for instruction: %33 = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 191 for instruction: %34 = call <16 x i64> @llvm.cttz.v16i64(<16 x i64> undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %35 = call @llvm.cttz.nxv1i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %36 = call @llvm.cttz.nxv2i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %37 = call @llvm.cttz.nxv4i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %38 = call @llvm.cttz.nxv8i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Invalid cost for instruction: %39 = call @llvm.cttz.nxv16i64( undef, i1 false) +; NOZVBB-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; +; ZVBB-LABEL: 'cttz' +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %1 = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %2 = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %3 = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %4 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %5 = call @llvm.cttz.nxv1i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %6 = call @llvm.cttz.nxv2i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %7 = call @llvm.cttz.nxv4i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %8 = call @llvm.cttz.nxv8i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %9 = call @llvm.cttz.nxv16i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %10 = call @llvm.cttz.nxv32i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %11 = call @llvm.cttz.nxv64i8( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %12 = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %13 = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %14 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %15 = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %16 = call @llvm.cttz.nxv1i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %17 = call @llvm.cttz.nxv2i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %18 = call @llvm.cttz.nxv4i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %19 = call @llvm.cttz.nxv8i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %20 = call @llvm.cttz.nxv16i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %21 = call @llvm.cttz.nxv32i16( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %22 = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %23 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %24 = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %25 = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %26 = call @llvm.cttz.nxv1i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %27 = call @llvm.cttz.nxv2i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %28 = call @llvm.cttz.nxv4i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %29 = call @llvm.cttz.nxv8i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %30 = call @llvm.cttz.nxv16i32( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %31 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %32 = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %33 = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %34 = call <16 x i64> @llvm.cttz.v16i64(<16 x i64> undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %35 = call @llvm.cttz.nxv1i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %36 = call @llvm.cttz.nxv2i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %37 = call @llvm.cttz.nxv4i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 1 for instruction: %38 = call @llvm.cttz.nxv8i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %39 = call @llvm.cttz.nxv16i64( undef, i1 false) +; ZVBB-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void +; + call <2 x i8> @llvm.cttz.v2i8(<2 x i8> undef, i1 false) + call <4 x i8> @llvm.cttz.v4i8(<4 x i8> undef, i1 false) + call <8 x i8> @llvm.cttz.v8i8(<8 x i8> undef, i1 false) + call <16 x i8> @llvm.cttz.v16i8(<16 x i8> undef, i1 false) + call @llvm.cttz.nxv1i8( undef, i1 false) + call @llvm.cttz.nxv2i8( undef, i1 false) + call @llvm.cttz.nxv4i8( undef, i1 false) + call @llvm.cttz.nxv8i8( undef, i1 false) + call @llvm.cttz.nxv16i8( undef, i1 false) + call @llvm.cttz.nxv32i8( undef, i1 false) + call @llvm.cttz.nxv64i8( undef, i1 false) + call <2 x i16> @llvm.cttz.v2i16(<2 x i16> undef, i1 false) + call <4 x i16> @llvm.cttz.v4i16(<4 x i16> undef, i1 false) + call <8 x i16> @llvm.cttz.v8i16(<8 x i16> undef, i1 false) + call <16 x i16> @llvm.cttz.v16i16(<16 x i16> undef, i1 false) + call @llvm.cttz.nxv1i16( undef, i1 false) + call @llvm.cttz.nxv2i16( undef, i1 false) + call @llvm.cttz.nxv4i16( undef, i1 false) + call @llvm.cttz.nxv8i16( undef, i1 false) + call @llvm.cttz.nxv16i16( undef, i1 false) + call @llvm.cttz.nxv32i16( undef, i1 false) + call <2 x i32> @llvm.cttz.v2i32(<2 x i32> undef, i1 false) + call <4 x i32> @llvm.cttz.v4i32(<4 x i32> undef, i1 false) + call <8 x i32> @llvm.cttz.v8i32(<8 x i32> undef, i1 false) + call <16 x i32> @llvm.cttz.v16i32(<16 x i32> undef, i1 false) + call @llvm.cttz.nxv1i32( undef, i1 false) + call @llvm.cttz.nxv2i32( undef, i1 false) + call @llvm.cttz.nxv4i32( undef, i1 false) + call @llvm.cttz.nxv8i32( undef, i1 false) + call @llvm.cttz.nxv16i32( undef, i1 false) + call <2 x i64> @llvm.cttz.v2i64(<2 x i64> undef, i1 false) + call <4 x i64> @llvm.cttz.v4i64(<4 x i64> undef, i1 false) + call <8 x i64> @llvm.cttz.v8i64(<8 x i64> undef, i1 false) + call <16 x i64> @llvm.cttz.v16i64(<16 x i64> undef, i1 false) + call @llvm.cttz.nxv1i64( undef, i1 false) + call @llvm.cttz.nxv2i64( undef, i1 false) + call @llvm.cttz.nxv4i64( undef, i1 false) + call @llvm.cttz.nxv8i64( undef, i1 false) + call @llvm.cttz.nxv16i64( undef, i1 false) + ret void +} + define void @ctpop() { ; NOZVBB-LABEL: 'ctpop' ; NOZVBB-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %1 = call i8 @llvm.ctpop.i8(i8 undef) @@ -778,6 +1032,86 @@ declare @llvm.vp.bswap.nxv4i64(, @llvm.vp.bswap.nxv8i64(, , i32) declare @llvm.vp.bswap.nxv16i64(, , i32) +declare <2 x i8> @llvm.ctlz.v2i8(<2 x i8>, i1) +declare <4 x i8> @llvm.ctlz.v4i8(<4 x i8>, i1) +declare <8 x i8> @llvm.ctlz.v8i8(<8 x i8>, i1) +declare <16 x i8> @llvm.ctlz.v16i8(<16 x i8>, i1) +declare @llvm.ctlz.nxv1i8(, i1) +declare @llvm.ctlz.nxv2i8(, i1) +declare @llvm.ctlz.nxv4i8(, i1) +declare @llvm.ctlz.nxv8i8(, i1) +declare @llvm.ctlz.nxv16i8(, i1) +declare @llvm.ctlz.nxv32i8(, i1) +declare @llvm.ctlz.nxv64i8(, i1) +declare <2 x i16> @llvm.ctlz.v2i16(<2 x i16>, i1) +declare <4 x i16> @llvm.ctlz.v4i16(<4 x i16>, i1) +declare <8 x i16> @llvm.ctlz.v8i16(<8 x i16>, i1) +declare <16 x i16> @llvm.ctlz.v16i16(<16 x i16>, i1) +declare @llvm.ctlz.nxv1i16(, i1) +declare @llvm.ctlz.nxv2i16(, i1) +declare @llvm.ctlz.nxv4i16(, i1) +declare @llvm.ctlz.nxv8i16(, i1) +declare @llvm.ctlz.nxv16i16(, i1) +declare @llvm.ctlz.nxv32i16(, i1) +declare <2 x i32> @llvm.ctlz.v2i32(<2 x i32>, i1) +declare <4 x i32> @llvm.ctlz.v4i32(<4 x i32>, i1) +declare <8 x i32> @llvm.ctlz.v8i32(<8 x i32>, i1) +declare <16 x i32> @llvm.ctlz.v16i32(<16 x i32>, i1) +declare @llvm.ctlz.nxv1i32(, i1) +declare @llvm.ctlz.nxv2i32(, i1) +declare @llvm.ctlz.nxv4i32(, i1) +declare @llvm.ctlz.nxv8i32(, i1) +declare @llvm.ctlz.nxv16i32(, i1) +declare <2 x i64> @llvm.ctlz.v2i64(<2 x i64>, i1) +declare <4 x i64> @llvm.ctlz.v4i64(<4 x i64>, i1) +declare <8 x i64> @llvm.ctlz.v8i64(<8 x i64>, i1) +declare <16 x i64> @llvm.ctlz.v16i64(<16 x i64>, i1) +declare @llvm.ctlz.nxv1i64(, i1) +declare @llvm.ctlz.nxv2i64(, i1) +declare @llvm.ctlz.nxv4i64(, i1) +declare @llvm.ctlz.nxv8i64(, i1) +declare @llvm.ctlz.nxv16i64(, i1) + +declare <2 x i8> @llvm.cttz.v2i8(<2 x i8>, i1) +declare <4 x i8> @llvm.cttz.v4i8(<4 x i8>, i1) +declare <8 x i8> @llvm.cttz.v8i8(<8 x i8>, i1) +declare <16 x i8> @llvm.cttz.v16i8(<16 x i8>, i1) +declare @llvm.cttz.nxv1i8(, i1) +declare @llvm.cttz.nxv2i8(, i1) +declare @llvm.cttz.nxv4i8(, i1) +declare @llvm.cttz.nxv8i8(, i1) +declare @llvm.cttz.nxv16i8(, i1) +declare @llvm.cttz.nxv32i8(, i1) +declare @llvm.cttz.nxv64i8(, i1) +declare <2 x i16> @llvm.cttz.v2i16(<2 x i16>, i1) +declare <4 x i16> @llvm.cttz.v4i16(<4 x i16>, i1) +declare <8 x i16> @llvm.cttz.v8i16(<8 x i16>, i1) +declare <16 x i16> @llvm.cttz.v16i16(<16 x i16>, i1) +declare @llvm.cttz.nxv1i16(, i1) +declare @llvm.cttz.nxv2i16(, i1) +declare @llvm.cttz.nxv4i16(, i1) +declare @llvm.cttz.nxv8i16(, i1) +declare @llvm.cttz.nxv16i16(, i1) +declare @llvm.cttz.nxv32i16(, i1) +declare <2 x i32> @llvm.cttz.v2i32(<2 x i32>, i1) +declare <4 x i32> @llvm.cttz.v4i32(<4 x i32>, i1) +declare <8 x i32> @llvm.cttz.v8i32(<8 x i32>, i1) +declare <16 x i32> @llvm.cttz.v16i32(<16 x i32>, i1) +declare @llvm.cttz.nxv1i32(, i1) +declare @llvm.cttz.nxv2i32(, i1) +declare @llvm.cttz.nxv4i32(, i1) +declare @llvm.cttz.nxv8i32(, i1) +declare @llvm.cttz.nxv16i32(, i1) +declare <2 x i64> @llvm.cttz.v2i64(<2 x i64>, i1) +declare <4 x i64> @llvm.cttz.v4i64(<4 x i64>, i1) +declare <8 x i64> @llvm.cttz.v8i64(<8 x i64>, i1) +declare <16 x i64> @llvm.cttz.v16i64(<16 x i64>, i1) +declare @llvm.cttz.nxv1i64(, i1) +declare @llvm.cttz.nxv2i64(, i1) +declare @llvm.cttz.nxv4i64(, i1) +declare @llvm.cttz.nxv8i64(, i1) +declare @llvm.cttz.nxv16i64(, i1) + declare <2 x i8> @llvm.vp.ctpop.v2i8(<2 x i8>, <2 x i1>, i32) declare <4 x i8> @llvm.vp.ctpop.v4i8(<4 x i8>, <4 x i1>, i32) declare <8 x i8> @llvm.vp.ctpop.v8i8(<8 x i8>, <8 x i1>, i32)