[LLVMdev] PassManager again...

Andreas Neustifter astifter-llvm at gmx.at
Fri Nov 20 06:54:15 PST 2009


Hi.

On 11/17/2009 08:16 PM, Andreas Neustifter wrote:
> Hi,
>
> Devang Patel wrote:
>> On Tue, Nov 17, 2009 at 9:03 AM, Andreas Neustifter
>> <astifter-llvm at gmx.at>  wrote:
>>
>>> Okay, so the ProfileInfoLoader is working, but when I examine the executions more closely I see that the ProfileInfo generated by the ProfileInfoLoader is immediately discarded, when the SelectionDAGISel kicks in the "No Profile Info"-Implementation is used:
>>>
>>>   >  0x1c1a740   Executing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'...
>>>   >   -*- 'Profiling information loader' is the last user of following pass instances. Free these instances
>>>   >  0x1c1a740    Freeing Pass 'Profiling information loader' on Module 'main.c-O0.ll.bc'...
>>>   >  0x1c1a740   Executing Pass 'Function Pass Manager' on Module 'main.c-O0.ll.bc'...
>>>   >  0x1c301a0     Executing Pass 'Preliminary module verification' on Function 'main'...
>>>   >  0x1c301a0     Executing Pass 'Dominator Tree Construction' on Function 'main'...
>> ...
>>
>> Did you update all these function passes to preserve profile info ?
>
> Ja, they are all either PreserveAll or I have updated them to
> AU.setPreserved<ProfileInfo>().

So I have tried this for some days now, I don't get it:

If I use  AU.addRequired<ProfileInfo>() in SelectionDAGISel.cpp the 
wrong ProfileInfo is used. It uses the "No ProfileInfo" implementation 
if ProfileInfo but not the one from ProfileInfoLoaderPass. (Which is 
immediately discarded after creation.)


When I use AU.addRequiredID(ProfileLoaderPassID) I get assertions that a 
normal constructor is not available. Interesting enough its not the 
ProfileInfoLoader constructor thats misssing but the one from 
MachineFunctionAnalysis, which indeed has none.

This raises the question why different passes are loaded (in a different 
order) when I use addRequiredID instead of addRequired<>.

To get this clear: I try to use the ProfileInfo form a ModulePass in a 
subsequent FunctionPass, can this be a problem?

Andi



More information about the llvm-dev mailing list