Skip to content

Commit 9fef9db

Browse files
committed
Revert "[VPlan] Implement VPWidenCallRecipe::computeCost (NFCI). (llvm#106047)"
Breaks build of 534.hpgmg This reverts commit 9ccf825 and b0de7fa [VPlan] Use op from underlying call in computeCost if needed. Change-Id: Ib8b10cc72bfb787d5f295971aa871e625148aa9d
1 parent aacf4d7 commit 9fef9db

File tree

3 files changed

+4
-49
lines changed

3 files changed

+4
-49
lines changed

llvm/lib/Transforms/Vectorize/VPlan.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1565,10 +1565,6 @@ class VPWidenCallRecipe : public VPSingleDefRecipe {
15651565
/// Produce a widened version of the call instruction.
15661566
void execute(VPTransformState &State) override;
15671567

1568-
/// Return the cost of this VPWidenCallRecipe.
1569-
InstructionCost computeCost(ElementCount VF,
1570-
VPCostContext &Ctx) const override;
1571-
15721568
Function *getCalledScalarFunction() const {
15731569
return cast<Function>(getOperand(getNumOperands() - 1)->getLiveInIRValue());
15741570
}

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 0 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -925,51 +925,6 @@ void VPWidenCallRecipe::execute(VPTransformState &State) {
925925
}
926926
}
927927

928-
InstructionCost VPWidenCallRecipe::computeCost(ElementCount VF,
929-
VPCostContext &Ctx) const {
930-
TTI::TargetCostKind CostKind = TTI::TCK_RecipThroughput;
931-
if (Variant) {
932-
return Ctx.TTI.getCallInstrCost(nullptr, Variant->getReturnType(),
933-
Variant->getFunctionType()->params(),
934-
CostKind);
935-
}
936-
937-
FastMathFlags FMF;
938-
// TODO: Manage flags via VPRecipeWithIRFlags.
939-
if (auto *FPMO = dyn_cast_or_null<FPMathOperator>(getUnderlyingValue()))
940-
FMF = FPMO->getFastMathFlags();
941-
942-
// Some backends analyze intrinsic arguments to determine cost. Use the
943-
// underlying value for the operand if it has one. Otherwise try to use the
944-
// operand of the underlying call instruction, if there is one. Otherwise
945-
// clear Arguments.
946-
// TODO: Rework TTI interface to be independent of concrete IR values.
947-
SmallVector<const Value *> Arguments;
948-
for (const auto &[Idx, Op] : enumerate(operands())) {
949-
auto *V = Op->getUnderlyingValue();
950-
if (!V) {
951-
if (auto *UI = dyn_cast_or_null<CallBase>(getUnderlyingValue())) {
952-
Arguments.push_back(UI->getArgOperand(Idx));
953-
continue;
954-
}
955-
Arguments.clear();
956-
break;
957-
}
958-
Arguments.push_back(V);
959-
}
960-
961-
Type *RetTy =
962-
ToVectorTy(Ctx.Types.inferScalarType(this->getVPSingleValue()), VF);
963-
SmallVector<Type *> ParamTys;
964-
for (unsigned I = 0; I != getNumOperands(); ++I)
965-
ParamTys.push_back(
966-
ToVectorTy(Ctx.Types.inferScalarType(getOperand(I)), VF));
967-
968-
IntrinsicCostAttributes CostAttrs(VectorIntrinsicID, RetTy, Arguments,
969-
ParamTys, FMF);
970-
return Ctx.TTI.getIntrinsicInstrCost(CostAttrs, CostKind);
971-
}
972-
973928
#if !defined(NDEBUG) || defined(LLVM_ENABLE_DUMP)
974929
void VPWidenCallRecipe::print(raw_ostream &O, const Twine &Indent,
975930
VPSlotTracker &SlotTracker) const {

revert_patches.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,3 +164,7 @@ Revert: Depends upon older [ctx_prof] reverts
164164
1022323c9b7c [ctx_prof] Move the "from json" logic more centrally to reuse it from test. (#106129)
165165
contact : mhalk (Michael Halkenhaeuser)
166166
---
167+
Breaks build of 534.hpgmg
168+
9ccf82543d50 - [VPlan] Implement VPWidenCallRecipe::computeCost (NFCI). (#106047)
169+
b0de7fa46687 [VPlan] Use op from underlying call in computeCost if needed.
170+
---

0 commit comments

Comments
 (0)