[LLVMdev] [PATCH] & Question: Preserving ProfileInfo for backend.

Shuguang Feng shuguang.feng at gmail.com
Wed Sep 9 15:15:57 PDT 2009

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:


I believe I've integrated all the ProfileInfo* files from ToT with my
LLVM-2.5 installation properly.  The profiling code (and llvm-prof)
seems to be working since llvm-prof is generating/printing the
appropriate execution frequencies.  Is there an obvious mistake that I
could be making?  Since I've had to customize my current installation
of llvm I would like to avoid updating to the latest revision if


More information about the llvm-dev mailing list