[llvm] [RISCV][TTI] Implement getAddressComputationCost() in RISCV TTI. (PR #149955)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 24 10:22:54 PDT 2025
================
@@ -3083,9 +3083,18 @@ InstructionCost VPWidenMemoryRecipe::computeCost(ElementCount VF,
const Value *Ptr = getLoadStorePointerOperand(&Ingredient);
assert(!Reverse &&
"Inconsecutive memory access should not have the order.");
- return Ctx.TTI.getAddressComputationCost(Ty) +
- Ctx.TTI.getGatherScatterOpCost(Opcode, Ty, Ptr, IsMasked, Alignment,
- Ctx.CostKind, &Ingredient);
+ InstructionCost Cost = 0;
+
+ // If the address value is uniform across all lane, then the address can be
+ // calculated with scalar type and broacast.
----------------
topperc wrote:
```suggestion
// calculated with scalar type and broadcast.
```
https://github.com/llvm/llvm-project/pull/149955
More information about the llvm-commits
mailing list