Custom AA implementation is not used

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

MyAA.cpp (1.51 KB)

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

Yes, this was the missing piece. Thank you!

Julian