[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
================
@@ -40,6 +43,34 @@ enum class RecurKind;
namespace llvm::slpvectorizer {
+/// Returns \p Stride scaled by the allocation size of \p ScalarTy, negated if
+/// \p IsReverse is set, or nullptr if \p Stride is not a constant.
+ConstantInt *getStrideBytesIfConstant(Value *Stride, Type *ScalarTy,
+ const DataLayout &DL,
+ bool IsReverse = false);
+
+/// Return the cost of a strided load and accompanying bitcast.
+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 = false);
+
+struct CompressedLoadInfo {
----------------
alexey-bataev wrote:
Add a description to this new structure
https://github.com/llvm/llvm-project/pull/226540
More information about the llvm-commits
mailing list