[llvm-commits] Machine Branch Probability Info
jolesen at apple.com
Wed Jun 15 12:00:32 CDT 2011
On Jun 15, 2011, at 9:53 AM, Jakub Staszak wrote:
> On Jun 14, 2011, at 11:28 AM, Jakob Olesen wrote:
>> +++ include/llvm/CodeGen/MachineBasicBlock.h (working copy)
>> Please make sure that the weight vectors are not allocated in -O0 builds. We don't want to pay for profiling info that isn't there. Same thing with -use-mbpi.
> How can I do that? I don't have any access to OptLevel in MachineBasicBlock.
When there is no profile info available, don't add weights to basic blocks.
I see the problem, but do try to think of a way to avoid allocating a lot of vectors of nulls.
One possible solution is to pretend that an empty vector means the same as a vector of nulls. Never allocate a vector just to add a 0.
More information about the llvm-commits