[llvm] [VPlan] Use DerivedIV in convertToStridedAccesses (PR #209611)
Mel Chen via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 5 03:52:26 PDT 2026
Mel-Chen wrote:
> It looks like the costing change is a regression. We used to correctly cost the individual VPInstructions but the PtrInduction DerivedIV is now always zero.
>
> I understand there's a TODO here but is it still relevant? I'm not sure the complexity of the BinOpGEPFlagsTy is worth it.
Currently, integer Mul and PtrAdd without an underlying instruction aren't assigned any cost:
``` c++
InstructionCost VPInstruction::computeCost(ElementCount VF,
VPCostContext &Ctx) const {
if (Instruction::isBinaryOp(getOpcode())) {
if (!getUnderlyingValue() && getOpcode() != Instruction::FMul) {
// TODO: Compute cost for VPInstructions without underlying values once
// the legacy cost model has been retired.
return 0;
}
```
so returning 0 for DerivedIV cost works fine for now.
BTW, it seems GEP costs aren't currently calculated directly anyway. Their cost is reflected in the memory operations using them. While this could be a good direction for future improvement, returning 0 cost for this patch seems fine to me.
https://github.com/llvm/llvm-project/pull/209611
More information about the llvm-commits
mailing list