<div dir="ltr">Hi,<div>I have since fixed it. I was missing setting the following two flags to false.</div><div><br><b><font face="monospace"> PM.LoopVectorize = false;<br> PM.SLPVectorize = false;</font></b><br></div><div><b><font face="monospace"><br></font></b></div><div>Thanks,</div><div>Akash.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Apr 6, 2020 at 1:24 AM Michael Kruse <<a href="mailto:llvmdev@meinersbur.de">llvmdev@meinersbur.de</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">It would be helpful to know in which cases your custom pipeline<br>
vectorizes when it should not.<br>
Note this might be dependent on target-specifics, such as<br>
PMB.LibraryInfo tjat your code below is not using.<br>
<br>
Michael<br>
<br>
<br>
Am Sa., 4. Apr. 2020 um 12:36 Uhr schrieb Akash Banerjee via llvm-dev<br>
<<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>>:<br>
><br>
> Hi,<br>
> I would like to run the -O1 pass sequence followed by -reg2mem from an out of tree project which uses llvm.<br>
> 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?<br>
><br>
> Thanks,<br>
> Akash.<br>
><br>
> PassManagerBuilder PM;<br>
> PM.OptLevel = 1;<br>
> PM.SizeLevel = 0;<br>
> legacy::FunctionPassManager FPM(&llvm_module);<br>
> legacy::PassManager MPM;<br>
> PM.Inliner = createAlwaysInlinerLegacyPass();<br>
> PM.DisableUnrollLoops = true;<br>
> PM.populateFunctionPassManager(FPM);<br>
> PM.populateModulePassManager(MPM);<br>
> FPM.doInitialization();<br>
> for (auto &F : llvm_module)<br>
> FPM.run(F);<br>
> FPM.doFinalization();<br>
> MPM.run(llvm_module);<br>
> legacy::FunctionPassManager FPM(&llvm_module);<br>
> FPM.add(createDemoteRegisterToMemoryPass());<br>
> FPM.doInitialization();<br>
> for (auto &F : llvm_module)<br>
> FPM.run(F);<br>
> FPM.doFinalization();<br>
> _______________________________________________<br>
> LLVM Developers mailing list<br>
> <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
> <a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>