[llvm] 03798f2 - {RISCV] Backout cttz/ctlz instruction costs

Philip Reames via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 24 15:41:01 PDT 2022


Author: Philip Reames
Date: 2022-08-24T15:40:48-07:00
New Revision: 03798f268be127c3dbd5805e744e6e0ec9c2cf44

URL: https://github.com/llvm/llvm-project/commit/03798f268be127c3dbd5805e744e6e0ec9c2cf44
DIFF: https://github.com/llvm/llvm-project/commit/03798f268be127c3dbd5805e744e6e0ec9c2cf44.diff

LOG: {RISCV] Backout cttz/ctlz instruction costs

Craig points out correctly in post-commit review that these depend on the availability of floating point extensions.

Added: 
    

Modified: 
    llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
    llvm/test/Analysis/CostModel/RISCV/integer-bit-manip.ll

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 7a26959f1116..718f95127300 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -438,68 +438,6 @@ static const CostTblEntry VectorIntrinsicCostTable[]{
    {Intrinsic::ctpop, MVT::nxv2i64, 21},
    {Intrinsic::ctpop, MVT::nxv4i64, 21},
    {Intrinsic::ctpop, MVT::nxv8i64, 21},
-   {Intrinsic::ctlz, MVT::v2i8, 10},
-   {Intrinsic::ctlz, MVT::v4i8, 10},
-   {Intrinsic::ctlz, MVT::v8i8, 10},
-   {Intrinsic::ctlz, MVT::v16i8, 10},
-   {Intrinsic::ctlz, MVT::nxv2i8, 10},
-   {Intrinsic::ctlz, MVT::nxv4i8, 10},
-   {Intrinsic::ctlz, MVT::nxv8i8, 10},
-   {Intrinsic::ctlz, MVT::nxv16i8, 10},
-   {Intrinsic::ctlz, MVT::v2i16, 7},
-   {Intrinsic::ctlz, MVT::v4i16, 7},
-   {Intrinsic::ctlz, MVT::v8i16, 7},
-   {Intrinsic::ctlz, MVT::v16i16, 7},
-   {Intrinsic::ctlz, MVT::nxv2i16, 7},
-   {Intrinsic::ctlz, MVT::nxv4i16, 7},
-   {Intrinsic::ctlz, MVT::nxv8i16, 7},
-   {Intrinsic::ctlz, MVT::nxv16i16, 7},
-   {Intrinsic::ctlz, MVT::v2i32, 8},
-   {Intrinsic::ctlz, MVT::v4i32, 8},
-   {Intrinsic::ctlz, MVT::v8i32, 8},
-   {Intrinsic::ctlz, MVT::v16i32, 8},
-   {Intrinsic::ctlz, MVT::nxv2i32, 11},
-   {Intrinsic::ctlz, MVT::nxv4i32, 11},
-   {Intrinsic::ctlz, MVT::nxv8i32, 11},
-   {Intrinsic::ctlz, MVT::nxv16i32, 31},
-   {Intrinsic::ctlz, MVT::v2i64, 35},
-   {Intrinsic::ctlz, MVT::v4i64, 35},
-   {Intrinsic::ctlz, MVT::v8i64, 35},
-   {Intrinsic::ctlz, MVT::v16i64, 35},
-   {Intrinsic::ctlz, MVT::nxv2i64, 35},
-   {Intrinsic::ctlz, MVT::nxv4i64, 35},
-   {Intrinsic::ctlz, MVT::nxv8i64, 35},
-   {Intrinsic::cttz, MVT::v2i8, 13},
-   {Intrinsic::cttz, MVT::v4i8, 13},
-   {Intrinsic::cttz, MVT::v8i8, 13},
-   {Intrinsic::cttz, MVT::v16i8, 13},
-   {Intrinsic::cttz, MVT::nxv2i8, 13},
-   {Intrinsic::cttz, MVT::nxv4i8, 13},
-   {Intrinsic::cttz, MVT::nxv8i8, 13},
-   {Intrinsic::cttz, MVT::nxv16i8, 13},
-   {Intrinsic::cttz, MVT::v2i16, 9},
-   {Intrinsic::cttz, MVT::v4i16, 9},
-   {Intrinsic::cttz, MVT::v8i16, 9},
-   {Intrinsic::cttz, MVT::v16i16, 9},
-   {Intrinsic::cttz, MVT::nxv2i16, 9},
-   {Intrinsic::cttz, MVT::nxv4i16, 9},
-   {Intrinsic::cttz, MVT::nxv8i16, 9},
-   {Intrinsic::cttz, MVT::nxv16i16, 9},
-   {Intrinsic::cttz, MVT::v2i32, 10},
-   {Intrinsic::cttz, MVT::v4i32, 10},
-   {Intrinsic::cttz, MVT::v8i32, 10},
-   {Intrinsic::cttz, MVT::v16i32, 10},
-   {Intrinsic::cttz, MVT::nxv2i32, 13},
-   {Intrinsic::cttz, MVT::nxv4i32, 13},
-   {Intrinsic::cttz, MVT::nxv8i32, 13},
-   {Intrinsic::cttz, MVT::nxv16i32, 24},
-   {Intrinsic::cttz, MVT::v2i64, 25},
-   {Intrinsic::cttz, MVT::v4i64, 25},
-   {Intrinsic::cttz, MVT::v8i64, 25},
-   {Intrinsic::cttz, MVT::v16i64, 25},
-   {Intrinsic::cttz, MVT::nxv2i64, 25},
-   {Intrinsic::cttz, MVT::nxv4i64, 25},
-   {Intrinsic::cttz, MVT::nxv8i64, 25},
 };
 
 InstructionCost

diff  --git a/llvm/test/Analysis/CostModel/RISCV/integer-bit-manip.ll b/llvm/test/Analysis/CostModel/RISCV/integer-bit-manip.ll
index d74c61a41a91..83159912337f 100644
--- a/llvm/test/Analysis/CostModel/RISCV/integer-bit-manip.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/integer-bit-manip.ll
@@ -223,41 +223,41 @@ define void @ctpop() {
 define void @ctlz() {
 ; CHECK-LABEL: 'ctlz'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %1 = call i8 @llvm.ctlz.i8(i8 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %2 = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %3 = call <4 x i8> @llvm.ctlz.v4i8(<4 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %4 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %5 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %6 = call <vscale x 2 x i8> @llvm.ctlz.nxv2i8(<vscale x 2 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %7 = call <vscale x 4 x i8> @llvm.ctlz.nxv4i8(<vscale x 4 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %8 = call <vscale x 8 x i8> @llvm.ctlz.nxv8i8(<vscale x 8 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %9 = call <vscale x 16 x i8> @llvm.ctlz.nxv16i8(<vscale x 16 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %2 = call <2 x i8> @llvm.ctlz.v2i8(<2 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %3 = call <4 x i8> @llvm.ctlz.v4i8(<4 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %4 = call <8 x i8> @llvm.ctlz.v8i8(<8 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %5 = call <16 x i8> @llvm.ctlz.v16i8(<16 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %6 = call <vscale x 2 x i8> @llvm.ctlz.nxv2i8(<vscale x 2 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %7 = call <vscale x 4 x i8> @llvm.ctlz.nxv4i8(<vscale x 4 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %8 = call <vscale x 8 x i8> @llvm.ctlz.nxv8i8(<vscale x 8 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %9 = call <vscale x 16 x i8> @llvm.ctlz.nxv16i8(<vscale x 16 x i8> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %10 = call i16 @llvm.ctlz.i16(i16 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %11 = call <2 x i16> @llvm.ctlz.v2i16(<2 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %12 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %13 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %14 = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %15 = call <vscale x 2 x i16> @llvm.ctlz.nxv2i16(<vscale x 2 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %16 = call <vscale x 4 x i16> @llvm.ctlz.nxv4i16(<vscale x 4 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %17 = call <vscale x 8 x i16> @llvm.ctlz.nxv8i16(<vscale x 8 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 7 for instruction: %18 = call <vscale x 16 x i16> @llvm.ctlz.nxv16i16(<vscale x 16 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %11 = call <2 x i16> @llvm.ctlz.v2i16(<2 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %12 = call <4 x i16> @llvm.ctlz.v4i16(<4 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %13 = call <8 x i16> @llvm.ctlz.v8i16(<8 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %14 = call <16 x i16> @llvm.ctlz.v16i16(<16 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %15 = call <vscale x 2 x i16> @llvm.ctlz.nxv2i16(<vscale x 2 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %16 = call <vscale x 4 x i16> @llvm.ctlz.nxv4i16(<vscale x 4 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %17 = call <vscale x 8 x i16> @llvm.ctlz.nxv8i16(<vscale x 8 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %18 = call <vscale x 16 x i16> @llvm.ctlz.nxv16i16(<vscale x 16 x i16> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %19 = call i32 @llvm.ctlz.i32(i32 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %20 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %21 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %22 = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 8 for instruction: %23 = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %24 = call <vscale x 2 x i32> @llvm.ctlz.nxv2i32(<vscale x 2 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %25 = call <vscale x 4 x i32> @llvm.ctlz.nxv4i32(<vscale x 4 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 11 for instruction: %26 = call <vscale x 8 x i32> @llvm.ctlz.nxv8i32(<vscale x 8 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 31 for instruction: %27 = call <vscale x 16 x i32> @llvm.ctlz.nxv16i32(<vscale x 16 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %20 = call <2 x i32> @llvm.ctlz.v2i32(<2 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %21 = call <4 x i32> @llvm.ctlz.v4i32(<4 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %22 = call <8 x i32> @llvm.ctlz.v8i32(<8 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %23 = call <16 x i32> @llvm.ctlz.v16i32(<16 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %24 = call <vscale x 2 x i32> @llvm.ctlz.nxv2i32(<vscale x 2 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %25 = call <vscale x 4 x i32> @llvm.ctlz.nxv4i32(<vscale x 4 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %26 = call <vscale x 8 x i32> @llvm.ctlz.nxv8i32(<vscale x 8 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %27 = call <vscale x 16 x i32> @llvm.ctlz.nxv16i32(<vscale x 16 x i32> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %28 = call i64 @llvm.ctlz.i64(i64 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %29 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %30 = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %31 = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %32 = call <16 x i64> @llvm.ctlz.v16i64(<16 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %33 = call <vscale x 2 x i64> @llvm.ctlz.nxv2i64(<vscale x 2 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %34 = call <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 35 for instruction: %35 = call <vscale x 8 x i64> @llvm.ctlz.nxv8i64(<vscale x 8 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 70 for instruction: %36 = call <vscale x 16 x i64> @llvm.ctlz.nxv16i64(<vscale x 16 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %29 = call <2 x i64> @llvm.ctlz.v2i64(<2 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %30 = call <4 x i64> @llvm.ctlz.v4i64(<4 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %31 = call <8 x i64> @llvm.ctlz.v8i64(<8 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %32 = call <16 x i64> @llvm.ctlz.v16i64(<16 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %33 = call <vscale x 2 x i64> @llvm.ctlz.nxv2i64(<vscale x 2 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %34 = call <vscale x 4 x i64> @llvm.ctlz.nxv4i64(<vscale x 4 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %35 = call <vscale x 8 x i64> @llvm.ctlz.nxv8i64(<vscale x 8 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %36 = call <vscale x 16 x i64> @llvm.ctlz.nxv16i64(<vscale x 16 x i64> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   call i8 @llvm.ctlz.i8(i8 undef)
@@ -302,41 +302,41 @@ define void @ctlz() {
 define void @cttz() {
 ; CHECK-LABEL: 'cttz'
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %1 = call i8 @llvm.cttz.i8(i8 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %2 = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %3 = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %4 = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %5 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %6 = call <vscale x 2 x i8> @llvm.cttz.nxv2i8(<vscale x 2 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %7 = call <vscale x 4 x i8> @llvm.cttz.nxv4i8(<vscale x 4 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %8 = call <vscale x 8 x i8> @llvm.cttz.nxv8i8(<vscale x 8 x i8> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %9 = call <vscale x 16 x i8> @llvm.cttz.nxv16i8(<vscale x 16 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %2 = call <2 x i8> @llvm.cttz.v2i8(<2 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %3 = call <4 x i8> @llvm.cttz.v4i8(<4 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %4 = call <8 x i8> @llvm.cttz.v8i8(<8 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %5 = call <16 x i8> @llvm.cttz.v16i8(<16 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %6 = call <vscale x 2 x i8> @llvm.cttz.nxv2i8(<vscale x 2 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %7 = call <vscale x 4 x i8> @llvm.cttz.nxv4i8(<vscale x 4 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %8 = call <vscale x 8 x i8> @llvm.cttz.nxv8i8(<vscale x 8 x i8> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %9 = call <vscale x 16 x i8> @llvm.cttz.nxv16i8(<vscale x 16 x i8> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %10 = call i16 @llvm.cttz.i16(i16 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %11 = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %12 = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %13 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %14 = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %15 = call <vscale x 2 x i16> @llvm.cttz.nxv2i16(<vscale x 2 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %16 = call <vscale x 4 x i16> @llvm.cttz.nxv4i16(<vscale x 4 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %17 = call <vscale x 8 x i16> @llvm.cttz.nxv8i16(<vscale x 8 x i16> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 9 for instruction: %18 = call <vscale x 16 x i16> @llvm.cttz.nxv16i16(<vscale x 16 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %11 = call <2 x i16> @llvm.cttz.v2i16(<2 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %12 = call <4 x i16> @llvm.cttz.v4i16(<4 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %13 = call <8 x i16> @llvm.cttz.v8i16(<8 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %14 = call <16 x i16> @llvm.cttz.v16i16(<16 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %15 = call <vscale x 2 x i16> @llvm.cttz.nxv2i16(<vscale x 2 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %16 = call <vscale x 4 x i16> @llvm.cttz.nxv4i16(<vscale x 4 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %17 = call <vscale x 8 x i16> @llvm.cttz.nxv8i16(<vscale x 8 x i16> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %18 = call <vscale x 16 x i16> @llvm.cttz.nxv16i16(<vscale x 16 x i16> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %19 = call i32 @llvm.cttz.i32(i32 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %20 = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %21 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %22 = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %23 = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %24 = call <vscale x 2 x i32> @llvm.cttz.nxv2i32(<vscale x 2 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %25 = call <vscale x 4 x i32> @llvm.cttz.nxv4i32(<vscale x 4 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 13 for instruction: %26 = call <vscale x 8 x i32> @llvm.cttz.nxv8i32(<vscale x 8 x i32> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 24 for instruction: %27 = call <vscale x 16 x i32> @llvm.cttz.nxv16i32(<vscale x 16 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %20 = call <2 x i32> @llvm.cttz.v2i32(<2 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %21 = call <4 x i32> @llvm.cttz.v4i32(<4 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %22 = call <8 x i32> @llvm.cttz.v8i32(<8 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %23 = call <16 x i32> @llvm.cttz.v16i32(<16 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %24 = call <vscale x 2 x i32> @llvm.cttz.nxv2i32(<vscale x 2 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %25 = call <vscale x 4 x i32> @llvm.cttz.nxv4i32(<vscale x 4 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %26 = call <vscale x 8 x i32> @llvm.cttz.nxv8i32(<vscale x 8 x i32> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %27 = call <vscale x 16 x i32> @llvm.cttz.nxv16i32(<vscale x 16 x i32> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 10 for instruction: %28 = call i64 @llvm.cttz.i64(i64 undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %29 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %30 = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %31 = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %32 = call <16 x i64> @llvm.cttz.v16i64(<16 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %33 = call <vscale x 2 x i64> @llvm.cttz.nxv2i64(<vscale x 2 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %34 = call <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 25 for instruction: %35 = call <vscale x 8 x i64> @llvm.cttz.nxv8i64(<vscale x 8 x i64> undef, i1 false)
-; CHECK-NEXT:  Cost Model: Found an estimated cost of 50 for instruction: %36 = call <vscale x 16 x i64> @llvm.cttz.nxv16i64(<vscale x 16 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 22 for instruction: %29 = call <2 x i64> @llvm.cttz.v2i64(<2 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 44 for instruction: %30 = call <4 x i64> @llvm.cttz.v4i64(<4 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 88 for instruction: %31 = call <8 x i64> @llvm.cttz.v8i64(<8 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Found an estimated cost of 176 for instruction: %32 = call <16 x i64> @llvm.cttz.v16i64(<16 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %33 = call <vscale x 2 x i64> @llvm.cttz.nxv2i64(<vscale x 2 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %34 = call <vscale x 4 x i64> @llvm.cttz.nxv4i64(<vscale x 4 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %35 = call <vscale x 8 x i64> @llvm.cttz.nxv8i64(<vscale x 8 x i64> undef, i1 false)
+; CHECK-NEXT:  Cost Model: Invalid cost for instruction: %36 = call <vscale x 16 x i64> @llvm.cttz.nxv16i64(<vscale x 16 x i64> undef, i1 false)
 ; CHECK-NEXT:  Cost Model: Found an estimated cost of 1 for instruction: ret void
 ;
   call i8 @llvm.cttz.i8(i8 undef)


        


More information about the llvm-commits mailing list