[llvm-branch-commits] [llvm] [IR] Autoupgrade trivial VP intrinsics to their non-VP counterparts (PR #212490)
via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Jul 28 06:30:29 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-llvm-transforms
@llvm/pr-subscribers-backend-risc-v
Author: Luke Lau (lukel97)
<details>
<summary>Changes</summary>
As a first step towards removing trivial VP intrinsics, autoupgrade them to their non-VP counterparts for backwards compatibility. Subsequent PRs can then remove the intrinsics themselves.
Since trivial VP intrinsics only set lanes to poison, it's safe to replace them with non predicated versions.
RFC: https://discourse.llvm.org/t/rfc-remove-trivial-vp-intrinsics/90972
---
<sub>Stack created with <a href="https://github.com/github/gh-stack">GitHub Stacks CLI</a> • <a href="https://gh.io/stacks-feedback">Give Feedback 💬</a></sub>
---
Patch is 1.25 MiB, truncated to 20.00 KiB below, full version: https://github.com/llvm/llvm-project/pull/212490.diff
47 Files Affected:
- (modified) llvm/lib/IR/AutoUpgrade.cpp (+71)
- (modified) llvm/test/Analysis/CostModel/RISCV/arith-fp.ll (-470)
- (modified) llvm/test/Analysis/CostModel/RISCV/cast.ll (-1763)
- (modified) llvm/test/Analysis/CostModel/RISCV/cmp.ll (+105-217)
- (modified) llvm/test/Analysis/CostModel/RISCV/fround.ll (+308-308)
- (modified) llvm/test/Analysis/CostModel/RISCV/int-bit-manip.ll (+310-167)
- (modified) llvm/test/Analysis/CostModel/RISCV/rvv-select.ll (+100-160)
- (modified) llvm/test/Analysis/CostModel/RISCV/vp-intrinsics.ll (+370-416)
- (added) llvm/test/Assembler/auto_upgrade_vp.ll (+148)
- (modified) llvm/test/CodeGen/VE/Packed/vp_add.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Packed/vp_and.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Packed/vp_fadd.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Packed/vp_fdiv.ll (+18-39)
- (modified) llvm/test/CodeGen/VE/Packed/vp_fmul.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Packed/vp_fsub.ll (+11-19)
- (modified) llvm/test/CodeGen/VE/Packed/vp_mul.ll (+11-23)
- (modified) llvm/test/CodeGen/VE/Packed/vp_or.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Packed/vp_shl.ll (+11-19)
- (modified) llvm/test/CodeGen/VE/Packed/vp_sra.ll (+11-19)
- (modified) llvm/test/CodeGen/VE/Packed/vp_srl.ll (+11-19)
- (modified) llvm/test/CodeGen/VE/Packed/vp_sub.ll (+11-19)
- (modified) llvm/test/CodeGen/VE/Packed/vp_xor.ll (+10-16)
- (modified) llvm/test/CodeGen/VE/Vector/vp_add.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_and.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_ashr.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_fadd.ll (+12-12)
- (modified) llvm/test/CodeGen/VE/Vector/vp_fdiv.ll (+12-12)
- (modified) llvm/test/CodeGen/VE/Vector/vp_fma.ll (+16-16)
- (modified) llvm/test/CodeGen/VE/Vector/vp_fmul.ll (+12-12)
- (modified) llvm/test/CodeGen/VE/Vector/vp_fsub.ll (+14-18)
- (modified) llvm/test/CodeGen/VE/Vector/vp_lshr.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_mul.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_or.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_select.ll (+12-20)
- (modified) llvm/test/CodeGen/VE/Vector/vp_shl.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_sra.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_srl.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_sub.ll (+4-4)
- (modified) llvm/test/CodeGen/VE/Vector/vp_xor.ll (+4-4)
- (modified) llvm/test/Transforms/DeadStoreElimination/dead-vp.store.ll (+2-2)
- (modified) llvm/test/Transforms/GVN/vp_gather_scatter.ll (+1-1)
- (modified) llvm/test/Transforms/InstCombine/fabs.ll (+1-2)
- (modified) llvm/test/Transforms/InstSimplify/add_vp.ll (+6-18)
- (modified) llvm/test/Transforms/LICM/vector-intrinsics.ll (+1-1)
- (modified) llvm/test/Transforms/PreISelIntrinsicLowering/expand-vp.ll (+64-68)
- (modified) llvm/test/Transforms/VectorCombine/RISCV/vpintrin-scalarization-shufflevector-splat.ll (+2-2)
- (modified) llvm/test/Transforms/VectorCombine/RISCV/vpintrin-scalarization.ll (+250-545)
``````````diff
diff --git a/llvm/lib/IR/AutoUpgrade.cpp b/llvm/lib/IR/AutoUpgrade.cpp
index 97ba01997b9b9..d826dd95401c1 100644
--- a/llvm/lib/IR/AutoUpgrade.cpp
+++ b/llvm/lib/IR/AutoUpgrade.cpp
@@ -1288,6 +1288,45 @@ static bool consumeNVVMPtrAddrSpace(StringRef &Name) {
Name.consume_front("param");
}
+static bool shouldUpgradeVPIntrinsic(StringRef Name) {
+ // Avoid cttz.elts clashing with cttz.
+ if (Name.starts_with("vp.cttz.elts"))
+ return false;
+ return Name.starts_with("vp.select") || Name.starts_with("vp.add") ||
+ Name.starts_with("vp.sub") || Name.starts_with("vp.mul") ||
+ Name.starts_with("vp.ashr") || Name.starts_with("vp.lshr") ||
+ Name.starts_with("vp.shl") || Name.starts_with("vp.or") ||
+ Name.starts_with("vp.and") || Name.starts_with("vp.xor") ||
+ Name.starts_with("vp.abs") || Name.starts_with("vp.smax") ||
+ Name.starts_with("vp.smin") || Name.starts_with("vp.umax") ||
+ Name.starts_with("vp.umin") || Name.starts_with("vp.copysign") ||
+ Name.starts_with("vp.minnum") || Name.starts_with("vp.maxnum") ||
+ Name.starts_with("vp.minimum") || Name.starts_with("vp.maximum") ||
+ Name.starts_with("vp.fadd") || Name.starts_with("vp.fsub") ||
+ Name.starts_with("vp.fmul") || Name.starts_with("vp.fdiv") ||
+ Name.starts_with("vp.frem") || Name.starts_with("vp.fneg") ||
+ Name.starts_with("vp.fabs") || Name.starts_with("vp.sqrt") ||
+ Name.starts_with("vp.fma") || Name.starts_with("vp.fmuladd") ||
+ Name.starts_with("vp.trunc") || Name.starts_with("vp.zext") ||
+ Name.starts_with("vp.sext") || Name.starts_with("vp.fptrunc") ||
+ Name.starts_with("vp.fpext") || Name.starts_with("vp.fptoui") ||
+ Name.starts_with("vp.fptosi") || Name.starts_with("vp.uitofp") ||
+ Name.starts_with("vp.sitofp") || Name.starts_with("vp.ptrtoint") ||
+ Name.starts_with("vp.inttoptr") || Name.starts_with("vp.fcmp") ||
+ Name.starts_with("vp.icmp") || Name.starts_with("vp.ceil") ||
+ Name.starts_with("vp.floor") || Name.starts_with("vp.rint") ||
+ Name.starts_with("vp.nearbyint") || Name.starts_with("vp.round") ||
+ Name.starts_with("vp.roundeven") ||
+ Name.starts_with("vp.roundtozero") || Name.starts_with("vp.lrint") ||
+ Name.starts_with("vp.llrint") || Name.starts_with("vp.bitreverse") ||
+ Name.starts_with("vp.bswap") || Name.starts_with("vp.ctpop") ||
+ Name.starts_with("vp.ctlz") || Name.starts_with("vp.cttz") ||
+ Name.starts_with("vp.sadd.sat") || Name.starts_with("vp.uadd.sat") ||
+ Name.starts_with("vp.ssub.sat") || Name.starts_with("vp.usub.sat") ||
+ Name.starts_with("vp.fshl") || Name.starts_with("vp.fshr") ||
+ Name.starts_with("vp.is.fpclass");
+}
+
static bool convertIntrinsicValidType(StringRef Name,
const FunctionType *FuncTy) {
Type *HalfTy = Type::getHalfTy(FuncTy->getContext());
@@ -1918,6 +1957,8 @@ static bool upgradeIntrinsicFunction1(Function *F, Function *&NewFn,
break;
return true;
}
+ if (shouldUpgradeVPIntrinsic(Name))
+ return true;
break;
}
@@ -5125,6 +5166,34 @@ static Value *upgradeConvertIntrinsicCall(StringRef Name, CallBase *CI,
return nullptr;
}
+static Value *upgradeVPIntrinsicCall(CallBase *CI, IRBuilder<> &Builder) {
+ Value *Rep;
+ auto Opcode = cast<VPIntrinsic>(CI)->getFunctionalOpcode();
+ if (Opcode && Instruction::isUnaryOp(*Opcode))
+ Rep = Builder.CreateUnOp((Instruction::UnaryOps)*Opcode,
+ CI->getArgOperand(0));
+ else if (Opcode && Instruction::isBinaryOp(*Opcode))
+ Rep = Builder.CreateBinOp((Instruction::BinaryOps)*Opcode,
+ CI->getArgOperand(0), CI->getArgOperand(1));
+ else if (Opcode && Instruction::isCast(*Opcode))
+ Rep = Builder.CreateCast((Instruction::CastOps)*Opcode,
+ CI->getArgOperand(0), CI->getType());
+ else if (Opcode == Instruction::ICmp || Opcode == Instruction::FCmp)
+ Rep = Builder.CreateCmp(cast<VPCmpIntrinsic>(CI)->getPredicate(),
+ CI->getArgOperand(0), CI->getArgOperand(1));
+ else if (Opcode == Instruction::Select)
+ Rep = Builder.CreateSelect(CI->getArgOperand(0), CI->getArgOperand(1),
+ CI->getArgOperand(2));
+ else if (auto IntrinsicID =
+ cast<VPIntrinsic>(CI)->getFunctionalIntrinsicID()) {
+ SmallVector<Value *, 2> Args(drop_end(CI->args(), 2));
+ Rep = Builder.CreateIntrinsic(CI->getType(), *IntrinsicID, Args, {});
+ } else
+ llvm_unreachable("Unexpected vp intrinsic");
+ Rep->takeName(CI);
+ return Rep;
+}
+
static bool upgradeIntrinsicCallWithDefaultArgs(CallBase *CI, Function *NewFn,
IRBuilder<> &Builder) {
Intrinsic::ID IID = NewFn->getIntrinsicID();
@@ -5233,6 +5302,8 @@ void llvm::UpgradeIntrinsicCall(CallBase *CI, Function *NewFn) {
} else if (Name == "lifetime.start.i64" || Name == "lifetime.end.i64") {
// Delete calls to invalid @llvm.lifetime.{start,end}.i64 intrinsics.
Rep = nullptr;
+ } else if (shouldUpgradeVPIntrinsic(Name)) {
+ Rep = upgradeVPIntrinsicCall(CI, Builder);
} else {
llvm_unreachable("Unknown function for CallBase upgrade.");
}
diff --git a/llvm/test/Analysis/CostModel/RISCV/arith-fp.ll b/llvm/test/Analysis/CostModel/RISCV/arith-fp.ll
index 03bdd439ba2fc..1c2fb2c7d61d6 100644
--- a/llvm/test/Analysis/CostModel/RISCV/arith-fp.ll
+++ b/llvm/test/Analysis/CostModel/RISCV/arith-fp.ll
@@ -27,24 +27,6 @@ define void @fadd() {
; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %NXV2F64 = fadd <vscale x 2 x double> poison, poison
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %NXV4F64 = fadd <vscale x 4 x double> poison, poison
; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %NXV8F64 = fadd <vscale x 8 x double> poison, poison
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1F32_VP = call <1 x float> @llvm.vp.fadd.v1f32(<1 x float> poison, <1 x float> poison, <1 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F32_VP = call <2 x float> @llvm.vp.fadd.v2f32(<2 x float> poison, <2 x float> poison, <2 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F32_VP = call <4 x float> @llvm.vp.fadd.v4f32(<4 x float> poison, <4 x float> poison, <4 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V8F32_VP = call <8 x float> @llvm.vp.fadd.v8f32(<8 x float> poison, <8 x float> poison, <8 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V16F32_VP = call <16 x float> @llvm.vp.fadd.v16f32(<16 x float> poison, <16 x float> poison, <16 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1F64_VP = call <1 x double> @llvm.vp.fadd.v1f64(<1 x double> poison, <1 x double> poison, <1 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F64_VP = call <2 x double> @llvm.vp.fadd.v2f64(<2 x double> poison, <2 x double> poison, <2 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V4F64_VP = call <4 x double> @llvm.vp.fadd.v4f64(<4 x double> poison, <4 x double> poison, <4 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V8F64_VP = call <8 x double> @llvm.vp.fadd.v8f64(<8 x double> poison, <8 x double> poison, <8 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV1F32_VP = call <vscale x 1 x float> @llvm.vp.fadd.nxv1f32(<vscale x 1 x float> poison, <vscale x 1 x float> poison, <vscale x 1 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV2F32_VP = call <vscale x 2 x float> @llvm.vp.fadd.nxv2f32(<vscale x 2 x float> poison, <vscale x 2 x float> poison, <vscale x 2 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %NXV4F32_VP = call <vscale x 4 x float> @llvm.vp.fadd.nxv4f32(<vscale x 4 x float> poison, <vscale x 4 x float> poison, <vscale x 4 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %NXV8F32_VP = call <vscale x 8 x float> @llvm.vp.fadd.nxv8f32(<vscale x 8 x float> poison, <vscale x 8 x float> poison, <vscale x 8 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %NXV16F32_VP = call <vscale x 16 x float> @llvm.vp.fadd.nxv16f32(<vscale x 16 x float> poison, <vscale x 16 x float> poison, <vscale x 16 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV1F64_VP = call <vscale x 1 x double> @llvm.vp.fadd.nxv1f64(<vscale x 1 x double> poison, <vscale x 1 x double> poison, <vscale x 1 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %NXV2F64_VP = call <vscale x 2 x double> @llvm.vp.fadd.nxv2f64(<vscale x 2 x double> poison, <vscale x 2 x double> poison, <vscale x 2 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %NXV4F64_VP = call <vscale x 4 x double> @llvm.vp.fadd.nxv4f64(<vscale x 4 x double> poison, <vscale x 4 x double> poison, <vscale x 4 x i1> poison, i32 poison)
-; CHECK-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %NXV8F64_VP = call <vscale x 8 x double> @llvm.vp.fadd.nxv8f64(<vscale x 8 x double> poison, <vscale x 8 x double> poison, <vscale x 8 x i1> poison, i32 poison)
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%F32 = fadd float poison, poison
@@ -110,16 +92,6 @@ define void @fadd_bf16() {
; ZVFH-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %NXV4BF16 = fadd <vscale x 4 x bfloat> poison, poison
; ZVFH-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %NXV8BF16 = fadd <vscale x 8 x bfloat> poison, poison
; ZVFH-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %NXV16BF16 = fadd <vscale x 16 x bfloat> poison, poison
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1BF16_VP = call <1 x bfloat> @llvm.vp.fadd.v1bf16(<1 x bfloat> poison, <1 x bfloat> poison, <1 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2BF16_VP = call <2 x bfloat> @llvm.vp.fadd.v2bf16(<2 x bfloat> poison, <2 x bfloat> poison, <2 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4BF16_VP = call <4 x bfloat> @llvm.vp.fadd.v4bf16(<4 x bfloat> poison, <4 x bfloat> poison, <4 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8BF16_VP = call <8 x bfloat> @llvm.vp.fadd.v8bf16(<8 x bfloat> poison, <8 x bfloat> poison, <8 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V16BF16_VP = call <16 x bfloat> @llvm.vp.fadd.v16bf16(<16 x bfloat> poison, <16 x bfloat> poison, <16 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV1BF16_VP = call <vscale x 1 x bfloat> @llvm.vp.fadd.nxv1bf16(<vscale x 1 x bfloat> poison, <vscale x 1 x bfloat> poison, <vscale x 1 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV2BF16_VP = call <vscale x 2 x bfloat> @llvm.vp.fadd.nxv2bf16(<vscale x 2 x bfloat> poison, <vscale x 2 x bfloat> poison, <vscale x 2 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %NXV4BF16_VP = call <vscale x 4 x bfloat> @llvm.vp.fadd.nxv4bf16(<vscale x 4 x bfloat> poison, <vscale x 4 x bfloat> poison, <vscale x 4 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %NXV8BF16_VP = call <vscale x 8 x bfloat> @llvm.vp.fadd.nxv8bf16(<vscale x 8 x bfloat> poison, <vscale x 8 x bfloat> poison, <vscale x 8 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %NXV16BF16_VP = call <vscale x 16 x bfloat> @llvm.vp.fadd.nxv16bf16(<vscale x 16 x bfloat> poison, <vscale x 16 x bfloat> poison, <vscale x 16 x i1> poison, i32 poison)
; ZVFH-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; ZVFHMIN-LABEL: 'fadd_bf16'
@@ -134,16 +106,6 @@ define void @fadd_bf16() {
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 9 for instruction: %NXV4BF16 = fadd <vscale x 4 x bfloat> poison, poison
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 18 for instruction: %NXV8BF16 = fadd <vscale x 8 x bfloat> poison, poison
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 36 for instruction: %NXV16BF16 = fadd <vscale x 16 x bfloat> poison, poison
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V1BF16_VP = call <1 x bfloat> @llvm.vp.fadd.v1bf16(<1 x bfloat> poison, <1 x bfloat> poison, <1 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V2BF16_VP = call <2 x bfloat> @llvm.vp.fadd.v2bf16(<2 x bfloat> poison, <2 x bfloat> poison, <2 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %V4BF16_VP = call <4 x bfloat> @llvm.vp.fadd.v4bf16(<4 x bfloat> poison, <4 x bfloat> poison, <4 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %V8BF16_VP = call <8 x bfloat> @llvm.vp.fadd.v8bf16(<8 x bfloat> poison, <8 x bfloat> poison, <8 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %V16BF16_VP = call <16 x bfloat> @llvm.vp.fadd.v16bf16(<16 x bfloat> poison, <16 x bfloat> poison, <16 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV1BF16_VP = call <vscale x 1 x bfloat> @llvm.vp.fadd.nxv1bf16(<vscale x 1 x bfloat> poison, <vscale x 1 x bfloat> poison, <vscale x 1 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 3 for instruction: %NXV2BF16_VP = call <vscale x 2 x bfloat> @llvm.vp.fadd.nxv2bf16(<vscale x 2 x bfloat> poison, <vscale x 2 x bfloat> poison, <vscale x 2 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 5 for instruction: %NXV4BF16_VP = call <vscale x 4 x bfloat> @llvm.vp.fadd.nxv4bf16(<vscale x 4 x bfloat> poison, <vscale x 4 x bfloat> poison, <vscale x 4 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 10 for instruction: %NXV8BF16_VP = call <vscale x 8 x bfloat> @llvm.vp.fadd.nxv8bf16(<vscale x 8 x bfloat> poison, <vscale x 8 x bfloat> poison, <vscale x 8 x i1> poison, i32 poison)
-; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 20 for instruction: %NXV16BF16_VP = call <vscale x 16 x bfloat> @llvm.vp.fadd.nxv16bf16(<vscale x 16 x bfloat> poison, <vscale x 16 x bfloat> poison, <vscale x 16 x i1> poison, i32 poison)
; ZVFHMIN-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
; NO-ZFHMIN-LABEL: 'fadd_bf16'
@@ -158,16 +120,6 @@ define void @fadd_bf16() {
; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV4BF16 = fadd <vscale x 4 x bfloat> poison, poison
; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV8BF16 = fadd <vscale x 8 x bfloat> poison, poison
; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV16BF16 = fadd <vscale x 16 x bfloat> poison, poison
-; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1BF16_VP = call <1 x bfloat> @llvm.vp.fadd.v1bf16(<1 x bfloat> poison, <1 x bfloat> poison, <1 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V2BF16_VP = call <2 x bfloat> @llvm.vp.fadd.v2bf16(<2 x bfloat> poison, <2 x bfloat> poison, <2 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %V4BF16_VP = call <4 x bfloat> @llvm.vp.fadd.v4bf16(<4 x bfloat> poison, <4 x bfloat> poison, <4 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %V8BF16_VP = call <8 x bfloat> @llvm.vp.fadd.v8bf16(<8 x bfloat> poison, <8 x bfloat> poison, <8 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 32 for instruction: %V16BF16_VP = call <16 x bfloat> @llvm.vp.fadd.v16bf16(<16 x bfloat> poison, <16 x bfloat> poison, <16 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV1BF16_VP = call <vscale x 1 x bfloat> @llvm.vp.fadd.nxv1bf16(<vscale x 1 x bfloat> poison, <vscale x 1 x bfloat> poison, <vscale x 1 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV2BF16_VP = call <vscale x 2 x bfloat> @llvm.vp.fadd.nxv2bf16(<vscale x 2 x bfloat> poison, <vscale x 2 x bfloat> poison, <vscale x 2 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV4BF16_VP = call <vscale x 4 x bfloat> @llvm.vp.fadd.nxv4bf16(<vscale x 4 x bfloat> poison, <vscale x 4 x bfloat> poison, <vscale x 4 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV8BF16_VP = call <vscale x 8 x bfloat> @llvm.vp.fadd.nxv8bf16(<vscale x 8 x bfloat> poison, <vscale x 8 x bfloat> poison, <vscale x 8 x i1> poison, i32 poison)
-; NO-ZFHMIN-NEXT: Cost Model: Invalid cost for instruction: %NXV16BF16_VP = call <vscale x 16 x bfloat> @llvm.vp.fadd.nxv16bf16(<vscale x 16 x bfloat> poison, <vscale x 16 x bfloat> poison, <vscale x 16 x i1> poison, i32 poison)
; NO-ZFHMIN-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret void
;
%BF16 = fadd bfloat poison, poison
@@ -214,16 +166,6 @@ define void @fadd_f16() {
; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %NXV8F16 = fadd <vscale x 8 x half> poison, poison
; ZVFH-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %NXV16F16 = fadd <vscale x 16 x half> poison, poison
; ZVFH-NEXT: Cost Model: Found an estimated cost of 16 for instruction: %NXV32F16 = fadd <vscale x 32 x half> poison, poison
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V1F16_VP = call <1 x half> @llvm.vp.fadd.v1f16(<1 x half> poison, <1 x half> poison, <1 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V2F16_VP = call <2 x half> @llvm.vp.fadd.v2f16(<2 x half> poison, <2 x half> poison, <2 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V4F16_VP = call <4 x half> @llvm.vp.fadd.v4f16(<4 x half> poison, <4 x half> poison, <4 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %V8F16_VP = call <8 x half> @llvm.vp.fadd.v8f16(<8 x half> poison, <8 x half> poison, <8 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %V16F16_VP = call <16 x half> @llvm.vp.fadd.v16f16(<16 x half> poison, <16 x half> poison, <16 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV1F16_VP = call <vscale x 1 x half> @llvm.vp.fadd.nxv1f16(<vscale x 1 x half> poison, <vscale x 1 x half> poison, <vscale x 1 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV2F16_VP = call <vscale x 2 x half> @llvm.vp.fadd.nxv2f16(<vscale x 2 x half> poison, <vscale x 2 x half> poison, <vscale x 2 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 2 for instruction: %NXV4F16_VP = call <vscale x 4 x half> @llvm.vp.fadd.nxv4f16(<vscale x 4 x half> poison, <vscale x 4 x half> poison, <vscale x 4 x i1> poison, i32 poison)
-; ZVFH-NEXT: Cost Model: Found an estimated cost of 4 for instruction: %NXV8F16_VP = call <vscale x 8 x half> @llvm.vp.fadd.nxv8f16(<vscale x 8 x half> poison...
[truncated]
``````````
</details>
https://github.com/llvm/llvm-project/pull/212490
More information about the llvm-branch-commits
mailing list