[llvm-commits] [llvm] r76422 - /llvm/trunk/examples/Kaleidoscope/toy.cpp

Devang Patel devang.patel at gmail.com
Mon Jul 20 10:08:22 PDT 2009


On Mon, Jul 20, 2009 at 9:51 AM, Chris Lattner<clattner at apple.com> wrote:
>
> On Jul 20, 2009, at 9:06 AM, Bob Wilson wrote:
>
>>
>> On Jul 20, 2009, at 8:22 AM, Chris Lattner wrote:
>>
>>>
>>> On Jul 20, 2009, at 7:50 AM, Eli Friedman wrote:
>>>
>>>> Author: efriedma
>>>> Date: Mon Jul 20 09:50:07 2009
>>>> New Revision: 76422
>>>>
>>>> URL: http://llvm.org/viewvc/llvm-project?rev=76422&view=rev
>>>> Log:
>>>> PR4591: Make sure to initialize the pass manager before using it.
>>>
>>> Why is this needed?  Isn't the FunctionPassManager calling doInit on
>>> all the passes in it before they start?
>>
>> No, it doesn't.  I ran into the same problem in llc on Friday (http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20090713/081666.html
>> ).
>>
>> The FunctionPassManager does the initialization if you call it for a
>> Module but not for individual Functions.
>
> That seems bad, we should fix it in FunctionPassManager, not in all
> the clients.

It is not a good idea to use doInitialization() as a "constructor" of
respective PM object. The new Context work is expecting this, which is
bad. See r74724's feedback.

doInitialization() gives all passes a chance to collect required
information before PM runs all passes. It is not meant to
initialization PM object. All function passes are allowed to implement
doInitialization(Module &M). They do not implement
doInitialization(Function &F), so it does no make sense to ask
FunctionPassManager to run doInitialization(Function &F).
-
Devang




More information about the llvm-commits mailing list