[LLVMdev] Loading ProfileInfo in Backend. (Was: [PATCH] & Question: Preserving ProfileInfo for backend.)

Andreas Neustifter astifter-llvm at gmx.at
Thu Sep 10 01:35:37 PDT 2009


Hi,

Shuguang Feng wrote:
> Thanks for such a rapid response!
> 
>> Don't know about Passes in the backend, but this could be a problem of
>> an FunctionPassManager trying to use a ModulePass.
> 
> I manually applied the patch you provided for llc (I'm using the 2.5
> release of LLVM not ToT) and it fixed my compilation error.  When your
> patch replaced the FunctionPassManager used by llc with a PassManager
> the error went away.
> 
> Unfortunately, I'm still seeing execution counts of -1 when I print
> them out in my MachineFunction pass. I access the profiling
> information at each MachineBasicBlock with the following code, where
> "bb" is a reference to the current MachineBasicBlock:
> 
> PI->getExecutionCount(bb.getBasicBlock())

What does "llc -debug-pass=Structure" say? Is the ProfileLoaderPass
really the last pass to touch the ProfileInfo before you are using it?

Also, does bb.getBasicBlock() for sure always returns a valid block
refrerence?

You are getting the PI by getAnalysis<ProfileInfo>() I presume? Is this
really the instance created by ProfileLoaderPass?

(I guess for the last two questions its best to use gdb, are you
familiar with it?)

Andi





More information about the llvm-dev mailing list