[llvm-dev] Doubt regarding getAnalysisUsage

Dangeti Tharun kumar via llvm-dev llvm-dev at lists.llvm.org
Wed Aug 14 20:52:12 PDT 2019


On Wed, Aug 14, 2019 at 10:21 PM Michael Kruse <llvmdev at meinersbur.de>
wrote:

> Hi,
>
> 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
> run.
>
I am under the impression that the pass manager will re-run the
un-preserved analysis passes only if the current pass returns with a
'true'.

>
> Michael
>
>
> 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
>


-- 
Regards,
DTharun
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190815/e9984a62/attachment.html>


More information about the llvm-dev mailing list