Pass manager question: module pass using function level analysis

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Pass manager question: module pass using function level analysis

Wojciech Matyjewicz
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

_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: Pass manager question: module pass using function level analysis

Devang Patel
Hi,

On Jan 13, 2008, at 9:48 AM, Wojciech Matyjewicz wrote:

> 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.

>
>
> Thanks in advance for the answer.
> -Wojtek
>
> _______________________________________________
> LLVM Developers mailing list
> [hidden email]         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev

-
Devang



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev