[PATCH] D28961: [SLP] Fix for PR31690: Allow using of extra values in horizontal instructions.

Michael Kuperstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 24 10:54:53 PST 2017


mkuper added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4249
+            // TreeN is a candidate for extra args itself, mark it.
+            ExtraArgs.erase(TreeN);
+            auto &P = Stack.back();
----------------
Let me make sure I understand what's going on here.
What happens is that we've added an operand to the tree, but it turns out that we shouldn't have, and we should actually be using it as an "extra value". So we're undoing it. Right?
Why don't we catch it before we add it to the tree? Is it because it happens to have the same opcode as the reduction, and we only realize we're "stuck" once we looks at its operands?

In any case, regardless of whether that's entirely correct, this needs to be documented more clearly.
Also, is this checked by any of the tests you added?



https://reviews.llvm.org/D28961





More information about the llvm-commits mailing list