[PATCH] D90445: [SLP] Make SLPVectorizer to use `llvm.masked.gather` intrinsic

Simon Pilgrim via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Oct 30 02:53:10 PDT 2020


RKSimon added a comment.

Ideally we'd see some test cases where we don't vectorize (older SSE?) as well indicating that the gather cost is having an effect



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:1580
 
+    /// Boolean value indicating that pointer operands are scattered
+    bool IsScatteredOps = false;
----------------
scattered.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2848
+        // Vectorizing non-consecutive loads with `llvm.masked.gather`
+        TreeEntry *TE = newTreeEntry(VL, Bundle /*vectorized*/, S, UserTreeIdx,
+                                     ReuseShuffleIndicies);
----------------
'llvm.masked.gather'.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:3670
+      }
       if (!E->ReorderIndices.empty()) {
         // TODO: Merge this shuffle with the ReuseShuffleCost.
----------------
Do we have cases where we end up shuffling scattered ops?


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4517
+          if (getTreeEntry(PO))
+            ExternalUses.push_back(ExternalUser(PO, cast<User>(VecPtr), 0));
+        }
----------------
Should this be 0? Isn't it supposed to be the LaneIndex?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D90445/new/

https://reviews.llvm.org/D90445



More information about the llvm-commits mailing list