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

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


Hi,

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

http://groups.google.com/group/llvm-dev/browse_thread/thread/4bd65dbe84394bb7

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::ModulePass::assignPassManager(llvm::PMStack&,
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
implemented?

Thanks!





More information about the llvm-dev mailing list