[PATCH] D41948: [SLP] Fix vectorization for tree with trunc to minimum required bit width.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 15 06:38:42 PST 2018


ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4023-4025
+    // Do not include top zext/sext/trunc operations to those to be demoted, it
+    // produces noise cast<vect>, trunc <vect>, exctract <vect>, cast <extract>
+    // sequence.
----------------
mssimpso wrote:
> What do you mean by "top" here?  Do you just mean that the initial Root should not be a cast? If so, would it be easier to check that here, rather than passing the flag in collectValuesToDemote?
Yes, it is about initial roots. The main problem here is that these roots still must be analyzeŠ² though not considered as candidates to demote.
Meanwhile, I have a question for you. Why you try to generate sequence `cast ( extractelement(<resulting_vector>))` instead of `extractelement(cast(<resulting_vector>))`? It produces `2 * n` instructions, while the second approach will produce `n + 1` instructions.


https://reviews.llvm.org/D41948





More information about the llvm-commits mailing list