Skip to content

Commit c33900e

Browse files
fhahnronlieb
authored andcommitted
[VPlan] Pass intrinsic inst to TTI in VPWidenCallRecipe::computeCost.
Follow-up to 9ccf825, adjust computeCost to also pass IntrinsicInst to TTI if available, as there are multiple places in TTI which use the IntrinsicInst. Fixes llvm#107016. Change-Id: Iaa3b8d03d851f5feddebc5d34feaa4d901b6dd4f
1 parent f6460f3 commit c33900e

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

llvm/lib/Transforms/Vectorize/VPlanRecipes.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -965,8 +965,10 @@ InstructionCost VPWidenCallRecipe::computeCost(ElementCount VF,
965965
ParamTys.push_back(
966966
ToVectorTy(Ctx.Types.inferScalarType(getOperand(I)), VF));
967967

968-
IntrinsicCostAttributes CostAttrs(VectorIntrinsicID, RetTy, Arguments,
969-
ParamTys, FMF);
968+
// TODO: Rework TTI interface to avoid reliance on underlying IntrinsicInst.
969+
IntrinsicCostAttributes CostAttrs(
970+
VectorIntrinsicID, RetTy, Arguments, ParamTys, FMF,
971+
dyn_cast_or_null<IntrinsicInst>(getUnderlyingValue()));
970972
return Ctx.TTI.getIntrinsicInstrCost(CostAttrs, CostKind);
971973
}
972974

revert_patches.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,3 @@ Revert: Depends upon older [ctx_prof] reverts
163163
73c3b7337b0a [ctx_prof] Add support for ICP (#105469)
164164
1022323c9b7c [ctx_prof] Move the "from json" logic more centrally to reuse it from test. (#106129)
165165
contact : mhalk (Michael Halkenhaeuser)
166-
---
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)