[llvm-dev] How to make a function pass run before inlining

Stephan Z via llvm-dev llvm-dev at lists.llvm.org
Fri Apr 9 11:45:15 PDT 2021


These PassBuilder register callbacks have an optimization level argument.
Does each level have its own pipeline, and each pipeline would call this
callback individually?

On Fri, Apr 9, 2021 at 11:32 AM Stephan Z <stephan.yichao.zhao at gmail.com>
wrote:

> Thank you! I guess using registerPipelineStartEPCallback
> <https://source.corp.google.com/piper///depot/google3/third_party/llvm/llvm-project/llvm/include/llvm/Passes/PassBuilder.h;bpv=1;bpt=1;rcl=367340497;l=608?gsn=registerPipelineStartEPCallback&gs=kythe%3A%2F%2Fgoogle3%3Flang%3Dc%252B%252B%3Fpath%3Dthird_party%2Fllvm%2Fllvm-project%2Fllvm%2Finclude%2Fllvm%2FPasses%2FPassBuilder.h%23b-Zfw4P77_JX3V13xQtmXEEMV8nvK0Dlq0pdN9krn2o> at
> BackendUtil.cpp.
>
> On Fri, Apr 9, 2021 at 10:06 AM Arthur Eubanks <aeubanks at google.com>
> wrote:
>
>> Does
>> https://llvm.org/docs/NewPassManager.html#inserting-passes-into-default-pipelines
>> help?
>>
>> On Fri, Apr 9, 2021 at 9:53 AM Stephan Z via llvm-dev <
>> llvm-dev at lists.llvm.org> wrote:
>>
>>> Hi all,
>>>
>>> I wanted to have an LLVM pass to inject code inside functions matching
>>> some conditions about function signatures. If inlining happens before the
>>> LLVM pass, it may not find all functions.
>>>
>>> Is it possible to always run a pass before inlining?
>>>
>>> It seems that LLVM schedules passes in terms of the orders they are
>>> added into Pass Manager.
>>> Do we have any examples to use Pass Manager to control order?
>>>
>>> Thank you,
>>> _______________________________________________
>>> 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/20210409/cb93bbe4/attachment-0001.html>


More information about the llvm-dev mailing list