[PATCH] D132949: [SLP]Fix PR57447: Assertion `!getTreeEntry(V) && "Scalar already in tree!"' failed.

Valeriy Dmitriev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 30 11:04:50 PDT 2022


vdmitrie added inline comments.


================
Comment at: llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:4769
     auto *I = dyn_cast<Instruction>(V);
-    if (!I)
+    if (!I && (!UserTreeIdx.UserTE ||
+               UserTreeIdx.UserTE->State != TreeEntry::ScatterVectorize))
----------------
 "!I" can be replaced with "!isa<Instruction>(V)"
We already have few places of the same pattern addressing specifically the operand of a ScatterVectorize node: " UserTreeIdx.UserTE &&  UserTreeIdx.UserTE->State == TreeEntry::ScatterVectorize".
We also define isScatterUser variable at line 5221 with the same value.
I'd suggest to pull the variable definition up and use it instead of the repeating pattern.
The comment before the loop is probably worth updating too.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132949



More information about the llvm-commits mailing list