[llvm-dev] Doubt regarding getAnalysisUsage

Michael Kruse via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 14 09:51:05 PDT 2019


the legacy pass manager (the one that uses getAnalysisUsage) makes no
distinction between analyses and other passes. E.g., passes can also
depend on transformative passes. If your pass is does not change the
IR, then you can add AU.setPreservesAll() into getAnalysisUsage. Any
additional addPreserved calls will have no effect as you told the pass
manager already that you preserve all passes.If you do not add
setPreservesAll/addPreserved the pass manager will treat your pass as
a transformative pass and re-compute SomeAnalysis after your pass has


Am Di., 13. Aug. 2019 um 23:33 Uhr schrieb Dangeti Tharun kumar via
llvm-dev <llvm-dev at lists.llvm.org>:
> Hi,
> I have a doubt regarding getAnalysisUsage. My assumption is that, as analysis passes will not change the IR, all the passes required by an analysis pass should be preserved. Say, I have an analysis pass which requires another analysis pass called SomeAnalysis and I have not added AU.addPreserved<SomeAnalysis>() to my pass.
> Would the pass manager still considers the SomeAnlaysis as preserved?
> --
> Regards,
> DTharun
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

More information about the llvm-dev mailing list