[PATCH] D34881: [SLP] Allow vectorization of the instruction from the same basic blocks only, NFC.

Alexey Bataev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 28 11:57:15 PDT 2017


ABataev marked an inline comment as done.
ABataev added inline comments.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4771
 
-  if (Root->getParent() != BB)
+  if (Root->getParent() != BB || isa<PHINode>(Root))
     return false;
----------------
anna wrote:
> Could you please explain why you  bail out here? If it's for clamping the number of operands, that'll get operated on the loop below, why not just limit the recursion depth to 6 instead of 12?
I tried to reduce the number of checks for PHINode inside the loop and reduce number of ush_backs/pop_backs to Stack. In the existing code if the next instruction is PHINode, we push_back it to Stack, then pop it up from Stack and drop it. New code tries to avoid such extra dummy operations.


================
Comment at: lib/Transforms/Vectorize/SLPVectorizer.cpp:4825
 
     // Try to vectorize operands.
     if (++Level < RecursionMaxDepth)
----------------
anna wrote:
> Please add a comment here explicitly stating that you're limiting this to the same basic block to save compile time.
Will do


https://reviews.llvm.org/D34881





More information about the llvm-commits mailing list