Hi: My pass needs to run on LLVM Regions, I'm currently using the following code ``` RGPassManager RPM; RPM.add(createRegionPrinterPass()); RPM.doInitialization(M); for (Function &func : M.functions()) { RPM.runOnFunction(func); } RPM.doFinalization(M); ``` However when adding the pass, it asserts with PMTopLevelManager::findAnalysisUsage due to top level pass manager is null Zhang -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210219/e90773af/attachment-0001.html>
Michael Kruse via llvm-dev
2021-Feb-19 06:06 UTC
[llvm-dev] Example of using RGPassManager?
Probably it's because RegionPrinterPass also depends on a FunctionPass analysis, such as DominatorTree. Try creating a function pass and adding createRegionPrinterPass() to it, it will create the RGPassManager for you. Michael Am Do., 18. Feb. 2021 um 22:33 Uhr schrieb Zhang via llvm-dev <llvm-dev at lists.llvm.org>:> > Hi: > My pass needs to run on LLVM Regions, I'm currently using the following code > ``` > RGPassManager RPM; > RPM.add(createRegionPrinterPass()); > RPM.doInitialization(M); > for (Function &func : M.functions()) { > RPM.runOnFunction(func); > } > RPM.doFinalization(M); > ``` > > However when adding the pass, it asserts with PMTopLevelManager::findAnalysisUsage due to top level pass manager is null > > Zhang > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev