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.
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.
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.