[llvm-dev] doInitialization/Finalization equivalent for new Pass Manager

Fedor Sergeev via llvm-dev llvm-dev at lists.llvm.org
Wed Sep 26 12:35:11 PDT 2018



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.


More information about the llvm-dev mailing list