Non-immutable alias analysis

Hi,

I wrote a module pass that uses Alias Analysis.

For this reason I added AU.addRequired() to function getAnalysisUsage and used getAnalysis() in my pass.

I tried a few types of alias analyses and I discovered that only alias analyses which are ImmutablePasses are returned using getAnalysis(). Moreover, when I added both ImmutablePass and FunctionPass, getAnalysis() returned the ImmutablePass while the FunctionPass did not even appear in the AA chain ( I assume it is because building the chain uses getAnalysis as well).

Does this feature should be supported?

Thx,

Ohad

Hi Ohad,

I wrote a module pass that uses Alias Analysis.

For this reason I added AU.addRequired<AliasAnalysis>() to function
getAnalysisUsage and used getAnalysis<AliasAnalysis>() in my pass.

I tried a few types of alias analyses and I discovered that only alias analyses
which are ImmutablePasses are returned using getAnalysis<AliasAnalysis>().
Moreover, when I added both ImmutablePass and FunctionPass,
getAnalysis<AliasAnalysis>() returned the ImmutablePass while the FunctionPass
did not even appear in the AA chain ( I assume it is because building the chain
uses getAnalysis as well).

Does this feature should be supported?

except for immutable alias analyses you have to schedule the alias analysis pass
immediately before your pass otherwise it won't be used. This is an old problem
and I'm sure there are some bug reports about it, maybe PR7720?

Ciao, Duncan.