Hello LLVM devs, I'm trying to write my own alias analysis that only contributes information to the getModRefBehavior query, and should be in its own library loadable by opt. However, even though my pass is run (and executed immediately before the client pass that is calling AA.doesNotAccessMemory(F)), the queries never reach my implementation. What am I missing? Thanks in advance, Julian -------------- next part -------------- A non-text attachment was scrubbed... Name: MyAA.cpp Type: text/x-c++src Size: 1544 bytes Desc: not available URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20130416/37e51cc7/attachment.cpp>
Julian Oppermann wrote:> Hello LLVM devs, > > I'm trying to write my own alias analysis that only contributes > information to the getModRefBehavior query, and should be in its own > library loadable by opt. > > However, even though my pass is run (and executed immediately before the > client pass that is calling AA.doesNotAccessMemory(F)), the queries > never reach my implementation. What am I missing?You don't provide an implementation of getAdjustedAnalysisPointer. This is a stab in the dark, but try adding that? Something like: virtual void *getAdjustedAnalysisPointer(const void *ID) { if (ID == &AliasAnalysis::ID) return (AliasAnalysis*)this; return this; } Nick
Am 03.05.2013 20:02, schrieb Nick Lewycky:> Julian Oppermann wrote: >> Hello LLVM devs, >> >> I'm trying to write my own alias analysis that only contributes >> information to the getModRefBehavior query, and should be in its own >> library loadable by opt. >> >> However, even though my pass is run (and executed immediately before the >> client pass that is calling AA.doesNotAccessMemory(F)), the queries >> never reach my implementation. What am I missing? > > You don't provide an implementation of getAdjustedAnalysisPointer. This > is a stab in the dark, but try adding that? Something like: > > virtual void *getAdjustedAnalysisPointer(const void *ID) { > if (ID == &AliasAnalysis::ID) > return (AliasAnalysis*)this; > return this; > }Yes, this was the missing piece. Thank you! Julian
Apparently Analagous Threads
- [LLVMdev] Custom AA implementation is not used
- [LLVMdev] About writing an alias analysis pass for LLVM 3.1
- [LLVMdev] About writing an alias analysis pass for LLVM 3.1
- Function attributes for LibFunc and its impact on GlobalsAA
- [LLVMdev] Functions: sret and readnone