[llvm-dev] Running opt O1 outside of llvm
Akash Banerjee via llvm-dev
llvm-dev at lists.llvm.org
Mon Apr 6 02:09:45 PDT 2020
Hi,
I have since fixed it. I was missing setting the following two flags to
false.
* PM.LoopVectorize = false; PM.SLPVectorize = false;*
Thanks,
Akash.
On Mon, Apr 6, 2020 at 1:24 AM Michael Kruse <llvmdev at meinersbur.de> wrote:
> It would be helpful to know in which cases your custom pipeline
> vectorizes when it should not.
> Note this might be dependent on target-specifics, such as
> PMB.LibraryInfo tjat your code below is not using.
>
> Michael
>
>
> Am Sa., 4. Apr. 2020 um 12:36 Uhr schrieb Akash Banerjee via llvm-dev
> <llvm-dev at lists.llvm.org>:
> >
> > Hi,
> > I would like to run the -O1 pass sequence followed by -reg2mem from an
> out of tree project which uses llvm.
> > I am using the following code snippet to do so but in some cases, my
> method is also vectorising the code, which doesn't happen when running the
> same sequence(-S -O1 -reg2mem) through opt. Can someone please help me find
> what I am missing?
> >
> > Thanks,
> > Akash.
> >
> > PassManagerBuilder PM;
> > PM.OptLevel = 1;
> > PM.SizeLevel = 0;
> > legacy::FunctionPassManager FPM(&llvm_module);
> > legacy::PassManager MPM;
> > PM.Inliner = createAlwaysInlinerLegacyPass();
> > PM.DisableUnrollLoops = true;
> > PM.populateFunctionPassManager(FPM);
> > PM.populateModulePassManager(MPM);
> > FPM.doInitialization();
> > for (auto &F : llvm_module)
> > FPM.run(F);
> > FPM.doFinalization();
> > MPM.run(llvm_module);
> > legacy::FunctionPassManager FPM(&llvm_module);
> > FPM.add(createDemoteRegisterToMemoryPass());
> > FPM.doInitialization();
> > for (auto &F : llvm_module)
> > FPM.run(F);
> > FPM.doFinalization();
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org
> > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200406/d15958be/attachment.html>
More information about the llvm-dev
mailing list