<div dir="ltr"><div>Thanks for bringing this RFC up.</div><div><br></div><div>It seems that it will be exactly what we want for opt-bisect in new PM.</div><div><br></div><div>I will comment there.</div></div><br><div class="gmail_quote"><div dir="ltr">On Wed, Jun 6, 2018 at 5:36 PM Fedor Sergeev via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
<br>
On 06/07/2018 12:26 AM, Zhizhou Yang via llvm-dev wrote:<br>
> Hi Chandler,<br>
><br>
> I am now working on a bisecting tool to find mis-optimization on LLVM. <br>
> I found OptBisect a very useful option and hope to make it work on the <br>
> new pass manager. I have several questions about it.<br>
><br>
> 1. Any plans to apply codegen stage with new pass manager?<br>
>     IIUC, new pass manager only works for opt stage. However the <br>
> OptBisect option tries to accumulate pass counts through opt stage and <br>
> codegen stage.<br>
>   Porting it to new pass manager means that, for now opt stage <br>
> accumulation will use new pass manager and llc stage will still use <br>
> legacy pass mechanism.<br>
>   May I ask if there is any plan to apply new pass manager for llc <br>
> stage? If so, the OptBisect porting will also need to expend to <br>
> codegen stage in the future.<br>
><br>
> 2.  Do we want optnone support for new pass manager?<br>
>     I see OptBisect for each pass was first introduced by modifying <br>
> optnone check. However new pass manager does not support it IIUC.<br>
>     We can either follow the legacy structure of <br>
> skipFunction()/Module(), put skippability check in each single pass <br>
> for new pass manager.<br>
>     Or since there is no optnone support, we now may also create label <br>
> on each pass to determine it is skippable or not, and then do the <br>
> check at pass manager level.<br>
><br>
> 3. No region/basicblock/callgraphscc pass support for new pass manager?<br>
There is CallGraphSCC pass support in new pass manager.<br>
See include/llvm/Analysis/CGSCCPassManager.h<br>
<br>
There are no plans to implement region/BB passes afaik.<br>
<br>
>     In legacy pass manager, OptBisect will be checked by skip() <br>
> function on certain types of passes. like skipRegion(), skipBasicBlocks().<br>
>     But I did not see implementations of the passes I mentioned above <br>
> in new passes. So any plan to have them any more?<br>
><br>
> 4. Is PassInfoMixin the right place to put skipPass() function?<br>
> The OptBisect works like this: At the beginning of each pass runs, it <br>
> will call a skipFunction()/Module()/... function under pass.h to check <br>
> if -opt-bisect is set and how much is counter accumulating.<br>
> Seems all passes come from the structure PassInfoMixin API, and I see <br>
> name() function in it which is useful of OptBisect.<br>
> Do you think it is the right place to put the skipPass() function, <br>
> similar to where skipFunction()/Module() located in legacy pass manager?<br>
PassInfoMixin was not intended to be a base for hierarchy of Passes, it <br>
is merely a boilerplate helper.<br>
<br>
> I currently have a draft on OptBisect porting implementation, and I am <br>
> willing to have people review it if you like.<br>
><br>
> Thanks for taking your time on those questions.<br>
><br>
> If anyone is also make similar effort on it, or have any suggestions <br>
> of implementation, please let me know and I really appreciate :)<br>
Just (finally! :-/ ) have sent out an RFC exactly on this topic:<br>
   "RFC: Pass Execution Instrumentation interface"<br>
It is currently work in progress and rather generic, so feel free to <br>
comment/put more detail there.<br>
<br>
regards,<br>
   Fedor.<br>
<br>
> Best,<br>
> Zhizhou<br>
><br>
><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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
<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="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>