Griffin Wright
2012-Jan-23 19:54 UTC
[LLVMdev] Assertion `AA && "AA didn't call InitializeAliasAnalysis in its run method!"' failed.
Hello all, I am working with someone else's LLVM code, which is about 8 months old. Part of this pass involves AliasAnalysis, and I'm getting the above assertion when the pass completes. The dump is as follows: -------------------------------- Program received signal SIGABRT, Aborted. 0xf7fdf430 in __kernel_vsyscall () (gdb) bt #0 0xf7fdf430 in __kernel_vsyscall () #1 0xf602e921 in *__GI_raise (sig=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64 #2 0xf6031d52 in *__GI_abort () at abort.c:92 #3 0xf6027788 in *__GI___assert_fail (assertion=0xf78ef62c "AA && \"AA didn't call InitializeAliasAnalysis in its run method!\"", file=0xf78ef5f0 "/x/grwright/llvm/llvm-2.9/lib/Analysis/AliasAnalysis.cpp", line=59, function=0xf78f0e40 "virtual void llvm::AliasAnalysis::deleteValue(llvm::Value*)") at assert.c:81 #4 0xf6c37686 in llvm::AliasAnalysis::deleteValue (this=0x81848d0, V=0x8147000) at /x/grwright/llvm/llvm-2.9/lib/Analysis/AliasAnalysis.cpp:59 #5 0xf6c47153 in llvm::AliasSetTracker::deleteValue (this=0x823ab58, PtrVal=0x8147000) at /x/grwright/llvm/llvm-2.9/lib/Analysis/AliasSetTracker.cpp:505 #6 0xf6c47ae6 in llvm::AliasSetTracker::ASTCallbackVH::deleted (this=0x8233ce8) at /x/grwright/llvm/llvm-2.9/lib/Analysis/AliasSetTracker.cpp:619 #7 0xf72b9d2f in llvm::ValueHandleBase::ValueIsDeleted (V=0x8147000) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:557 #8 0xf72b81ec in ~Value (this=0x8147000, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:60 #9 0xf6f4b041 in ~User (this=0x8147000, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/include/llvm/User.h:62 #10 0xf725dd89 in ~Instruction (this=0x8147000, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Instruction.cpp:54 #11 0xf7275461 in ~GetElementPtrInst (this=0x8147000, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/include/llvm/Instructions.h:285 #12 0xf7136671 in llvm::ilist_node_traits<llvm::Instruction>::deleteNode (V=0x8147000) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:112 #13 0xf7135c80 in llvm::iplist<llvm::Instruction, llvm::ilist_traits<llvm::Instruction> >::erase (this=0x8145d14, where=...) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:463 #14 0xf71c7c37 in llvm::iplist<llvm::Instruction, llvm::ilist_traits<llvm::Instruction> >::erase (this=0x8145d14, first=..., last=...) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:528 #15 0xf71c77a0 in llvm::iplist<llvm::Instruction, llvm::ilist_traits<llvm::Instruction> >::clear (this=0x8145d14) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:532 #16 0xf71c6420 in ~BasicBlock (this=0x8145cf8, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/BasicBlock.cpp:82 #17 0xf71c7db2 in llvm::ilist_node_traits<llvm::BasicBlock>::deleteNode (V=0x8145cf8) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:112 #18 0xf71c79a8 in llvm::iplist<llvm::BasicBlock, llvm::ilist_traits<llvm::BasicBlock> >::erase (this=0x80be818, where=...) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:463 #19 0xf71c658f in llvm::BasicBlock::eraseFromParent (this=0x8145cf8) at /x/grwright/llvm/llvm-2.9/lib/VMCore/BasicBlock.cpp:101 #20 0xf7214b11 in llvm::Function::dropAllReferences (this=0x80be7e8) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Function.cpp:233 #21 0xf728ac59 in llvm::Module::dropAllReferences (this=0x80a9690) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Module.cpp:449 #22 0xf7289af2 in ~Module (this=0x80a9690, __in_chrg=<value optimized out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Module.cpp:70 #23 0x08081e36 in ~auto_ptr (this=0xffffd734, __in_chrg=<value optimized out>) at /usr/include/c++/4.4/backward/auto_ptr.h:168 #24 0x0807d5a4 in main (argc=13, argv=0xffffd814) at /x/grwright/llvm/llvm-2.9/tools/opt/opt.cpp:695 -------------------------------- I have a getAnalysisUsage method which does the following (excerpted): void RelRecovery::getAnalysisUsage(AnalysisUsage &AU) const { AU.addRequired<AliasAnalysis> (); } and then a runOnFunction method which does this: bool RelRecovery::runOnFunction(Function &F) { AA = &getAnalysis<AliasAnalysis> (); } This is the same setup as with a bunch of other analyses (LoopInfo, ProfileInfo, etc) and they all work fine. I've read that AA needs a call to InitializeAliasAnalysis(this) in the main run method (in my case, runOnFunction), and I'm wondering how to properly implement it, since the parameter is supposed to be a Pass. Thanks! Griffin
Griffin Wright
2012-Jan-24 14:02 UTC
[LLVMdev] How to call InitializeAliasAnalysis correctly?
I realize this must have sounded like a trivial question to you all, but I really do sincerely need help with this... I'm not sure how to call InitializeAliasAnalysis in my runOnFunction method since it needs a Pass* as its parameter. See below for details. Thank you! -Griffin Wright On Mon, 23 Jan 2012 14:54:43 -0500, Griffin Wright <grwright at umich.edu> wrote:> Hello all, > > I am working with someone else's LLVM code, which is about 8 months old. > Part of this pass involves AliasAnalysis, and I'm getting the above > assertion when the pass completes. > > The dump is as follows: > -------------------------------- > Program received signal SIGABRT, Aborted. > 0xf7fdf430 in __kernel_vsyscall () > (gdb) bt > #0 0xf7fdf430 in __kernel_vsyscall () > #1 0xf602e921 in *__GI_raise (sig=6) at > ../nptl/sysdeps/unix/sysv/linux/raise.c:64 > #2 0xf6031d52 in *__GI_abort () at abort.c:92 > #3 0xf6027788 in *__GI___assert_fail (assertion=0xf78ef62c "AA && \"AA > didn't call InitializeAliasAnalysis in its run method!\"", > file=0xf78ef5f0 > "/x/grwright/llvm/llvm-2.9/lib/Analysis/AliasAnalysis.cpp", line=59, > function=0xf78f0e40 "virtual void > llvm::AliasAnalysis::deleteValue(llvm::Value*)") at assert.c:81 > #4 0xf6c37686 in llvm::AliasAnalysis::deleteValue (this=0x81848d0, > V=0x8147000) at/x/grwright/llvm/llvm-2.9/lib/Analysis/AliasAnalysis.cpp:59> #5 0xf6c47153 in llvm::AliasSetTracker::deleteValue (this=0x823ab58, > PtrVal=0x8147000) at > /x/grwright/llvm/llvm-2.9/lib/Analysis/AliasSetTracker.cpp:505 > #6 0xf6c47ae6 in llvm::AliasSetTracker::ASTCallbackVH::deleted > (this=0x8233ce8) at > /x/grwright/llvm/llvm-2.9/lib/Analysis/AliasSetTracker.cpp:619 > #7 0xf72b9d2f in llvm::ValueHandleBase::ValueIsDeleted (V=0x8147000) at > /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:557 > #8 0xf72b81ec in ~Value (this=0x8147000, __in_chrg=<value optimizedout>)> at /x/grwright/llvm/llvm-2.9/lib/VMCore/Value.cpp:60 > #9 0xf6f4b041 in ~User (this=0x8147000, __in_chrg=<value optimized out>) > at /x/grwright/llvm/llvm-2.9/include/llvm/User.h:62 > #10 0xf725dd89 in ~Instruction (this=0x8147000, __in_chrg=<valueoptimized> out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/Instruction.cpp:54 > #11 0xf7275461 in ~GetElementPtrInst (this=0x8147000, __in_chrg=<value > optimized out>) at > /x/grwright/llvm/llvm-2.9/include/llvm/Instructions.h:285 > #12 0xf7136671 in llvm::ilist_node_traits<llvm::Instruction>::deleteNode > (V=0x8147000) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:112 > #13 0xf7135c80 in llvm::iplist<llvm::Instruction, > llvm::ilist_traits<llvm::Instruction> >::erase (this=0x8145d14,where=...)> at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:463 > #14 0xf71c7c37 in llvm::iplist<llvm::Instruction, > llvm::ilist_traits<llvm::Instruction> >::erase (this=0x8145d14,first=...,> last=...) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:528 > #15 0xf71c77a0 in llvm::iplist<llvm::Instruction, > llvm::ilist_traits<llvm::Instruction> >::clear (this=0x8145d14) at > /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:532 > #16 0xf71c6420 in ~BasicBlock (this=0x8145cf8, __in_chrg=<value optimized > out>) at /x/grwright/llvm/llvm-2.9/lib/VMCore/BasicBlock.cpp:82 > #17 0xf71c7db2 in llvm::ilist_node_traits<llvm::BasicBlock>::deleteNode > (V=0x8145cf8) at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:112 > #18 0xf71c79a8 in llvm::iplist<llvm::BasicBlock, > llvm::ilist_traits<llvm::BasicBlock> >::erase (this=0x80be818, where=...) > at /x/grwright/llvm/llvm-2.9/include/llvm/ADT/ilist.h:463 > #19 0xf71c658f in llvm::BasicBlock::eraseFromParent (this=0x8145cf8) at > /x/grwright/llvm/llvm-2.9/lib/VMCore/BasicBlock.cpp:101 > #20 0xf7214b11 in llvm::Function::dropAllReferences (this=0x80be7e8) at > /x/grwright/llvm/llvm-2.9/lib/VMCore/Function.cpp:233 > #21 0xf728ac59 in llvm::Module::dropAllReferences (this=0x80a9690) at > /x/grwright/llvm/llvm-2.9/lib/VMCore/Module.cpp:449 > #22 0xf7289af2 in ~Module (this=0x80a9690, __in_chrg=<value optimizedout>)> at /x/grwright/llvm/llvm-2.9/lib/VMCore/Module.cpp:70 > #23 0x08081e36 in ~auto_ptr (this=0xffffd734, __in_chrg=<value optimized > out>) at /usr/include/c++/4.4/backward/auto_ptr.h:168 > #24 0x0807d5a4 in main (argc=13, argv=0xffffd814) at > /x/grwright/llvm/llvm-2.9/tools/opt/opt.cpp:695 > -------------------------------- > > I have a getAnalysisUsage method which does the following (excerpted): > > void RelRecovery::getAnalysisUsage(AnalysisUsage &AU) const { > AU.addRequired<AliasAnalysis> (); > } > > and then a runOnFunction method which does this: > > bool RelRecovery::runOnFunction(Function &F) { > AA = &getAnalysis<AliasAnalysis> (); > } > > This is the same setup as with a bunch of other analyses (LoopInfo, > ProfileInfo, etc) and they all work fine. I've read that AA needs a call > to InitializeAliasAnalysis(this) in the main run method (in my case, > runOnFunction), and I'm wondering how to properly implement it, since the > parameter is supposed to be a Pass. > > Thanks! > Griffin
Seemingly Similar Threads
- [LLVMdev] PLEASE help with Alias Analysis initialization assertion at the end of my pass
- [LLVMdev] PLEASE help with Alias Analysis initialization assertion at the end of my pass
- [LLVMdev] PLEASE help with Alias Analysis initialization assertion at the end of my pass
- [LLVMdev] 'opt' Aborted "While deleting: void %"
- [LLVMdev] 'opt' Aborted "While deleting: void %"