Akira Hatanaka
2013-Jan-03 21:48 UTC
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
Nadav (or anyone who is familiar with the loop vectorizer), Does the current loop vectorizer inquire about the SIMD capabilities of the target architecture when it decides whether it is profitable to vectorize a loop? I am asking this because I would like to have loop vectorization disabled for targets that don't support SIMD instructions (for example, standard mips32). Loop vectorization bloats the code size and prolongs compilation time without any improvement to performance for such targets. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130103/ab782fa5/attachment.html>
Nadav Rotem
2013-Jan-03 21:53 UTC
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
Hi Akira!> > Does the current loop vectorizer inquire about the SIMD capabilities of the target architecture when it decides whether it is profitable to vectorize a loop?Yes, it uses a cost model to determine the profitability of vectorization. At the moment only x86 provides the necessary hooks that are needed for calculating the costs. We may need to change the cost defaults to prevent vectorization on targets that don't implement the cost interface. If this is a problem for you then I can do it soon.> I am asking this because I would like to have loop vectorization disabled for targets that don't support SIMD instructions (for example, standard mips32). > Loop vectorization bloats the code size and prolongs compilation time without any improvement to performance for such targets. >Yes. Also, notice that the loop vectorizer tries to be more conservative when the 'optforsize' attribute is used. Thanks, Nadav
Renato Golin
2013-Jan-03 22:05 UTC
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
On 3 January 2013 21:53, Nadav Rotem <nrotem at apple.com> wrote:> > I am asking this because I would like to have loop vectorization > disabled for targets that don't support SIMD instructions (for example, > standard mips32). > > Loop vectorization bloats the code size and prolongs compilation time > without any improvement to performance for such targets. > > > > Yes. Also, notice that the loop vectorizer tries to be more conservative > when the 'optforsize' attribute is used. >Isn't the vectorizer disabled by default? Or are you requesting that if the user chooses -vectorize the compiler prints a warning (unused param since no SIMD)? cheers, --renato -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130103/d2254921/attachment.html>
Akira Hatanaka
2013-Jan-03 22:21 UTC
[LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
Hi Nadav, On Thu, Jan 3, 2013 at 1:53 PM, Nadav Rotem <nrotem at apple.com> wrote:> Hi Akira! > > > > > Does the current loop vectorizer inquire about the SIMD capabilities of > the target architecture when it decides whether it is profitable to > vectorize a loop? > > Yes, it uses a cost model to determine the profitability of vectorization. > At the moment only x86 provides the necessary hooks that are needed for > calculating the costs. We may need to change the cost defaults to prevent > vectorization on targets that don't implement the cost interface. If this > is a problem for you then I can do it soon. > >I guess I can just implement all the vectorTargetTransformInfo::get*OpCost functions since I will later need a cost model for mips-dsp anyway. Would the code in LoopVectorizationCostModel::expectedCost work correctly if those functions returned a large integer (max unsigned int)? I am concerned about overflow.> I am asking this because I would like to have loop vectorization disabled > for targets that don't support SIMD instructions (for example, standard > mips32). > > Loop vectorization bloats the code size and prolongs compilation time > without any improvement to performance for such targets. > > > > Yes. Also, notice that the loop vectorizer tries to be more conservative > when the 'optforsize' attribute is used. > > > Thanks, > Nadav > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130103/94206511/attachment.html>
Maybe Matching Threads
- [LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
- [LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
- [LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
- [LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?
- [LLVMdev] Does loop vectorizer inquire about target's SIMD capabilities?