Pass manager question: module pass using function level analysis

Hi,

I am going to write a module pass (say, P) that uses function level
analysis (say, A). Suppose, I analyze two different functions during the
P pass:

bool P::runOnModule(Module &M) {
  ...
  A &X = getAnalysis<A>(F1);
  ...
  A &Y = getAnalysis<A>(F2);
  ...
}

Will X and Y reference the same object here? It's not a problem for me,
as I don't need results of analysis of both functions at the same time.
However, I wonder, if I should explicitly call releaseMemory() method
after the first analysis.

Thanks in advance for the answer.
-Wojtek

Hi,

Hi,

I am going to write a module pass (say, P) that uses function level
analysis (say, A). Suppose, I analyze two different functions during the
P pass:

bool P::runOnModule(Module &M) {
...
A &X = getAnalysis<A>(F1);
...
A &Y = getAnalysis<A>(F2);
...
}

Will X and Y reference the same object here?

No.

It's not a problem for me,
as I don't need results of analysis of both functions at the same time.
However, I wonder, if I should explicitly call releaseMemory() method
after the first analysis.

Yes, that's a good idea.