Skip to content

Commit 177bee5

Browse files
committed
Remove some unused code && implement the vp_fneg cost in TTI
1 parent 7f56a9c commit 177bee5

File tree

2 files changed

+2
-22
lines changed

2 files changed

+2
-22
lines changed

llvm/lib/Target/RISCV/RISCVTargetTransformInfo.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,6 +1118,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
11181118
case Intrinsic::vp_udiv:
11191119
case Intrinsic::vp_urem:
11201120
case Intrinsic::vp_xor:
1121+
// TODO: add new patch for it.
1122+
case Intrinsic::vp_fneg:
11211123
// vp float arithmetic ops.
11221124
case Intrinsic::vp_fadd:
11231125
case Intrinsic::vp_fsub:

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -963,14 +963,6 @@ void VPWidenIntrinsicRecipe::execute(VPTransformState &State) {
963963
// Remove EVL from Args
964964
Args.pop_back();
965965

966-
if (VectorIntrinsicID == Intrinsic::vp_icmp ||
967-
VectorIntrinsicID == Intrinsic::vp_fcmp) {
968-
auto &Ctx = State.Builder.getContext();
969-
Value *Pred = MetadataAsValue::get(
970-
Ctx, MDString::get(Ctx, CmpInst::getPredicateName(getPredicate())));
971-
Args.push_back(Pred);
972-
}
973-
974966
Value *VPInst = VBuilder.createSimpleIntrinsic(
975967
VectorIntrinsicID, TysForDecl[0], Args, "vp.call");
976968

@@ -1032,20 +1024,6 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
10321024
ParamTys.push_back(
10331025
ToVectorTy(Ctx.Types.inferScalarType(getOperand(I)), VF));
10341026

1035-
// TODO: Implment in cost model
1036-
if (std::optional<unsigned> FOp =
1037-
VPIntrinsic::getFunctionalOpcodeForVP(VectorIntrinsicID)) {
1038-
if (FOp == Instruction::FNeg) {
1039-
// Instruction *CtxI =
1040-
dyn_cast_or_null<Instruction>(getUnderlyingValue());
1041-
Type *VectorTy = ToVectorTy(getResultType(), VF);
1042-
return Ctx.TTI.getArithmeticInstrCost(
1043-
FOp.value(), VectorTy, CostKind,
1044-
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None},
1045-
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None});
1046-
}
1047-
}
1048-
10491027
// TODO: Rework TTI interface to avoid reliance on underlying IntrinsicInst.
10501028
FastMathFlags FMF = hasFastMathFlags() ? getFastMathFlags() : FastMathFlags();
10511029
IntrinsicCostAttributes CostAttrs(

0 commit comments

Comments
 (0)