<div dir="ltr"><div dir="ltr"><div dir="ltr">Okay, I tried something like this:<br><div><br></div><div>Given opt -passes='...', my bash script strips the quotes, puts module(mypass) at the begin/end, put quotes again, and runs it. mypass is a module-level pass.</div><div><br></div><div>ex) Given <font face="monospace">opt -passes='sroa' </font>, it emits <font face="monospace">opt -passes='module(mypass),sroa,module(mypass)'</font></div><div><br></div><div>The emitted command seems working in this case, but I found that it breaks when loop-level passes are there:</div><div><br></div><div>ex) Running <font face="monospace">opt -passes='module(mypass),loop(unswitch<nontrivial>),module(mypass)'</font> shows:</div><div>build/bin/opt: invalid use of 'loop' pass as module pipeline<br></div><div><br></div><div><br></div><div>Is there a way to correctly add 'mypass' to the begin/end of the passes regardless of the level of the pipeline?</div><div><br></div><div>Thanks,</div><div>Juneyoung</div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Dec 4, 2020 at 1:28 PM Juneyoung Lee <<a href="mailto:juneyoung.lee@sf.snu.ac.kr">juneyoung.lee@sf.snu.ac.kr</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Hello all,<div><br></div><div>Can I register passes at the beginning/end of opt passes (new pass manager)?<br></div><div><br></div><div>I found that registerPipelineStartEPCallback/registerOptimizerLastEPCallback work successfully for clang, but they don't fire when opt -passes="" is used.</div><div><br></div><div>Thanks,</div><div>Juneyoung</div><div><br></div></div></div></div></div>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><br></div><font size="1">Juneyoung Lee</font><div><font size="1">Software Foundation Lab, Seoul National University</font></div></div></div>