<div dir="ltr"><a href="https://reviews.llvm.org/D97515" target="_blank">https://reviews.llvm.org/D97515</a> is adding some documentation around using the new PM, reviews for clarity/anything missing are appreciated :)<br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 24, 2021 at 12:08 PM Jon Chesterfield <<a href="mailto:jonathanchesterfield@gmail.com" target="_blank">jonathanchesterfield@gmail.com</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"><div dir="ltr"><div dir="ltr">Thank you all. That is interesting in several ways - I had missed the subtlety that the middle end is changing / has changed to the new pass manager before the back end.</div><div dir="ltr"><br></div><div>In the immediate sense, this solves my problem because I therefore don't need to run the pass through the new manager after all. I can leave the plumbing in place so that it can be run through opt with the new pass manager, but don't need it to actually be run. Once the back ends can/do use the new manger there will hopefully be a corresponding hook I can put the invocation. That can be tomorrow's task however.</div><div><br></div><div>Thank you for the suggestion of EP_OptimizerLast. It doesn't help this particular pass but likely will others.</div><div><br></div><div>Re: updating docs, I found the link to the new pass manager, <a href="https://llvm.org/docs/WritingAnLLVMNewPMPass.html" target="_blank">https://llvm.org/docs/WritingAnLLVMNewPMPass.html</a>, so would have benefited from a warning there that this is not yet in use across back ends.</div><div><br></div><div>Thanks!</div><div><br></div><div>Jon</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 24, 2021 at 7:11 PM Arthur Eubanks <<a href="mailto:aeubanks@google.com" target="_blank">aeubanks@google.com</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"><div dir="ltr">Oh and to answer the original question, +1 to what Yuanfang said, but you mentioned considering EP_ModuleOptimizerEarly, so what about keeping it in the middle-end at EP_OptimizerLast (the NPM equivalent being registerOptimizerLastEPCallback()) rather than moving it to the backend? I'm not sure if you consider your pass to be a middle-end or a backend pass.</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 24, 2021 at 11:04 AM Arthur Eubanks <<a href="mailto:aeubanks@google.com" target="_blank">aeubanks@google.com</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"><div dir="ltr">Yes we should definitely document this somewhere. Does it make sense to add onto <a href="https://llvm.org/docs/WritingAnLLVMBackend.html" target="_blank">https://llvm.org/docs/WritingAnLLVMBackend.html</a>? Or create a new page since these hooks aren't only used by backends, but also used by Clang to add sanitizers and other Clang-specific passes?</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Feb 24, 2021 at 10:48 AM 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:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">> For example, what is the rough equivalent to addPreISel() in the old one for running target specific passes shortly before instruction selection<br>
<br>
Hello,<br>
<br>
Code generation passes including target-specific IR passes (usually these specified in derived TargetPassConfig class) are not using the new pass manager.  I'm working on switching the code generation to use the new pass manager but it is not quite there yet. I guess we should document this fact in the new pass manager documentation because I think this question comes up once in a while.<br>
<br>
- Yuanfang<br>
<br>
________________________________________<br>
From: llvm-dev <<a href="mailto:llvm-dev-bounces@lists.llvm.org" target="_blank">llvm-dev-bounces@lists.llvm.org</a>> on behalf of Jon Chesterfield via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
Sent: Wednesday, February 24, 2021 9:31 AM<br>
To: llvm-dev<br>
Subject: [llvm-dev] New pass manager, documentation?<br>
<br>
Hi,<br>
<br>
I'm trying to work out how to use the new pass manager. For example, what is the rough equivalent to addPreISel() in the old one for running target specific passes shortly before instruction selection, or how do I run a module pass shortly before a function pass.<br>
<br>
I have a module pass which works if run shortly before instruction selection, but not if it is run via EP_ModuleOptimizerEarly. My current plan is to make the pass significantly more complicated, so that it can handle being run repeatedly from suboptimal points in the pipeline, but I can keep the simple/stupid version instead if I can work out how the pass manager works.<br>
<br>
Thanks,<br>
<br>
Jon<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>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>