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

Karthik Bhat kv.bhat at samsung.com
Wed May 21 06:51:36 PDT 2014


Hi Nadav,
I went through your suggestion but unfortunetly modification in consecutive memory address tests is not resulting in vectorization of these load instruction the reason being when the build_tree sees the user of load it has not processed the larger subtree and hence doesn't know that this user is part of the larger subtree which will get vectorized and hence assume we need to extract and concludes that can't schedule extractelement.

Checking for a larger subtree and processing it first avoids the above mentioned problem as we are able to conclude that the user of load is part of  vectorizable subtree.
I added flag as suggested by Eric so that this vectorization runs only when slp-vectorize-load-aggressive is specified.

In order to avoid duplication we can roughly calculate the depth of the tree without being concerned if the tree gets vectorized or not. This is anyhow checked by buildTree_rec. The TreeDepth will now just traverse the tree till leaf node or till depth limit is reached and calculate the max depth of the tree. Please if you could let me know your inputs on this.

Thanks
Karthik Bhat

http://reviews.llvm.org/D3800

Files:
  lib/Transforms/Vectorize/SLPVectorizer.cpp
  test/Transforms/SLPVectorizer/X86/pr19657.ll
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D3800.9659.patch
Type: text/x-patch
Size: 5984 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20140521/296739da/attachment.bin>


More information about the llvm-commits mailing list