[PATCH] D141309: [SLP] Do not ignore ordering for root node when it has in-tree uses.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 12:02:26 PST 2023


ABataev added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4389-4392
+  // We cannot ignore reordering of root node if it has an in-tree user.
+  if (IgnoreReorder && !VectorizableTree.front()->UserTreeIndices.empty())
+    IgnoreReorder = false;
+
----------------
vdmitrie wrote:
> vdmitrie wrote:
> > ABataev wrote:
> > > ```
> > > IgnoreReorder &= VectorizableTree.front()->UserTreeIndices.empty();
> > > ```
> > > Can we do it before calling reorderBottomToTop?
> > This was the very first thing I was considering. But call to the method is from outside of BoUpSLP. It means we either need to allow access to VectorizaableTree data or add a public method that checks just that.
> > 
> I can add this method and use it instead:
> 
> bool isRootHasInTreeUses() const {
>    return !VectorizableTree.empty() &&
>           !VectorizableTree.front()->UserTreeIndices.empty();
> }
> 
> Thoughts?
Go ahead with it.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D141309



More information about the llvm-commits mailing list