[llvm-dev] Example of using RGPassManager?
Zhang via llvm-dev
llvm-dev at lists.llvm.org
Fri Feb 19 00:40:28 PST 2021
Thanks. I ended up directly using legacy::PassManager which worked for me
Zhang
------------------ Original ------------------
From: "Michael Kruse"<llvmdev at meinersbur.de>;
Date: Fri, Feb 19, 2021 02:07 PM
To: "Zhang"<admin at mayuyu.io>;
Cc: "llvm-dev"<llvm-dev at lists.llvm.org>;
Subject: Re: [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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210219/5973390a/attachment.html>
More information about the llvm-dev
mailing list