<div dir="ltr">Thank you so much Arthur and Yuanfang! These pointers are very educational.<div><br></div><div>Now I realize there are two questions</div><div>1) Use NPM for machine passes; this is the desired state <a href="https://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html" target="_blank">RFC</a> and <a href="https://reviews.llvm.org/D85168" target="_blank">D85168</a> tries to push forward.</div><div>2) Whether CodeGenPrepare should be enabled by default (e.g., user of opt CLI specifies an IR with sufficient target information, but doesn't enable CodeGenPrepare explicitly).</div><div><br></div><div>From <a href="https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers" target="_blank">https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers</a>, the preferred option is to not run CodeGenPrepare in the default settings (although users can still run it via specifying <i>-passes=codegenprepare</i>).</div><div><br></div><div>I could make sense of the pointers, and understood the rationales better now. </div><div><br></div><div>I'm curious if there were proposals to turn on CodeGenPrepare by default (if IR has sufficient target information). (didn't find one with <a href="https://www.google.com/search?q=llvm+rfc+turning+on+codegenpreare+opt&newwindow=1&sxsrf=AOaemvIqK3A44HhoAdT538LwKCQ_tbhq1g%3A1636783711790&ei=X1aPYcPSL8rU-gSnoq-IDg&oq=llvm+rfc+turning+on+codegenpreare+opt&gs_lcp=Cgdnd3Mtd2l6EAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsAMyBwgAEEcQsANKBAhBGABQAFgAYNYCaAFwAngAgAEAiAEAkgEAmAEAyAEIwAEB&sclient=gws-wiz&ved=0ahUKEwiD_tu91pT0AhVKqp4KHSfRC-EQ4dUDCA4&uact=5" target="_blank">this search query</a>)</div><div>The good thing is that, when someone (e.g., like me when ramping up on the llvm infra) pipes the <i>opt CLI</i> and <i>llc CLI </i>together, the machine assembly is closer to the machine assembly of Clang (in cpp to assembly mode).<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 12, 2021 at 2:17 PM <<a href="mailto:Yuanfang.Chen@sony.com" target="_blank">Yuanfang.Chen@sony.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">Hi Mingming,<br>
<br>
About the status of using the new pass manager for the codegen pipeline, the RFC was here (<a href="http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html" rel="noreferrer" target="_blank">http://lists.llvm.org/pipermail/llvm-dev/2020-July/143309.html</a>) but there was no Bugzilla ticket for it, sorry! I've just created one <a href="https://bugs.llvm.org/show_bug.cgi?id=52493" rel="noreferrer" target="_blank">https://bugs.llvm.org/show_bug.cgi?id=52493</a> with updates for anyone who might be interested. I haven't been able to follow up on it for a while but a few in-flight patches are still relevant and in good shape (check PR52493). I'll see if I could push them forward in the near future.<br>
<br>
About codegen-prepare, I don't have much to add other than Arthur's answer, except that D85168 would enable the use case, although it has some dependencies so it's not like that it could be landed soon.<br>
<br>
HTH,<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 Mingming Liu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a>><br>
Sent: Friday, November 12, 2021 10:26 AM<br>
To: <a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
Subject: [llvm-dev] status of CodeGen in new Pass Manager<br>
<br>
Hi,<br>
   This is a newbie question around CodeGen related passes and the current status in new Pass Manager.<br>
<br>
   From <a href="https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers" rel="noreferrer" target="_blank">https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers</a><<a href="https://urldefense.com/v3/__https://llvm.org/docs/NewPassManager.html*status-of-the-new-and-legacy-pass-managers__;Iw!!JmoZiZGBv3RvKRSx!tI8u93htbfzW8OQkAVIdBlQTDHabCnLJtB2D5fD_OjBuK1ACPDpumEw6GK_dphuBDA$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://llvm.org/docs/NewPassManager.html*status-of-the-new-and-legacy-pass-managers__;Iw!!JmoZiZGBv3RvKRSx!tI8u93htbfzW8OQkAVIdBlQTDHabCnLJtB2D5fD_OjBuK1ACPDpumEw6GK_dphuBDA$</a>>, there are ongoing efforts to make the codegen pipeline work in the new Pass Manager (which is great!). Searching in the bug list (<a href="https://bugs.llvm.org/buglist.cgi?component=opt&list_id=226453&product=tools&query_format=advanced&resolution=---&short_desc=codegen&short_desc_type=allwordssubstr" rel="noreferrer" target="_blank">https://bugs.llvm.org/buglist.cgi?component=opt&list_id=226453&product=tools&query_format=advanced&resolution=---&short_desc=codegen&short_desc_type=allwordssubstr</a><<a href="https://urldefense.com/v3/__https://bugs.llvm.org/buglist.cgi?component=opt&list_id=226453&product=tools&query_format=advanced&resolution=---&short_desc=codegen&short_desc_type=allwordssubstr__;!!JmoZiZGBv3RvKRSx!tI8u93htbfzW8OQkAVIdBlQTDHabCnLJtB2D5fD_OjBuK1ACPDpumEw6GK-25d1S-w$" rel="noreferrer" target="_blank">https://urldefense.com/v3/__https://bugs.llvm.org/buglist.cgi?component=opt&list_id=226453&product=tools&query_format=advanced&resolution=---&short_desc=codegen&short_desc_type=allwordssubstr__;!!JmoZiZGBv3RvKRSx!tI8u93htbfzW8OQkAVIdBlQTDHabCnLJtB2D5fD_OjBuK1ACPDpumEw6GK-25d1S-w$</a>>) gives no result.<br>
<br>
   I'm wondering if anyone has more information on the current status of CodeGen in the new Pass Manager (a tracking bug or other pointers)?<br>
<br>
   The context is that, I'm using opt CLI (by default new PM is used), and surprised that codegenprepare pass doesn't run, so dig down and having more questions :-)<br>
<br>
   Any related information will be appreciated!<br>
<br>
--<br>
Thanks,<br>
Mingming<br>
</blockquote></div><br clear="all"><div><br></div>-- <br><div dir="ltr"><div dir="ltr"><div><div dir="ltr"><div><div><font color="#555555" face="sans-serif" size="2">Thanks,</font></div><div><font color="#555555" face="sans-serif" size="2">Mingming</font></div></div></div></div></div></div>