[LLVMdev] reusing FunctionPassManager with different Modules
Redmond, Paul
paul.redmond at intel.com
Sun Sep 25 08:29:52 PDT 2011
Thanks.
The reason I ask is because I'm looking at some code that does just that. A single FunctionPassManager is constructed with a dummy Module and createStandardFunctionPasses is called on it. The FunctionPassManager cached and run on Functions in other Modules. So far I haven't noticed any problems but I guess that is because the passes added by createStandardFunctionPasses don't touch the Module.
paul
-----Original Message-----
From: Nick Lewycky [mailto:nicholas at mxc.ca]
Sent: Saturday, September 24, 2011 12:21 PM
To: Redmond, Paul
Cc: llvmdev at cs.uiuc.edu
Subject: Re: [LLVMdev] reusing FunctionPassManager with different Modules
On 09/23/2011 11:28 AM, Redmond, Paul wrote:
> Hi,
>
> Is it generally safe to cache a FunctionPassManager and reuse it on
> modules other than the one it was constructed with (assuming they have
> the same target triple)?
No. FunctionPass has a pair of methods, doInitialization and doFinalization, which take Module& and are allowed to read or modify it outside runOnFunction.
Nick
More information about the llvm-dev
mailing list