Leonard Chan via llvm-dev
2018-Sep-26 19:08 UTC
[llvm-dev] doInitialization/Finalization equivalent for new Pass Manager
Hi all, I'm currently attempting to port the AddressSanitizer pass from the legacy pass manager infrastructure to the new one and wanted to know if there was an equivalent method to know if there were equivalent doInitialization and doFinalization functions used by the new PM. All the passes in the new PM that I can find seem to just implement the corresponding `run` method but I can't find any examples of passes that do some sort of initialization/cleanup before and after all passes run. Thanks, Leonard
Philip Pfaffe via llvm-dev
2018-Sep-26 19:24 UTC
[llvm-dev] doInitialization/Finalization equivalent for new Pass Manager
HI Leonard, no there is no equivalent for that. Cheers, Philip On Wed, Sep 26, 2018 at 9:08 PM Leonard Chan via llvm-dev < llvm-dev at lists.llvm.org> wrote:> Hi all, > > I'm currently attempting to port the AddressSanitizer pass from the > legacy pass manager infrastructure to the new one and wanted to know > if there was an equivalent method to know if there were equivalent > doInitialization and doFinalization functions used by the new PM. > > All the passes in the new PM that I can find seem to just implement > the corresponding `run` method but I can't find any examples of passes > that do some sort of initialization/cleanup before and after all > passes run. > > Thanks, > Leonard > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://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/20180926/9427440e/attachment.html>
Fedor Sergeev via llvm-dev
2018-Sep-26 19:35 UTC
[llvm-dev] doInitialization/Finalization equivalent for new Pass Manager
On 09/26/2018 10:08 PM, Leonard Chan via llvm-dev wrote: > Hi all, > > I'm currently attempting to port the AddressSanitizer pass from the > legacy pass manager infrastructure to the new one and wanted to know > if there was an equivalent method to know if there were equivalent > doInitialization and doFinalization functions used by the new PM. > > All the passes in the new PM that I can find seem to just implement > the corresponding `run` method but I can't find any examples of passes > that do some sort of initialization/cleanup before and after all > passes run. As Philip said, there is no corresponding functionality in new PM. I would like to add that while we were porting our downstream passes for our JIT compiler we found that every single attempt to do something nontrivial in initialization/finalization was in fact rather misplaced. Nothing precludes you to initialize extra stuff upon a first call to a pass just there in 'run' method. In one case we even refactored the code to remove the pass that was doing nontrivial initialization since we figured that it is not a pass at all :) regards, Fedor.