[llvm-dev] Porting Pass to New PassManager

Fedor Sergeev via llvm-dev llvm-dev at lists.llvm.org
Mon Sep 24 23:26:59 PDT 2018


Leonard,

nope, the PassRegistry stuff is all about legacy pass manager.
legacy namespace has not been extensively used to mark all the 
legacy-related stuff
(say, even Pass class which is a base for legacy passes is not under 
legacy namespace).

Registration for new-pass-manager passes happens in 
lib/Passes/PassRegistry.def.

Usually, when porting from legacy to new the main difference is analysis 
handling,
so people factor out the worker code into a method that takes analyses 
and call
this function both in legacy and new-pm passes.
In many cases it takes just a handful lines of code.

Feel free to ask questions, if any.

regards,
   Fedor.

On 09/25/2018 02:54 AM, Leonard Chan via llvm-dev wrote:
 > Hi all,
 >
 > I'm attempting to move the AddressSanitizer pass from the legacy
 > PassManager to the new one because the new one has various benefits
 > over legacy and wanted to clarify on something. Does creating the
 > static RegisterPass struct register the pass with the new PassManager?
 >
 > It seems that RegisterPass does the same things that the
 > INITIALIZE_PASS_* macros do but it registers the pass with
 > PassRegistry::getPassRegistry(). What I'm not sure of is if this uses
 > the new PassManager infrastructure. Exploring the code doesn't seem to
 > show that this PassRegistry touches anything in the legacy namespace,
 > but I wanted double confirmation on this.
 >
 > Thanks,
 > Leonard
 > _______________________________________________
 > LLVM Developers mailing list
 > llvm-dev at lists.llvm.org
 > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev



More information about the llvm-dev mailing list