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

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Wed May 1 05:18:35 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,
----------------
huntergr-arm wrote:

FWIW, my original patches did have a new type like that -- I originally called it AddressOffset, then TargetImmediate. I got some feedback that separating the terms out might be better, so we ended up with different int64_ts.

If we end up with an address formula with both fixed and scalable immediate terms, we'll have to prioritize one over the for a given target other due to the way LSR currently forms the Uses it will evaluate. AFAIK nobody implements instructions with mixed fixed and scalable immediates, so one or the other immediate would need to become part of the base for that formula.

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


More information about the llvm-commits mailing list