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

Shuguang Feng shuguang.feng at gmail.com
Wed Sep 9 09:46:40 PDT 2009


Does the current LLVM backend support reading in profile information
(without preserving across transformations)? An earlier poster


noted that accessing execution counts in a MachineFunction pass (using
the BasicBlock* corresponding to the respective MachineBasicBlock)
returned 0 for all blocks.  Running llc with --debug-pass=Structure I
noticed that the NoProfileInfo pass was being executed.  I tried
adding a ProfileLoaderPass in the addPreRegAlloc function of the X86
target machine to load the profile information but receive the
following runtime error when the pass manager attempts to add the
ProfileLoader pass:

llc: <path to llvm>/llvm/lib/VMCore/PassManager.cpp:1597: virtual void
llvm::PassManagerType): Assertion `!PMS.empty() && "Unable to find
appropriate Pass Manager"' failed.

I'm not very familiar with the inner workings of the pass manager
framework.  Is there a simple fix that can allow existing profile
information to be loaded by backend passes?  I realize that the
profile data would not be completely accurate, but as a first order
approximation it could be useful until the proper framework is


More information about the llvm-dev mailing list