Skip to content

Commit 74a4321

Browse files
committed
Remove some unused code && implement the vp_fneg cost in TTI
1 parent 3264b28 commit 74a4321

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
@@ -1106,6 +1106,8 @@ RISCVTTIImpl::getIntrinsicInstrCost(const IntrinsicCostAttributes &ICA,
11061106
case Intrinsic::vp_udiv:
11071107
case Intrinsic::vp_urem:
11081108
case Intrinsic::vp_xor:
1109+
// TODO: add new patch for it.
1110+
case Intrinsic::vp_fneg:
11091111
// vp float arithmetic ops.
11101112
case Intrinsic::vp_fadd:
11111113
case Intrinsic::vp_fsub:

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

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

1003-
if (VectorIntrinsicID == Intrinsic::vp_icmp ||
1004-
VectorIntrinsicID == Intrinsic::vp_fcmp) {
1005-
auto &Ctx = State.Builder.getContext();
1006-
Value *Pred = MetadataAsValue::get(
1007-
Ctx, MDString::get(Ctx, CmpInst::getPredicateName(getPredicate())));
1008-
Args.push_back(Pred);
1009-
}
1010-
10111003
Value *VPInst = VBuilder.createSimpleIntrinsic(
10121004
VectorIntrinsicID, TysForDecl[0], Args, "vp.call");
10131005

@@ -1069,20 +1061,6 @@ InstructionCost VPWidenIntrinsicRecipe::computeCost(ElementCount VF,
10691061
ParamTys.push_back(
10701062
ToVectorTy(Ctx.Types.inferScalarType(getOperand(I)), VF));
10711063

1072-
// TODO: Implment in cost model
1073-
if (std::optional<unsigned> FOp =
1074-
VPIntrinsic::getFunctionalOpcodeForVP(VectorIntrinsicID)) {
1075-
if (FOp == Instruction::FNeg) {
1076-
// Instruction *CtxI =
1077-
dyn_cast_or_null<Instruction>(getUnderlyingValue());
1078-
Type *VectorTy = ToVectorTy(getResultType(), VF);
1079-
return Ctx.TTI.getArithmeticInstrCost(
1080-
FOp.value(), VectorTy, CostKind,
1081-
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None},
1082-
{TargetTransformInfo::OK_AnyValue, TargetTransformInfo::OP_None});
1083-
}
1084-
}
1085-
10861064
// TODO: Rework TTI interface to avoid reliance on underlying IntrinsicInst.
10871065
FastMathFlags FMF = hasFastMathFlags() ? getFastMathFlags() : FastMathFlags();
10881066
IntrinsicCostAttributes CostAttrs(

0 commit comments

Comments
 (0)