[llvm] [SLP] De-duplicate costing of perfect-diamond gather spills (PR #220569)

Hari Limaye via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 7 01:58:58 PDT 2026


================
@@ -19079,7 +19154,8 @@ InstructionCost BoUpSLP::getSpillCost() {
             all_of(Op->Scalars, [&](Value *V) {
               return !isa<Instruction>(V) || L->isLoopInvariant(V);
             }))
-          AddCosts(Op, GetSpillScale(Parent));
+          if (!IsCoveredByMatchingVectorEntry(Op, L))
+            AddCosts(Op, GetSpillScale(Parent));
         continue;
       }
       Budget = 0;
----------------
hazzlim wrote:

Ah I think I see what you meant - I've moved the Budget reset to before the new gather logic, so that we use the "new" budget for this edge rather than the old 

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


More information about the llvm-commits mailing list