[llvm] [TTI] Support scalable offsets in getScalingFactorCost (PR #88113)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 03:55:06 PDT 2024


================
@@ -834,7 +834,7 @@ class TargetTransformInfo {
   /// If the AM is not supported, it returns a negative value.
   /// TODO: Handle pre/postinc as well.
   InstructionCost getScalingFactorCost(Type *Ty, GlobalValue *BaseGV,
-                                       int64_t BaseOffset, bool HasBaseReg,
+                                       StackOffset BaseOffset, bool HasBaseReg,
----------------
paulwalker-arm wrote:

I made my request because the function was changed to take both a fixed-length and a scalar offset, which is exactly why `StackOffset` exists (albeit, as you say, with a name that's now out of date).  I think all offset related common code interfaces should be unified to accept the fact they can be fixed or scaled and thus use whichever of the TypeSize.h family of types that best fits the specific need.  I'll note we are missing a generic type like `TypeSize` but signed, to make this truly possible.

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


More information about the llvm-commits mailing list