-
Notifications
You must be signed in to change notification settings - Fork 12.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RISCV][CostModel] Add cost for @llvm.experimental.vp.splice #122223
Open
LiqinWeng
wants to merge
1
commit into
llvm:main
Choose a base branch
from
LiqinWeng:cost-for-splice
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+356
−0
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@llvm/pr-subscribers-llvm-analysis Author: LiqinWeng (LiqinWeng) ChangesPatch is 67.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/122223.diff 3 Files Affected:
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp
index ee6622516a5ac0..af3e69f854a86a 100644
--- a/llvm/lib/Analysis/CostModel.cpp
+++ b/llvm/lib/Analysis/CostModel.cpp
@@ -54,6 +54,7 @@ PreservedAnalyses CostModelPrinterPass::run(Function &F,
// TODO: Use a pass parameter instead of cl::opt CostKind to determine
// which cost kind to print.
InstructionCost Cost;
+ SmallVector<Value *, 6> Args;
auto *II = dyn_cast<IntrinsicInst>(&Inst);
if (II && TypeBasedIntrinsicCost) {
IntrinsicCostAttributes ICA(II->getIntrinsicID(), *II,
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 850d6244affa50..6789944d9c6cab 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -1189,6 +1189,33 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
: RISCV::VMV_V_X,
LT.second, CostKind);
}
+ case Intrinsic::experimental_vp_splice: {
+ auto LT = getTypeLegalizationCost(RetTy);
+ SmallVector<unsigned, 3> Opcodes;
+ Value *ImmValue = *(ICA.getInst()->arg_begin() + 2);
+ auto *Imm = dyn_cast<ConstantInt>(ImmValue);
+ if (Imm->isNegative())
+ Opcodes = {RISCV::VSLIDEDOWN_VI, RISCV::VSLIDEUP_VX};
+ else
+ Opcodes = {RISCV::VSLIDEDOWN_VX, RISCV::VSLIDEUP_VI};
+
+ if (!ST->hasVInstructions())
+ return InstructionCost::getInvalid();
+
+ if (LT.second.getScalarType() == MVT::i1) {
+ SmallVector<unsigned, 8> AddOpcodes = {
+ RISCV::VMV1R_V, RISCV::VMV1R_V, RISCV::VMV_V_I, RISCV::VMERGE_VIM,
+ RISCV::VMV_V_I, RISCV::VMV1R_V, RISCV::VMERGE_VIM, RISCV::VMSNE_VI};
+ return LT.first *
+ (getRISCVInstructionCost(Opcodes, LT.second, CostKind) +
+ getRISCVInstructionCost(AddOpcodes, LT.second, CostKind)) +
+ 1;
+ } else {
+ return LT.first * getRISCVInstructionCost(Opcodes, LT.second, CostKind) +
+ 1;
+ }
+ break;
+ }
}
if (ST->hasVInstructions() && RetTy->isVectorTy()) {
diff --git a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
index 5126a6a0a3cbcd..d118f49f7cac8b 100644
--- a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
@@ -2351,6 +2351,335 @@ define void @splat() {
ret void
}
+define void @splice() {
+; CHECK-LABEL: 'splice'
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %1 = call <2 x i1> @llvm.experimental.vp.splice.v2i1(<2 x i1> poison, <2 x i1> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %2 = call <4 x i1> @llvm.experimental.vp.splice.v4i1(<4 x i1> poison, <4 x i1> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %3 = call <8 x i1> @llvm.experimental.vp.splice.v8i1(<8 x i1> poison, <8 x i1> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %4 = call <16 x i1> @llvm.experimental.vp.splice.v16i1(<16 x i1> poison, <16 x i1> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %5 = call <2 x i1> @llvm.experimental.vp.splice.v2i1(<2 x i1> poison, <2 x i1> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %6 = call <4 x i1> @llvm.experimental.vp.splice.v4i1(<4 x i1> poison, <4 x i1> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %7 = call <8 x i1> @llvm.experimental.vp.splice.v8i1(<8 x i1> poison, <8 x i1> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %8 = call <16 x i1> @llvm.experimental.vp.splice.v16i1(<16 x i1> poison, <16 x i1> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %9 = call <2 x i8> @llvm.experimental.vp.splice.v2i8(<2 x i8> poison, <2 x i8> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %10 = call <4 x i8> @llvm.experimental.vp.splice.v4i8(<4 x i8> poison, <4 x i8> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = call <8 x i8> @llvm.experimental.vp.splice.v8i8(<8 x i8> poison, <8 x i8> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %12 = call <16 x i8> @llvm.experimental.vp.splice.v16i8(<16 x i8> poison, <16 x i8> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %13 = call <vscale x 2 x i8> @llvm.experimental.vp.splice.nxv2i8(<vscale x 2 x i8> poison, <vscale x 2 x i8> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %14 = call <vscale x 4 x i8> @llvm.experimental.vp.splice.nxv4i8(<vscale x 4 x i8> poison, <vscale x 4 x i8> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %15 = call <vscale x 8 x i8> @llvm.experimental.vp.splice.nxv8i8(<vscale x 8 x i8> poison, <vscale x 8 x i8> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %16 = call <vscale x 16 x i8> @llvm.experimental.vp.splice.nxv16i8(<vscale x 16 x i8> poison, <vscale x 16 x i8> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %17 = call <2 x i8> @llvm.experimental.vp.splice.v2i8(<2 x i8> poison, <2 x i8> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %18 = call <4 x i8> @llvm.experimental.vp.splice.v4i8(<4 x i8> poison, <4 x i8> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %19 = call <8 x i8> @llvm.experimental.vp.splice.v8i8(<8 x i8> poison, <8 x i8> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %20 = call <16 x i8> @llvm.experimental.vp.splice.v16i8(<16 x i8> poison, <16 x i8> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %21 = call <vscale x 2 x i8> @llvm.experimental.vp.splice.nxv2i8(<vscale x 2 x i8> poison, <vscale x 2 x i8> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %22 = call <vscale x 4 x i8> @llvm.experimental.vp.splice.nxv4i8(<vscale x 4 x i8> poison, <vscale x 4 x i8> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %23 = call <vscale x 8 x i8> @llvm.experimental.vp.splice.nxv8i8(<vscale x 8 x i8> poison, <vscale x 8 x i8> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %24 = call <vscale x 16 x i8> @llvm.experimental.vp.splice.nxv16i8(<vscale x 16 x i8> poison, <vscale x 16 x i8> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %25 = call <2 x i16> @llvm.experimental.vp.splice.v2i16(<2 x i16> poison, <2 x i16> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %26 = call <4 x i16> @llvm.experimental.vp.splice.v4i16(<4 x i16> poison, <4 x i16> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %27 = call <8 x i16> @llvm.experimental.vp.splice.v8i16(<8 x i16> poison, <8 x i16> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %28 = call <16 x i16> @llvm.experimental.vp.splice.v16i16(<16 x i16> poison, <16 x i16> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %29 = call <vscale x 2 x i16> @llvm.experimental.vp.splice.nxv2i16(<vscale x 2 x i16> poison, <vscale x 2 x i16> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %30 = call <vscale x 4 x i16> @llvm.experimental.vp.splice.nxv4i16(<vscale x 4 x i16> poison, <vscale x 4 x i16> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %31 = call <vscale x 8 x i16> @llvm.experimental.vp.splice.nxv8i16(<vscale x 8 x i16> poison, <vscale x 8 x i16> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %32 = call <vscale x 16 x i16> @llvm.experimental.vp.splice.nxv16i16(<vscale x 16 x i16> poison, <vscale x 16 x i16> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %33 = call <2 x i16> @llvm.experimental.vp.splice.v2i16(<2 x i16> poison, <2 x i16> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %34 = call <4 x i16> @llvm.experimental.vp.splice.v4i16(<4 x i16> poison, <4 x i16> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %35 = call <8 x i16> @llvm.experimental.vp.splice.v8i16(<8 x i16> poison, <8 x i16> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %36 = call <16 x i16> @llvm.experimental.vp.splice.v16i16(<16 x i16> poison, <16 x i16> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %37 = call <vscale x 2 x i16> @llvm.experimental.vp.splice.nxv2i16(<vscale x 2 x i16> poison, <vscale x 2 x i16> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %38 = call <vscale x 4 x i16> @llvm.experimental.vp.splice.nxv4i16(<vscale x 4 x i16> poison, <vscale x 4 x i16> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %39 = call <vscale x 8 x i16> @llvm.experimental.vp.splice.nxv8i16(<vscale x 8 x i16> poison, <vscale x 8 x i16> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %40 = call <vscale x 16 x i16> @llvm.experimental.vp.splice.nxv16i16(<vscale x 16 x i16> poison, <vscale x 16 x i16> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %41 = call <2 x i32> @llvm.experimental.vp.splice.v2i32(<2 x i32> poison, <2 x i32> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %42 = call <4 x i32> @llvm.experimental.vp.splice.v4i32(<4 x i32> poison, <4 x i32> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %43 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> poison, <8 x i32> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %44 = call <16 x i32> @llvm.experimental.vp.splice.v16i32(<16 x i32> poison, <16 x i32> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %45 = call <vscale x 2 x i32> @llvm.experimental.vp.splice.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %46 = call <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %47 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> poison, <vscale x 8 x i32> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %48 = call <vscale x 16 x i32> @llvm.experimental.vp.splice.nxv16i32(<vscale x 16 x i32> poison, <vscale x 16 x i32> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %49 = call <2 x i32> @llvm.experimental.vp.splice.v2i32(<2 x i32> poison, <2 x i32> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %50 = call <4 x i32> @llvm.experimental.vp.splice.v4i32(<4 x i32> poison, <4 x i32> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %51 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> poison, <8 x i32> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %52 = call <16 x i32> @llvm.experimental.vp.splice.v16i32(<16 x i32> poison, <16 x i32> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %53 = call <vscale x 2 x i32> @llvm.experimental.vp.splice.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %54 = call <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %55 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> poison, <vscale x 8 x i32> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %56 = call <vscale x 16 x i32> @llvm.experimental.vp.splice.nxv16i32(<vscale x 16 x i32> poison, <vscale x 16 x i32> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %57 = call <2 x i64> @llvm.experimental.vp.splice.v2i64(<2 x i64> poison, <2 x i64> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %58 = call <4 x i64> @llvm.experimental.vp.splice.v4i64(<4 x i64> poison, <4 x i64> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %59 = call <8 x i64> @llvm.experimental.vp.splice.v8i64(<8 x i64> poison, <8 x i64> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %60 = call <16 x i64> @llvm.experimental.vp.splice.v16i64(<16 x i64> poison, <16 x i64> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %61 = call <vscale x 2 x i64> @llvm.experimental.vp.splice.nxv2i64(<vscale x 2 x i64> poison, <vscale x 2 x i64> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %62 = call <vscale x 4 x i64> @llvm.experimental.vp.splice.nxv4i64(<vscale x 4 x i64> poison, <vscale x 4 x i64> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %63 = call <vscale x 8 x i64> @llvm.experimental.vp.splice.nxv8i64(<vscale x 8 x i64> poison, <vscale x 8 x i64> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %64 = call <vscale x 16 x i64> @llvm.experimental.vp.splice.nxv16i64(<vscale x 16 x i64> poison, <vscale x 16 x i64> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %65 = call <2 x i64> @llvm.experimental.vp.splice.v2i64(<2 x i64> poison, <2 x i64> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %66 = call <4 x i64> @llvm.experimental.vp.splice.v4i64(<4 x i64> poison, <4 x i64> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %67 = call <8 x i64> @llvm.experimental.vp.splice.v8i64(<8 x i64> poison, <8 x i64> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %68 = call <16 x i64> @llvm.experimental.vp.splice.v16i64(<16 x i64> poison, <16 x i64> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %69 = call <vscale x 2 x i64> @llvm.experimental.vp.splice.nxv2i64(<vscale x 2 x i64> poison, <vscale x 2 x i64> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %70 = call <vscale x 4 x i64> @llvm.experimental.vp.splice.nxv4i64(<vscale x 4 x i64> poison, <vscale x 4 x i64> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %71 = call <vscale x 8 x i64> @llvm.experimental.vp.splice.nxv8i64(<vscale x 8 x i64> poison, <vscale x 8 x i64> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %72 = call <vscale x 16 x i64> @llvm.experimental.vp.splice.nxv16i64(<vscale x 16 x i64> poison, <vscale x 16 x i64> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %73 = call <2 x float> @llvm.experimental.vp.splice.v2f32(<2 x float> poison, <2 x float> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %74 = call <4 x float> @llvm.experimental.vp.splice.v4f32(<4 x float> poison, <4 x float> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %75 = call <8 x float> @llvm.experimental.vp.splice.v8f32(<8 x float> poison, <8 x float> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %76 = call <16 x float> @llvm.experimental.vp.splice.v16f32(<16 x float> poison, <16 x float> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %77 = call <vscale x 2 x float> @llvm.experimental.vp.splice.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x float> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Mode...
[truncated]
|
@llvm/pr-subscribers-backend-risc-v Author: LiqinWeng (LiqinWeng) ChangesPatch is 67.15 KiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/122223.diff 3 Files Affected:
diff --git a/llvm/lib/Analysis/CostModel.cpp b/llvm/lib/Analysis/CostModel.cpp
index ee6622516a5ac0..af3e69f854a86a 100644
--- a/llvm/lib/Analysis/CostModel.cpp
+++ b/llvm/lib/Analysis/CostModel.cpp
@@ -54,6 +54,7 @@ PreservedAnalyses CostModelPrinterPass::run(Function &F,
// TODO: Use a pass parameter instead of cl::opt CostKind to determine
// which cost kind to print.
InstructionCost Cost;
+ SmallVector<Value *, 6> Args;
auto *II = dyn_cast<IntrinsicInst>(&Inst);
if (II && TypeBasedIntrinsicCost) {
IntrinsicCostAttributes ICA(II->getIntrinsicID(), *II,
diff --git a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
index 850d6244affa50..6789944d9c6cab 100644
--- a/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
+++ b/llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp
@@ -1189,6 +1189,33 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
: RISCV::VMV_V_X,
LT.second, CostKind);
}
+ case Intrinsic::experimental_vp_splice: {
+ auto LT = getTypeLegalizationCost(RetTy);
+ SmallVector<unsigned, 3> Opcodes;
+ Value *ImmValue = *(ICA.getInst()->arg_begin() + 2);
+ auto *Imm = dyn_cast<ConstantInt>(ImmValue);
+ if (Imm->isNegative())
+ Opcodes = {RISCV::VSLIDEDOWN_VI, RISCV::VSLIDEUP_VX};
+ else
+ Opcodes = {RISCV::VSLIDEDOWN_VX, RISCV::VSLIDEUP_VI};
+
+ if (!ST->hasVInstructions())
+ return InstructionCost::getInvalid();
+
+ if (LT.second.getScalarType() == MVT::i1) {
+ SmallVector<unsigned, 8> AddOpcodes = {
+ RISCV::VMV1R_V, RISCV::VMV1R_V, RISCV::VMV_V_I, RISCV::VMERGE_VIM,
+ RISCV::VMV_V_I, RISCV::VMV1R_V, RISCV::VMERGE_VIM, RISCV::VMSNE_VI};
+ return LT.first *
+ (getRISCVInstructionCost(Opcodes, LT.second, CostKind) +
+ getRISCVInstructionCost(AddOpcodes, LT.second, CostKind)) +
+ 1;
+ } else {
+ return LT.first * getRISCVInstructionCost(Opcodes, LT.second, CostKind) +
+ 1;
+ }
+ break;
+ }
}
if (ST->hasVInstructions() && RetTy->isVectorTy()) {
diff --git a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
index 5126a6a0a3cbcd..d118f49f7cac8b 100644
--- a/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll
@@ -2351,6 +2351,335 @@ define void @splat() {
ret void
}
+define void @splice() {
+; CHECK-LABEL: 'splice'
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %1 = call <2 x i1> @llvm.experimental.vp.splice.v2i1(<2 x i1> poison, <2 x i1> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %2 = call <4 x i1> @llvm.experimental.vp.splice.v4i1(<4 x i1> poison, <4 x i1> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %3 = call <8 x i1> @llvm.experimental.vp.splice.v8i1(<8 x i1> poison, <8 x i1> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %4 = call <16 x i1> @llvm.experimental.vp.splice.v16i1(<16 x i1> poison, <16 x i1> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %5 = call <2 x i1> @llvm.experimental.vp.splice.v2i1(<2 x i1> poison, <2 x i1> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %6 = call <4 x i1> @llvm.experimental.vp.splice.v4i1(<4 x i1> poison, <4 x i1> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %7 = call <8 x i1> @llvm.experimental.vp.splice.v8i1(<8 x i1> poison, <8 x i1> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 11 for instruction: %8 = call <16 x i1> @llvm.experimental.vp.splice.v16i1(<16 x i1> poison, <16 x i1> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %9 = call <2 x i8> @llvm.experimental.vp.splice.v2i8(<2 x i8> poison, <2 x i8> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %10 = call <4 x i8> @llvm.experimental.vp.splice.v4i8(<4 x i8> poison, <4 x i8> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %11 = call <8 x i8> @llvm.experimental.vp.splice.v8i8(<8 x i8> poison, <8 x i8> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %12 = call <16 x i8> @llvm.experimental.vp.splice.v16i8(<16 x i8> poison, <16 x i8> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %13 = call <vscale x 2 x i8> @llvm.experimental.vp.splice.nxv2i8(<vscale x 2 x i8> poison, <vscale x 2 x i8> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %14 = call <vscale x 4 x i8> @llvm.experimental.vp.splice.nxv4i8(<vscale x 4 x i8> poison, <vscale x 4 x i8> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %15 = call <vscale x 8 x i8> @llvm.experimental.vp.splice.nxv8i8(<vscale x 8 x i8> poison, <vscale x 8 x i8> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %16 = call <vscale x 16 x i8> @llvm.experimental.vp.splice.nxv16i8(<vscale x 16 x i8> poison, <vscale x 16 x i8> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %17 = call <2 x i8> @llvm.experimental.vp.splice.v2i8(<2 x i8> poison, <2 x i8> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %18 = call <4 x i8> @llvm.experimental.vp.splice.v4i8(<4 x i8> poison, <4 x i8> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %19 = call <8 x i8> @llvm.experimental.vp.splice.v8i8(<8 x i8> poison, <8 x i8> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %20 = call <16 x i8> @llvm.experimental.vp.splice.v16i8(<16 x i8> poison, <16 x i8> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %21 = call <vscale x 2 x i8> @llvm.experimental.vp.splice.nxv2i8(<vscale x 2 x i8> poison, <vscale x 2 x i8> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %22 = call <vscale x 4 x i8> @llvm.experimental.vp.splice.nxv4i8(<vscale x 4 x i8> poison, <vscale x 4 x i8> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %23 = call <vscale x 8 x i8> @llvm.experimental.vp.splice.nxv8i8(<vscale x 8 x i8> poison, <vscale x 8 x i8> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %24 = call <vscale x 16 x i8> @llvm.experimental.vp.splice.nxv16i8(<vscale x 16 x i8> poison, <vscale x 16 x i8> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %25 = call <2 x i16> @llvm.experimental.vp.splice.v2i16(<2 x i16> poison, <2 x i16> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %26 = call <4 x i16> @llvm.experimental.vp.splice.v4i16(<4 x i16> poison, <4 x i16> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %27 = call <8 x i16> @llvm.experimental.vp.splice.v8i16(<8 x i16> poison, <8 x i16> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %28 = call <16 x i16> @llvm.experimental.vp.splice.v16i16(<16 x i16> poison, <16 x i16> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %29 = call <vscale x 2 x i16> @llvm.experimental.vp.splice.nxv2i16(<vscale x 2 x i16> poison, <vscale x 2 x i16> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %30 = call <vscale x 4 x i16> @llvm.experimental.vp.splice.nxv4i16(<vscale x 4 x i16> poison, <vscale x 4 x i16> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %31 = call <vscale x 8 x i16> @llvm.experimental.vp.splice.nxv8i16(<vscale x 8 x i16> poison, <vscale x 8 x i16> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %32 = call <vscale x 16 x i16> @llvm.experimental.vp.splice.nxv16i16(<vscale x 16 x i16> poison, <vscale x 16 x i16> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %33 = call <2 x i16> @llvm.experimental.vp.splice.v2i16(<2 x i16> poison, <2 x i16> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %34 = call <4 x i16> @llvm.experimental.vp.splice.v4i16(<4 x i16> poison, <4 x i16> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %35 = call <8 x i16> @llvm.experimental.vp.splice.v8i16(<8 x i16> poison, <8 x i16> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %36 = call <16 x i16> @llvm.experimental.vp.splice.v16i16(<16 x i16> poison, <16 x i16> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %37 = call <vscale x 2 x i16> @llvm.experimental.vp.splice.nxv2i16(<vscale x 2 x i16> poison, <vscale x 2 x i16> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %38 = call <vscale x 4 x i16> @llvm.experimental.vp.splice.nxv4i16(<vscale x 4 x i16> poison, <vscale x 4 x i16> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %39 = call <vscale x 8 x i16> @llvm.experimental.vp.splice.nxv8i16(<vscale x 8 x i16> poison, <vscale x 8 x i16> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %40 = call <vscale x 16 x i16> @llvm.experimental.vp.splice.nxv16i16(<vscale x 16 x i16> poison, <vscale x 16 x i16> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %41 = call <2 x i32> @llvm.experimental.vp.splice.v2i32(<2 x i32> poison, <2 x i32> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %42 = call <4 x i32> @llvm.experimental.vp.splice.v4i32(<4 x i32> poison, <4 x i32> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %43 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> poison, <8 x i32> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %44 = call <16 x i32> @llvm.experimental.vp.splice.v16i32(<16 x i32> poison, <16 x i32> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %45 = call <vscale x 2 x i32> @llvm.experimental.vp.splice.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %46 = call <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %47 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> poison, <vscale x 8 x i32> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %48 = call <vscale x 16 x i32> @llvm.experimental.vp.splice.nxv16i32(<vscale x 16 x i32> poison, <vscale x 16 x i32> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %49 = call <2 x i32> @llvm.experimental.vp.splice.v2i32(<2 x i32> poison, <2 x i32> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %50 = call <4 x i32> @llvm.experimental.vp.splice.v4i32(<4 x i32> poison, <4 x i32> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %51 = call <8 x i32> @llvm.experimental.vp.splice.v8i32(<8 x i32> poison, <8 x i32> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %52 = call <16 x i32> @llvm.experimental.vp.splice.v16i32(<16 x i32> poison, <16 x i32> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %53 = call <vscale x 2 x i32> @llvm.experimental.vp.splice.nxv2i32(<vscale x 2 x i32> poison, <vscale x 2 x i32> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %54 = call <vscale x 4 x i32> @llvm.experimental.vp.splice.nxv4i32(<vscale x 4 x i32> poison, <vscale x 4 x i32> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %55 = call <vscale x 8 x i32> @llvm.experimental.vp.splice.nxv8i32(<vscale x 8 x i32> poison, <vscale x 8 x i32> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %56 = call <vscale x 16 x i32> @llvm.experimental.vp.splice.nxv16i32(<vscale x 16 x i32> poison, <vscale x 16 x i32> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %57 = call <2 x i64> @llvm.experimental.vp.splice.v2i64(<2 x i64> poison, <2 x i64> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %58 = call <4 x i64> @llvm.experimental.vp.splice.v4i64(<4 x i64> poison, <4 x i64> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %59 = call <8 x i64> @llvm.experimental.vp.splice.v8i64(<8 x i64> poison, <8 x i64> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %60 = call <16 x i64> @llvm.experimental.vp.splice.v16i64(<16 x i64> poison, <16 x i64> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %61 = call <vscale x 2 x i64> @llvm.experimental.vp.splice.nxv2i64(<vscale x 2 x i64> poison, <vscale x 2 x i64> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %62 = call <vscale x 4 x i64> @llvm.experimental.vp.splice.nxv4i64(<vscale x 4 x i64> poison, <vscale x 4 x i64> poison, i32 1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %63 = call <vscale x 8 x i64> @llvm.experimental.vp.splice.nxv8i64(<vscale x 8 x i64> poison, <vscale x 8 x i64> poison, i32 1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %64 = call <vscale x 16 x i64> @llvm.experimental.vp.splice.nxv16i64(<vscale x 16 x i64> poison, <vscale x 16 x i64> poison, i32 1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %65 = call <2 x i64> @llvm.experimental.vp.splice.v2i64(<2 x i64> poison, <2 x i64> poison, i32 -1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %66 = call <4 x i64> @llvm.experimental.vp.splice.v4i64(<4 x i64> poison, <4 x i64> poison, i32 -1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %67 = call <8 x i64> @llvm.experimental.vp.splice.v8i64(<8 x i64> poison, <8 x i64> poison, i32 -1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %68 = call <16 x i64> @llvm.experimental.vp.splice.v16i64(<16 x i64> poison, <16 x i64> poison, i32 -1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %69 = call <vscale x 2 x i64> @llvm.experimental.vp.splice.nxv2i64(<vscale x 2 x i64> poison, <vscale x 2 x i64> poison, i32 -1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %70 = call <vscale x 4 x i64> @llvm.experimental.vp.splice.nxv4i64(<vscale x 4 x i64> poison, <vscale x 4 x i64> poison, i32 -1, <vscale x 4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 17 for instruction: %71 = call <vscale x 8 x i64> @llvm.experimental.vp.splice.nxv8i64(<vscale x 8 x i64> poison, <vscale x 8 x i64> poison, i32 -1, <vscale x 8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 33 for instruction: %72 = call <vscale x 16 x i64> @llvm.experimental.vp.splice.nxv16i64(<vscale x 16 x i64> poison, <vscale x 16 x i64> poison, i32 -1, <vscale x 16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %73 = call <2 x float> @llvm.experimental.vp.splice.v2f32(<2 x float> poison, <2 x float> poison, i32 1, <2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %74 = call <4 x float> @llvm.experimental.vp.splice.v4f32(<4 x float> poison, <4 x float> poison, i32 1, <4 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %75 = call <8 x float> @llvm.experimental.vp.splice.v8f32(<8 x float> poison, <8 x float> poison, i32 1, <8 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %76 = call <16 x float> @llvm.experimental.vp.splice.v16f32(<16 x float> poison, <16 x float> poison, i32 1, <16 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %77 = call <vscale x 2 x float> @llvm.experimental.vp.splice.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x float> poison, i32 1, <vscale x 2 x i1> poison, i32 poison, i32 poison)
+; CHECK-NEXT: Cost Mode...
[truncated]
|
LiqinWeng
force-pushed
the
cost-for-splice
branch
from
January 9, 2025 06:28
24a63f9
to
558b06d
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
No description provided.