[LLVMdev] [PATCH] & Question: Preserving ProfileInfo for backend.
astifter-llvm at gmx.at
Wed Sep 9 10:47:06 PDT 2009
Shuguang Feng wrote:
> Does the current LLVM backend support reading in profile information
> (without preserving across transformations)? An earlier poster
Yes, it does.
> 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 I
> noticed that the NoProfileInfo pass was being executed.
Yes, llc currently does not support the loading of profiles, but I
attach a patch that does that, can you try that please?
> 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
Don't know about Passes in the backend, but this could be a problem of
an FunctionPassManager trying to use a ModulePass.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2198 bytes
Desc: not available
More information about the llvm-dev