[llvm] [SLP] Use costing to decide between Strided Loads and Compressed Loads (PR #226540)

Alexey Bataev via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 11 10:40:13 PDT 2026


================
@@ -61,6 +73,55 @@ InstructionCost getShuffleCost(const TargetTransformInfo &TTI,
                             /*CtxI=*/nullptr, VIC);
 }
 
+InstructionCost getStridedLoadCost(const TargetTransformInfo &TTI,
+                                   const DataLayout &DL, Value *StrideVal,
+                                   Type *StridedLoadTy, Type *VecTy, Value *Ptr,
+                                   Align CommonAlignment,
+                                   TargetTransformInfo::CastContextHint Ctx,
+                                   TargetTransformInfo::TargetCostKind CostKind,
+                                   bool IsReverse) {
+  Value *Stride = getStrideBytesIfConstant(StrideVal, VecTy->getScalarType(),
----------------
alexey-bataev wrote:

```suggestion
  Value *Stride = getStrideBytesIfConstant(StrideVal, ScalarTy,
```
To handle revec

https://github.com/llvm/llvm-project/pull/226540


More information about the llvm-commits mailing list