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

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 9 11:43:02 PST 2023


vdmitrie 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;
+
----------------
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.



================
Comment at: llvm/test/Transforms/SLPVectorizer/X86/reorder-phi-operand.ll:87
+; Here PHIs have mutual uses of each other. Reordering one requires reordering the other.
+define void @test2(ptr %p1, ptr %p2) {
+; CHECK-LABEL: @test2(
----------------
ABataev wrote:
> Precommit the test, please.
It fails with assertion without the fix. It represents a stability issue.


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