<div dir="ltr"><div>The part of <a href="https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers">https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers</a> that's relevant:</div><div><br></div><font face="monospace">Some IR passes are considered part of the backend codegen pipeline even if they are LLVM IR passes (whereas all MIR passes are codegen passes). This includes anything added via TargetPassConfig hooks, e.g. TargetPassConfig::addCodeGenPrepare(). As mentioned before, passes added in TargetMachine::adjustPassManager() are part of the optimization pipeline, and should have a corresponding line in TargetMachine::registerPassBuilderCallbacks().</font><div><br></div><div>codegenprepare is in the list of passes that aren't part of the LLVM IR optimization pipeline, but rather part of the codegen pipeline.<br><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 12, 2021 at 10:56 AM Mingming Liu via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">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"><div dir="ltr">Thanks Mircea! Yeah I get it that target dependent code is generated in the backend (llc)<div><br></div><div>(I should have highlighted this in the original post)</div><div><br></div><div>The CodeGenPrepare pass works in the legacy PM, but is not a part of the new PM. From <a href="https://github.com/llvm/llvm-project/blob/main/llvm/tools/opt/opt.cpp#L491" target="_blank">this line</a> (and the surrounding function) this is intended.</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 12, 2021 at 10:51 AM Mircea Trofin <<a href="mailto:mtrofin@google.com" target="_blank">mtrofin@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">Unless I'm missing something, llc runs codegen, opt runs the optimization passes up to machine lowering. In other words - try llc instead of opt</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Fri, Nov 12, 2021 at 10:27 AM Mingming Liu 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"><div dir="ltr">Hi,<div> This is a newbie question around CodeGen related passes and the current status in new Pass Manager.</div><div> </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>, 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" 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>) gives no result.</div><div><br></div><div> 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)?</div><div><br></div><div> 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 :-)</div><div><br></div><div> Any related information will be appreciated!</div><div><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></div></div>
_______________________________________________<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><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>
_______________________________________________<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>