Tobias Grosser
2010-May-08 13:37 UTC
[LLVMdev] [Fwd: Error while running my pass with opt]
Hi, you need something like this in your pass: void YourPass::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<DominatorTree>(); } because you need to specify which analysis you are using. Tobi
But this is already present in my pass. And I am not able to understand the cause for the error: opt: /home/ambika/llvm_3/llvm-2.6/include/llvm/PassAnalysisSupport.h:203: AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass && "getAnalysis*() called on an analysis that was not " "'required' by pass!"' failed. What can possibly cause this. Any ideas will also help. Tobias Grosser wrote:> Hi, > > you need something like this in your pass: > > void YourPass::getAnalysisUsage(AnalysisUsage &AU) const { > AU.addRequired<DominatorTree>(); > } > > because you need to specify which analysis you are using. > > Tobi
Try setting breakpoint in your getAnalysisUsage() and see if it's actually called. Maybe there's a subtle difference in signature. Failing that, try breaking on assertion failure and examining it more closely. On Sat, May 8, 2010 at 7:03 PM, ambika <ambika at cse.iitb.ac.in> wrote:> But this is already present in my pass. > And I am not able to understand the cause for the error: > > opt: /home/ambika/llvm_3/llvm-2.6/include/llvm/PassAnalysisSupport.h:203: > AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const > [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass && > "getAnalysis*() called on an analysis that was not " "'required' by > pass!"' failed. > > What can possibly cause this. Any ideas will also help. > > Tobias Grosser wrote: >> Hi, >> >> you need something like this in your pass: >> >> void YourPass::getAnalysisUsage(AnalysisUsage &AU) const { >> AU.addRequired<DominatorTree>(); >> } >> >> because you need to specify which analysis you are using. >> >> Tobi > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
ambika wrote:> But this is already present in my pass. > And I am not able to understand the cause for the error: >Can you send a copy of your getAnalysisUsage() method for your pass? There are some funny errors that can occur when you do things that the PassManager cannot handle. For example, if you're requiring a transform pass, that can cause strange assertions from the PassManager. Requiring a BasicBlock pass from a FunctionPass might also hit assertions within PassManager (I think). If you post your getAnalysisUsage() method, I can take a quick look to see if you're doing something that I know is unsupported by PassManager. -- John T.> opt: /home/ambika/llvm_3/llvm-2.6/include/llvm/PassAnalysisSupport.h:203: > AnalysisType& llvm::Pass::getAnalysisID(const llvm::PassInfo*) const > [with AnalysisType = llvm::DominatorTree]: Assertion `ResultPass && > "getAnalysis*() called on an analysis that was not " "'required' by > pass!"' failed. > > What can possibly cause this. Any ideas will also help. > > Tobias Grosser wrote: > >> Hi, >> >> you need something like this in your pass: >> >> void YourPass::getAnalysisUsage(AnalysisUsage &AU) const { >> AU.addRequired<DominatorTree>(); >> } >> >> because you need to specify which analysis you are using. >> >> Tobi >> > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev >
Maybe Matching Threads
- [LLVMdev] [Fwd: Error while running my pass with opt]
- [LLVMdev] [Fwd: Error while running my pass with opt]
- [LLVMdev] [Fwd: Error while running my pass with opt]
- [LLVMdev] [Fwd: Error while running my pass with opt]
- [LLVMdev] [Fwd: Error while running my pass with opt]