[llvm] [RISCV] Don't overcost wide load in optimized segment load/store (PR #207146)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 13 03:08:49 PDT 2026


================
@@ -1124,14 +1124,16 @@ InstructionCost RISCVTTIImpl::getInterleavedMemoryOpCost(
           TLI->isLegalInterleavedAccessType(SubVecTy, Factor, Alignment,
                                             AddressSpace, DL)) {
 
-        // Some processors optimize segment loads/stores as one wide memory op +
-        // Factor * LMUL shuffle ops.
+        // Some processors optimize segment loads/stores as N * DLEN sized
+        // load ops + Factor * LMUL shuffle ops.
         if (ST->hasOptimizedSegmentLoadStore(Factor)) {
-          InstructionCost Cost =
----------------
lukel97 wrote:

Turns out vscale-for-tuning is always just `minimum vlen / 64`, so vscale-for-tuning + minimum-vscale are the same. Rewritten it in terms of `getVScaleForTuning` anyway to be more obvious in 7f422e1a65025413b84d6d328c01826bcc816a58

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


More information about the llvm-commits mailing list