[llvm] [LSR] Recognize vscale-relative immediates (PR #88124)

Graham Hunter via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 14 09:24:43 PDT 2024


================
@@ -1308,9 +1390,9 @@ void Cost::RateRegister(const Formula &F, const SCEV *Reg,
 
       // If the step size matches the base offset, we could use pre-indexed
       // addressing.
-      if (AMK == TTI::AMK_PreIndexed) {
+      if (AMK == TTI::AMK_PreIndexed && !F.BaseOffset.isScalable()) {
----------------
huntergr-arm wrote:

Immediate::isZero() is the same function you've referenced -- it ignores the Scalable flag and just returns Quantity. isScalable() returns Scalable, and a new isFixed() would return '!Scalable'.

Do we want isScalable() to mean 'Scalable || Quantity == isZero()' and change the other FixedOrScalableQuantity types too?

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


More information about the llvm-commits mailing list