LLVM CFLAliasAnalysis Inter-Procedural Queries not working


I am trying to implement inter-procedural alias analysis using CFLAliasAnalysis pass. I am using llvm-3.8.0 version.

I tried to use query function of this pass. I passed memory locations of two store instructions of two different local variables from two different functions. These two locations will not alias.

But unfortunately, I get an assertion failed message:
“Interprocedural queries not supported.”

I tried debugging this assertion failed message. It is generated from file CFLAliasAnalysis.cpp in query function.

assert((!MaybeFnB.hasValue() || *MaybeFnB == *MaybeFnA) &&


In my understanding, CFLAA should allows inter-procedural alias analysis. However, this assertion seems to be contradicting and stops it from executing inter-procedural alias analysis. What am I missing ? Could you please guide me as to how I can use it for inter-procedural alias analysis ?

Thanks in advance !!

Hi Arun,

CFL-AA does support some limited amount of IPA, but only internally. It is not something you can access explicitly. When analyzing call instructions, internally, it makes use of information about the callee. In general, our AA interface does not support direct interprocedural queries. We’ve never even defined the semantics for what that would mean. What are you trying to do?