<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">I’m not sure what’s your context. I think  `-passes` is only used for specify the entire pipeline instead of inserting callbacks into an existing pipeline.<div class=""><br class=""><div class="">You can either directly modify PassBuilder’s code to run Passes before/after a Pass.</div><div class=""><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Or writing a new PassManager PassPlugin and use the PassBuilder instance in there (see the comments in include/llvm/Passes/PassPlugin.h [1]) to call </span></font><span style="caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0);" class="">registerPipelineStartEPCallback. Then load that plugin using opt.</span></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">[1] <a href="https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Passes/PassPlugin.h#L96" class="">https://github.com/llvm/llvm-project/blob/master/llvm/include/llvm/Passes/PassPlugin.h#L96</a> </span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class=""><br class=""></span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">Best</span></font></div><div class=""><font color="#000000" class=""><span style="caret-color: rgb(0, 0, 0);" class="">-Min<br class=""></span></font><div><br class=""><blockquote type="cite" class=""><div class="">On Dec 3, 2020, at 8:28 PM, Juneyoung Lee via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class=""><div dir="ltr" class="">Hello all,<div class=""><br class=""></div><div class="">Can I register passes at the beginning/end of opt passes (new pass manager)?<br class=""></div><div class=""><br class=""></div><div class="">I found that registerPipelineStartEPCallback/registerOptimizerLastEPCallback work successfully for clang, but they don't fire when opt -passes="" is used.</div><div class=""><br class=""></div><div class="">Thanks,</div><div class="">Juneyoung</div><div class=""><br class=""></div></div></div></div></div>
_______________________________________________<br class="">LLVM Developers mailing list<br class=""><a href="mailto:llvm-dev@lists.llvm.org" class="">llvm-dev@lists.llvm.org</a><br class="">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev<br class=""></div></blockquote></div><br class=""></div></div></div></body></html>