[llvm] [SLPVectorizer][NFC] Save stride in a map. (PR #157706)
Alexey Bataev via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 11 09:31:17 PDT 2025
================
@@ -13030,10 +13063,18 @@ void BoUpSLP::transformNodes() {
InstructionCost StridedCost = TTI->getStridedMemoryOpCost(
Instruction::Load, VecTy, BaseLI->getPointerOperand(),
/*VariableMask=*/false, CommonAlignment, CostKind, BaseLI);
- if (StridedCost < OriginalVecCost)
+ if (StridedCost < OriginalVecCost) {
// Strided load is more profitable than consecutive load + reverse -
// transform the node to strided load.
+ Type *StrideTy = DL->getIndexType(cast<LoadInst>(E.Scalars.front())
+ ->getPointerOperand()
+ ->getType());
+ StridedPtrInfo SPtrInfo;
+ SPtrInfo.StrideVal = ConstantInt::get(StrideTy, 1);
----------------
alexey-bataev wrote:
Try manually adjust costs in RISCVTargetTransformInfo
https://github.com/llvm/llvm-project/pull/157706
More information about the llvm-commits
mailing list