ScatterVectorize nodes should be handled same way as gathers in
reorderBottomToTop function, since we can simple reorder the loads in
this node. Because of that need to include such nodes to the list of
gathered nodes to fix compiler crash.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
LG
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
3813 | Please add a comment about when this is expected to happen. If I understand correctly that this is happening for State == TreeEntry::ScatterVectorize. It is a bit confusing that this code is guarded by if (getVectorizedOperand()), so one would expect that TE's state would be Vectorize. |
I guess the "crash" the patch suggested to fix looked like this:
llvm-project/llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp:8214: llvm::Value* llvm::slpvectorizer::BoUpSLP::vectorizeTree(llvm::slpvectorizer::BoUpSLP::ExtraValueToDebugLocsMap&): Assertion `Vec && "Can't find vectorizable value"' failed.
Please find a test case attached. It started to crash after this patch.
llvm/test/Transforms/SLPVectorizer/X86/scatter-vectorize-reorder.ll | ||
---|---|---|
2 | It seems the test does not actually execute the change. At this state it did not crash before the patch. |
llvm/test/Transforms/SLPVectorizer/X86/scatter-vectorize-reorder.ll | ||
---|---|---|
2 | Just probably it was committed before the patch that added forceScalarizeMaskedGather check. |
Please add a comment about when this is expected to happen. If I understand correctly that this is happening for State == TreeEntry::ScatterVectorize. It is a bit confusing that this code is guarded by if (getVectorizedOperand()), so one would expect that TE's state would be Vectorize.