[llvm-dev] status of CodeGen in new Pass Manager

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Fri Nov 12 13:37:48 PST 2021


The part of
https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers
that's relevant:

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().

codegenprepare is in the list of passes that aren't part of the LLVM IR
optimization pipeline, but rather part of the codegen pipeline.


On Fri, Nov 12, 2021 at 10:56 AM Mingming Liu via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Thanks Mircea! Yeah I get it that target dependent code is generated in
> the backend (llc)
>
> (I should have highlighted this in the original post)
>
> The CodeGenPrepare pass works in the legacy PM, but is not a part of the
> new PM. From this line
> <https://github.com/llvm/llvm-project/blob/main/llvm/tools/opt/opt.cpp#L491> (and
> the surrounding function) this is intended.
>
> On Fri, Nov 12, 2021 at 10:51 AM Mircea Trofin <mtrofin at google.com> wrote:
>
>> 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
>>
>> On Fri, Nov 12, 2021 at 10:27 AM Mingming Liu via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> Hi,
>>>    This is a newbie question around CodeGen related passes and the
>>> current status in new Pass Manager.
>>>
>>>    From
>>> https://llvm.org/docs/NewPassManager.html#status-of-the-new-and-legacy-pass-managers,
>>> there are ongoing efforts to make the codegen pipeline work in the new Pass
>>> Manager (which is great!). Searching in the bug list (
>>> https://bugs.llvm.org/buglist.cgi?component=opt&list_id=226453&product=tools&query_format=advanced&resolution=---&short_desc=codegen&short_desc_type=allwordssubstr)
>>> gives no result.
>>>
>>>    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)?
>>>
>>>    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 :-)
>>>
>>>    Any related information will be appreciated!
>>>
>>> --
>>> Thanks,
>>> Mingming
>>> _______________________________________________
>>> LLVM Developers mailing list
>>> llvm-dev at lists.llvm.org
>>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>>>
>>
>
> --
> Thanks,
> Mingming
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20211112/8f36bdc9/attachment.html>


More information about the llvm-dev mailing list