[PATCH] Fix PR19657 : SLP vectorization doesn't combine scalar load to vector loads

Nadav Rotem nrotem at apple.com
Fri May 16 08:01:18 PDT 2014

I am sorry but this is the wrong approach. You copy a ton of code that we will need to maintain if we want to add support to new instructions.

You also increase the compile time by scanning the tree twice. In the SLP vectorizer there are a bunch of features we did not implement because we did not want to increase  compile time. Remember that we run this pass on all optimization levels. 

Sent from my iPhone

> On May 16, 2014, at 7:40, Karthik Bhat <kv.bhat at samsung.com> wrote:
> Hi nadav, hfinkel, aschwaighofer,
> Hi Nadav,Hal,Arnold,
> This patch fixes PR19657. As Arnold pointed out the reason we miss to vectorize these loads is we are processing the smaller subtree before the larger subtree. This patch calculates the depth of the subtress before calling buildTree_rec and calls the buildTree_rec for the larger subtree before calling it for smaller subtree.
> This seems to fix the problem and there are no regressions.
> But I'm not sure if there is any easier and more efficient way to check this than actually traversing the subtrees and calculating their depth before we call buildTree_rec. It would be great if you could suggest improvements to this patch.
> Thanks
> Karthik Bhat
> http://reviews.llvm.org/D3800
> Files:
>  lib/Transforms/Vectorize/SLPVectorizer.cpp
>  test/Transforms/SLPVectorizer/X86/pr19657.ll
> <D3800.9479.patch>

More information about the llvm-commits mailing list