search for: addrequired

Displaying 20 results from an estimated 412 matches for "addrequired".

2016 Jan 22
4
LLVM - getAnalysisUsage()
Hi, I am using llvm-3.8 for my project. Following is my getAnalysisUsage() method: virtual void getAnalysisUsage(AnalysisUsage &AU) const override { AU.setPreservesAll(); AU.addRequired<X>(); AU.addRequired<Y>(); AU.addRequired<Z>(); } Now, if I call getAnalysis<X>(*F), instead of invoking just the X pass, all the passes, i.e., X, Y and Z are being invoked. Could anyone help me in this regard? Thanks -- Syed
2010 Apr 01
2
[LLVMdev] AnalysisUsage: addRequired vs. addRequiredTransitive
On Mar 31, 2010, at 3:13 PM, Owen Anderson wrote: > Some analyses, like Andersen's AA, do all their computation in their > runOnFunction(). Therefore, anything they depended on can be > destroyed after the runOnFunction() returns. What about AA itself? Would addRequired<AliasAnalysis> keep AliasAnalysis alive (but allow AliasAnalysis's dependencies to die)? > Others, like MemoryDependenceAnalysis, are "lazy." MDA > specifically does NOT compute results in its runOnFunction(), > instead computing results on-demand when a user q...
2016 Jun 19
6
pass invalidation
...When I use llvm, I encounter a problem like "unable to schedule pass A required by C" I investigated deeper. It's like: I have three passes, say A, B, C(all are on function level) A would modify IR code. (change instruction order) For pass B, I would use the result of pass A, I use addRequired<B>(), and &getAnalysis<B>(), it works. void getAnalysisUsage(AU){ AU.addRequired<A>(); } For pass C, it will use the results of pass A and B. I use the way as used for pass B, but it failed, even for LoopInfo analysis pass(which is the built-in analysis pass). void getAnaly...
2005 Sep 05
2
[LLVMdev] Pass is not automatically registered
...truct RegisterAnalysis ctor, but my pass doesn't appear. I put it in an anonymous namespace, it doesn't work too. The class definitions: class DependenceAnalyzer : public MachineFunctionPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LiveIntervals>(); AU.addRequired<LiveVariables>(); MachineFunctionPass::getAnalysisUsage(AU); } class RegAllocMultibank : public MachineFunctionPass { virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<LiveIntervals>(); AU.ad...
2011 Oct 14
2
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
...MemoryDependenceAnalysis.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; struct Hello: public ModulePass { public: static char ID; MemoryDependenceAnalysis *MD; Hello(): ModulePass(ID) { ;; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MemoryDependenceAnalysis>(); errs() << "addRequired called\n"; } virtual bool runOnModule(Module &M) { for(Module::iterator f = M.begin(); f != M.end(); ++f) runOnFunction(*f, M); return false; } private: bool runOnFunction(Function &F, Module &M) {...
2014 Sep 29
2
[LLVMdev] questions about getAnalysisUsage
Hi, I notice that there are several different methods called inside getAnalysisUsage(). The parameters of addRequiredID and addPreservedID are passID. What is the difference between Required and Preserved? There are also function named addRequired<PassName>() called. What is the difference between addRequired<PassName>() and addRequiredID(PassID)? Thanks a lot! Best,...
2017 Oct 03
1
About LLVM Pass dependency
...llvm.org/docs/WritingAnLLVMPass.html#specifying-interactions-between-passes>, All examples that i see here are based on collecting information .i.e Analysis Passes. I wonder if this applies to Transformation passes also. e.g. void MyInliner::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<SimplifyCFGPass>(); // Transformation Pass AU.addRequired<AnnotatedFunctionPass>(); // Transformation like pass AU.addRequired<CallGraphSCCPass>(); // Analysis Pass } here AnnotateFunctionPass is adding meta information,so technically nothing Functional transformatio...
2015 Jul 29
1
[LLVMdev] Loop Dependence Analysis(getDistance())
...LLVM learing process. I have used the following code inside my original code to get the distance vector. It is not giving any syntax error but it is has some logical but and giving segmentation fault. void getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<PostDominatorTree>(); AU.addRequired<LoopInfo>(); AU.addRequired<DependenceAnalysis>(); AU.addPreserved<DependenceAnalysis>(); AU.addRequired<ScalarEvolution>(); AU.addPreserved<ScalarEvolution>(); AU.addRequired<AliasAnalysis>();...
2010 Apr 01
0
[LLVMdev] AnalysisUsage: addRequired vs. addRequiredTransitive
...gt; specifically does NOT compute results in its runOnFunction(), > > instead computing results on-demand when a user queries it. Because > > MDA depends on AA, we must ensure that, as long as MDA is alive and > > responding to queries, AA is alive as well. That is what > > addRequiredTransitive does. > > I'm not sure if I follow this. So let's say I'm writing a pass Foo, > and Foo depends on MDA. You're saying that Foo's getAnalysisUsage must > call addRequiredTransitive< MemoryDependenceAnalysis>, not > addRequired<MemoryDependenceAn...
2017 Feb 14
2
addRequired() + getAnalysis() for new / non-legacy pass manager
Hi! I am trying to extend the native AliasAnalysis of LLVM to use an external analysis pass. Doing this with the legacy pass manager works fine through calling addRequired() in the getAnalysisUsage and getAnalysis() in function runOnFunction(). In the new pass manager, I haven't found a similar way of doing this. When running opt with -O3, I encounter the following error: >Assertion `ResultPass && "getAnalysis*() called on an analysis that was no...
2019 Mar 31
2
Unable to find requested analysis info (Interesting Assertion Failture for Specific Target Source Code)
...ass::runOnModule(Module &M) { for (auto &F : M) { SE = &getAnalysis<ScalarEvolutionWrapperPass>(F).getSE(); ...... } } return false; } void MYPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequired<LoopInfoWrapperPass>(); AU.addRequired<ScalarEvolutionWrapperPass>(); AU.addRequired<LoopAccessLegacyAnalysis>(); AU.addRequired<DominatorTreeWrapperPass>(); AU.addRequired<OptimizationRemarkEmitterWrapperPass>(); } =====================================...
2011 Nov 08
2
[LLVMdev] loadable passes with dependencies?
I still have the addRequired: virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<DominatorTree>(); } The other line DominatorTree *dt = &getAnalysis<DominatorTree>(); Is for later use when I try to use PromoteMemToReg On Tue, Nov 8, 2011 at 4:22 PM, M...
2011 Oct 13
2
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
I wrote a pass(that is to be loaded by opt) that I would like to use in conjunction with MemoryDependenceAnalysis. I have tried using by including its header and adding this to my pass:        virtual void getAnalysisUsage(AnalysisUsage &AU) const {         errs() << "addRequired called\n";         AU.addRequired<MemoryDependenceAnalysis>();        } And in my runOnFunction() method I have:        MD = &getAnalysis<MemoryDependenceAnalysis>(); The results in:        addRequired called        Assertion failed: (ResultPass && "getAnalysis*(...
2010 Mar 31
2
[LLVMdev] AnalysisUsage: addRequired vs. addRequiredTransitive
Hi, I'm a bit confused about the distinction between addRequired and addRequiredTransitive in AnalysisUsage. From PassAnalysisSupport.h: "REQUIRES (must be available when the pass runs), REQUIRES TRANSITIVE (must be available throughout the lifetime of the pass)." The part that's confusing me is "must be available when the pass runs&qu...
2015 May 20
3
[LLVMdev] Processing functions in call graph SCC "order" with function-level analyses
So I got very mixed results. With the CallGraphSCCPass, both `addRequired<DominatorTreeWrapperPass>` and `addRequired<MemoryDependenceAnalysis>` fail at runtime. The LLVM core has just two CallGraphSCCPasses and neither uses neither analyses, so it's hard to find a valid example. I transformed the pass into a ModulePass, using scc_iterator as shown in CG...
2016 Jan 22
3
LLVM - getAnalysisUsage()
...lvm-dev at lists.llvm.org> wrote: >> >> Hi, >> >> I am using llvm-3.8 for my project. Following is my getAnalysisUsage() method: >> >> virtual void getAnalysisUsage(AnalysisUsage &AU) const override >> { >> AU.setPreservesAll(); >> AU.addRequired<X>(); >> AU.addRequired<Y>(); >> AU.addRequired<Z>(); >> } >> >> Now, if I call getAnalysis<X>(*F), instead of invoking just the X >> pass, all the passes, i.e., X, Y and Z are being invoked. Could anyone >> help me in this regar...
2014 Apr 18
3
[LLVMdev] PassManager Woes
...ing like this: A B ^ ^ / | | | C D | ^ ^ | |\ | | | \ | \ | \ | F E The arrows represent direct use of analysis pass data. So even though C is built upon information from A, F directly accesses information from both C and A. I have tried all kinds of combinations of addRequired and addRequiredTransitive but no matter what, pass C gets rerun before pass F as expected but pass A does not. This leads to a situation where pass F uses up to date information from pass C and out of date information from pass A, leading to an analysis inconsistency and a compiler abort. Note tha...
2011 Oct 15
1
[LLVMdev] pass utilizing MemoryDependenceAnalysis?
...nclude "llvm/Analysis/MemoryDependenceAnalysis.h" #include "llvm/Support/raw_ostream.h" using namespace llvm; struct Hello: public FunctionPass { public: static char ID; Hello(): FunctionPass(ID) { ;; } virtual void getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<MemoryDependenceAnalysis>(); errs() << "addRequired called\n"; } virtual bool runOnFunction(Function &F) { if(F.isDeclaration() == true) return false; MemoryDependenceAnalysis *MD = &getAnalysis<MemoryDependenceAnalysis>(F); for(Function::iterato...
2018 Jan 24
0
Memory leaks in LegacyPassManager depending on order of addRequired passes
...ransforms/IPO/GlobalOpt.cpp.<br>However, depending on the order of where I add it, I see memory leak errors with LeakSanitizer.</div> <div>Having the following order shows the leak:</div> <div>void getAnalysisUsage(AnalysisUsage &AU) const override {<br> AU.addRequired<TargetLibraryInfoWrapperPass>();<br> AU.addRequired<TargetTransformInfoWrapperPass>();<br> AU.addRequired<BlockFrequencyInfoWrapperPass>();<br> AU.addRequired<DominatorTreeWrapperPass>();<br> }</div> <div><br>and changing it to...
2007 Dec 04
3
[LLVMdev] Requiring dynamically loaded passes
Is it possible to AddRequired<...> a pass that is dynamically loaded? This would be very convenient for a course project but the documentation about pass interactions says nothing about dynamically loaded passes and vice versa. More specifically, to refer to the pass name in AddRequired, I need to declare it fir...