[PATCH] D98714: [SLP] Add insertelement instructions to vectorizable tree

Anton Afanasyev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 7 03:47:36 PDT 2021


anton-afanasyev marked 13 inline comments as done.
anton-afanasyev added a comment.

Refactored code, removed new `TreeEntry::State`. Make `InsertElementInst` passing through ordinary scheduling, allowing inner deps for bundle of insertelements.



================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2627
   if (S.OpValue->getType()->isVectorTy()) {
-    LLVM_DEBUG(dbgs() << "SLP: Gathering due to vector type.\n");
-    newTreeEntry(VL, None /*not vectorized*/, S, UserTreeIdx);
-    return;
+    if (isa<InsertElementInst>(VL[0])) {
+      ValueList Operands;
----------------
ABataev wrote:
> What if some of the instructions are not insertelements?
For now, the only way insertelements can appear here is through `vectorizeInsertElements()` function, which gathers inserts by `findBuildAggregate()`, so checking the first element is enough here.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:2654
+      }
+      buildTree_rec(Operands, Depth, UserTreeIdx);
+      return;
----------------
ABataev wrote:
> Why do we ignore user vector instructions here? Also, is this supposed only for extractelements operands?
I have reworked this code.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D98714



More information about the llvm-commits mailing list