If some leaves have the same instructions to be vectorized, we may
incorrectly evaluate the best order for the root node (it is built for the
vector of instructions without repeated instructions and, thus, has less
elements than the root node). In this case we just can not try to reorder
the tree + we may calculate the wrong number of nodes that requre the
same reordering.
For example, if the root node is \<a+b, a+c, a+d, f+e\>, then the leaves
are \<a, a, a, f\> and \<b, c, d, e\>. When we try to vectorize the first
leaf, it will be shrink to \<a, b\>. If instructions in this leaf should
be reordered, the best order will be \<1, 0\>. We need to extend this
order for the root node. For the root node this order should look like
\<3, 0, 1, 2\>. This patch allows extension of the orders of the nodes
with the reused instructions.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Comment Actions
Would it be possible to increase test coverage?
lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
5785 ↗ | (On Diff #140974) | This assert doesn't seem to tally with the TODO just above? |
Comment Actions
Yes, I will try to add some more tests.
lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
5785 ↗ | (On Diff #140974) | Actually, it does, I just need to remove this TODO. This patch fixes this TODO. |
lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
525 ↗ | (On Diff #141713) | Set default value in the resize? |
Comment Actions
LGTM again (thanks for rebasing - I didn't notice how old the last patch was!). One minor.
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
530 | 2 x Mask.clear() - merge issue? |
llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp | ||
---|---|---|
530 | Yes, missed it, thanks! |
2 x Mask.clear() - merge issue?