The BB vectorizer has an option 'bb-vectorizer-search-limit'. Is there a similar option for the SLP vectorizer? Maybe an analysis pass' scope that can be widen? I have large basic blocks with instructions that should be merged into packed versions. However, the blocks are optimized independently from each other. Now, if the instructions to be merged aren't too far apart the SLP vectorizer successfully packs the instructions within a block. However, from a certain distance between the instructions on the SLP vectorizer won't detect anymore the groups of instructions that can be packed. There's no interleaved data dependency that would prevent vectorizing. I am almost certain that's the vectorizer must have a maximum distance set somewhere or indirectly through dependent analysis passes. I tried the BB vectorizer, but for whatever reason it starts emitting extractvector/shufflevector instructions which I am sure aren't necessary. So, until further investigation I'd like to stick to SLP. Ideally, I'd like the maximum distance to be infinite, thus removing this restriction. I am aware of the consequent search time growth. Anyone any insights? Frank
> The BB vectorizer has an option 'bb-vectorizer-search-limit'. Is there a > similar option for the SLP vectorizer? Maybe an analysis pass' scope > that can be widen? > > I have large basic blocks with instructions that should be merged into > packed versions. However, the blocks are optimized independently from > each other. Now, if the instructions to be merged aren't too far apart > the SLP vectorizer successfully packs the instructions within a block. > However, from a certain distance between the instructions on the SLP > vectorizer won't detect anymore the groups of instructions that can be > packed. There's no interleaved data dependency that would prevent > vectorizing. I am almost certain that's the vectorizer must have a > maximum distance set somewhere or indirectly through dependent analysis > passes. > > I tried the BB vectorizer, but for whatever reason it starts emitting > extractvector/shufflevector instructions which I am sure aren't > necessary. So, until further investigation I'd like to stick to SLP. > > Ideally, I'd like the maximum distance to be infinite, thus removing > this restriction. I am aware of the consequent search time growth. > > Anyone any insights?Frank, The SLP vectorizer limits the amount of recursion then building the expression tree. Unfortunately, there's no command-line option to control this limit at this time. Line 73: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Vectorize/SLPVectorizer.cpp?view=markup You might consider filing a bug (llvm.org/bugs) requesting a flag, but I don't know if the code owners want to expose such a flag. Hope this helps. Regards, Chad
On 7 August 2014 17:33, Chad Rosier <mcrosier at codeaurora.org> wrote:> You might consider filing a bug (llvm.org/bugs) requesting a flag, but I > don't know if the code owners want to expose such a flag.I'm not sure that's a good idea as a raw access to that limit, as there are no guarantees that it'll stay the same. But maybe a flag turning some "aggressive" behaviour from SLP that would then change that threshold (and maybe some others) would be a good flag to have, I think. This could maybe be a way to deprecate the BB vectorizer faster than we would otherwise. But that would depend on all missing BB features to be implemented in SLP. An item in bugzilla seems appropriate. cheers, --renato
----- Original Message -----> From: "Frank Winter" <fwinter at jlab.org> > To: llvmdev at cs.uiuc.edu > Sent: Thursday, August 7, 2014 10:58:47 AM > Subject: [LLVMdev] How to broaden the SLP vectorizer's search > > The BB vectorizer has an option 'bb-vectorizer-search-limit'. Is > there a > similar option for the SLP vectorizer? Maybe an analysis pass' scope > that can be widen? > > I have large basic blocks with instructions that should be merged > into > packed versions. However, the blocks are optimized independently from > each other. Now, if the instructions to be merged aren't too far > apart > the SLP vectorizer successfully packs the instructions within a > block. > However, from a certain distance between the instructions on the SLP > vectorizer won't detect anymore the groups of instructions that can > be > packed. There's no interleaved data dependency that would prevent > vectorizing. I am almost certain that's the vectorizer must have a > maximum distance set somewhere or indirectly through dependent > analysis > passes. > > I tried the BB vectorizer, but for whatever reason it starts emitting > extractvector/shufflevector instructions which I am sure aren't > necessary. So, until further investigation I'd like to stick to SLP.A quick comment on this point: The BB vectorizer has always required a run of InstCombine and EarlyCSE (or GVN) afterward to produce reasonable code. That having been said, the development focus is now squarely on the SLP vectorizer is this space, and I suggest you focus there regardless. -Hal> > Ideally, I'd like the maximum distance to be infinite, thus removing > this restriction. I am aware of the consequent search time growth. > > Anyone any insights? > > Frank > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >-- Hal Finkel Assistant Computational Scientist Leadership Computing Facility Argonne National Laboratory