[llvm] [SLP] Use costing to decide between Strided Loads and Compressed Loads (PR #226540)

Ryan Buchner via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 29 12:54:57 PDT 2026


================
@@ -14519,6 +14565,58 @@ void BoUpSLP::transformNodes() {
       continue;
     switch (E.getOpcode()) {
     case Instruction::Load: {
+      if (E.State == TreeEntry::CompressVectorize) {
+        StridedPtrInfo SPtrInfo;
+        auto PreferStridedOverCompressed = [&]() -> bool {
+          // In cases where a shuffle is mandatory regarless of load type,
+          // prefer Compressed since the reorder/reuse shuffle can be merged
+          // with the compress shuffle.
+          if (!E.ReorderIndices.empty() || !E.ReuseShuffleIndices.empty())
+            return false;
----------------
bababuck wrote:

Will do follow up MR to avoid making this one too large.

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


More information about the llvm-commits mailing list