Matthieu Dubet
2013-Nov-05 17:39 UTC
[LLVMdev] LLVM IR vectorized with opt but not through the API
Hi, I have a simple LLVM code which loop over an array and do a simple calculation, the bytecode is here : https://gist.github.com/maattd/7322927 This code is correctly vectorized with LLVM opt 3.3, however I can't get it to vectorize with call through the API. Is there a way to debug the LLVM vectorizer pass with the API ? Is there a way to just apply the exact same optimization passes as the opt tool ? I've tried llvm::CodeGenOpt::Aggressive but it doesn't vectorize it neither. Thanks, Matthieu -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131105/6954e1d4/attachment.html>
Nadav Rotem
2013-Nov-05 17:47 UTC
[LLVMdev] LLVM IR vectorized with opt but not through the API
Hi Matthieu, Are you sure that it is the loop vectorizer and not the slp-vectorizer ? Also, you probably want to run mem2reg at some point, unless you generate alloca-free IR. Thanks, Nadav On Nov 5, 2013, at 9:39 AM, Matthieu Dubet <maattdd at gmail.com> wrote:> Hi, > > I have a simple LLVM code which loop over an array and do a simple calculation, the bytecode is here : https://gist.github.com/maattd/7322927 > > This code is correctly vectorized with LLVM opt 3.3, however I can't get it to vectorize with call through the API. > > Is there a way to debug the LLVM vectorizer pass with the API ? > > Is there a way to just apply the exact same optimization passes as the opt tool ? I've tried llvm::CodeGenOpt::Aggressive but it doesn't vectorize it neither. > > Thanks, > Matthieu > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20131105/d17e902d/attachment.html>
Arnold Schwaighofer
2013-Nov-05 18:03 UTC
[LLVMdev] LLVM IR vectorized with opt but not through the API
Did you add your target’s target transform info to the pass manager? See "http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066841.html” and following for more information, "http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-October/066882.html” might contain a link to an example that might be help full. Best, Arnold On Nov 5, 2013, at 9:39 AM, Matthieu Dubet <maattdd at gmail.com> wrote:> Hi, > > I have a simple LLVM code which loop over an array and do a simple calculation, the bytecode is here : https://gist.github.com/maattd/7322927 > > This code is correctly vectorized with LLVM opt 3.3, however I can't get it to vectorize with call through the API. > > Is there a way to debug the LLVM vectorizer pass with the API ? > > Is there a way to just apply the exact same optimization passes as the opt tool ? I've tried llvm::CodeGenOpt::Aggressive but it doesn't vectorize it neither. > > Thanks, > Matthieu > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Arnold Schwaighofer
2013-Nov-05 18:05 UTC
[LLVMdev] LLVM IR vectorized with opt but not through the API
On Nov 5, 2013, at 9:39 AM, Matthieu Dubet <maattdd at gmail.com> wrote:> Hi, > > I have a simple LLVM code which loop over an array and do a simple calculation, the bytecode is here : https://gist.github.com/maattd/7322927 > > This code is correctly vectorized with LLVM opt 3.3, however I can't get it to vectorize with call through the API. > > Is there a way to debug the LLVM vectorizer pass with the API ? > > Is there a way to just apply the exact same optimization passes as the opt tool ? I've tried llvm::CodeGenOpt::Aggressive but it doesn't vectorize it neither.Have a look at lib/Transforms/IPO/PassManagerBuilder.cpp and tools/opt/opt.cpp to see how opt sets up the compilation pipeline. Best, Arnold> > Thanks, > Matthieu > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Apparently Analagous Threads
- [LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)
- [LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)
- [LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)
- [LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)
- [LLVMdev] Converting a i32 pointer to a vector of i32 ( C array to LLVM vector)