Skip to content

Commit f834ca4

Browse files
committed
[RISCV][TTI] Implment instruction cost for vp_merge.
`vp_merge` will generate `vmerge.vvm` in RISCV.
1 parent bc06f64 commit f834ca4

File tree

2 files changed

+138
-133
lines changed

2 files changed

+138
-133
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1132,6 +1132,11 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
11321132
return getCmpSelInstrCost(*FOp, ICA.getReturnType(), ICA.getArgTypes()[0],
11331133
CmpInst::BAD_ICMP_PREDICATE, CostKind);
11341134
}
1135+
case Intrinsic::vp_merge: {
1136+
auto LT = getTypeLegalizationCost(RetTy);
1137+
return LT.first *
1138+
getRISCVInstructionCost(RISCV::VMERGE_VVM, LT.second, CostKind);
1139+
}
11351140
}
11361141

11371142
if (ST->hasVInstructions() && RetTy->isVectorTy()) {
@@ -2431,4 +2436,4 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
24312436
Ops.push_back(&OpIdx.value());
24322437
}
24332438
return true;
2434-
}
2439+
}

0 commit comments

Comments
 (0)