Skip to content

Commit 566012a

Browse files
authored
[RISCV][TTI] Implement instruction cost for vp_merge. (#112327)
This patch implement the instruction for `vp_merge`, which will generate similar instruction sequence to the `select` instruction.
1 parent 1834660 commit 566012a

File tree

2 files changed

+185
-1
lines changed

2 files changed

+185
-1
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,6 +1130,10 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
11301130
return getCmpSelInstrCost(*FOp, ICA.getReturnType(), ICA.getArgTypes()[0],
11311131
CmpInst::BAD_ICMP_PREDICATE, CostKind);
11321132
}
1133+
case Intrinsic::vp_merge:
1134+
return getCmpSelInstrCost(Instruction::Select, ICA.getReturnType(),
1135+
ICA.getArgTypes()[0], CmpInst::BAD_ICMP_PREDICATE,
1136+
CostKind);
11331137
}
11341138

11351139
if (ST->hasVInstructions() && RetTy->isVectorTy()) {
@@ -2429,4 +2433,4 @@ bool RISCVTTIImpl::isProfitableToSinkOperands(
24292433
Ops.push_back(&OpIdx.value());
24302434
}
24312435
return true;
2432-
}
2436+
}

0 commit comments

Comments
 (0)