[llvm-commits] [llvm] r147286 - in /llvm/trunk: lib/Transforms/Utils/SimplifyCFG.cpp test/Transforms/SimplifyCFG/preserve-branchweights.ll

Jakob Stoklund Olesen stoklund at 2pi.dk
Mon Jan 16 23:01:39 PST 2012


On Jan 16, 2012, at 10:55 PM, Nick Lewycky wrote:

>> Please deal with overflow correctly, and scale the new weights to fit in 32 bits. Then you don't need the GCD stuff either.
>> 
>> Branch weights could be actual execution counts, and we don't require them to be scaled down to small integers. The full 32-bit range should be well supported.
>> 
>> I was sure Jakub had written code just like this, but I can't find it now.
> 
> Does the sum of the weights need to fit in 32 bits, or just the weights themselves?

I am surprised that isn't documented. IIRC, the sum of weights should fit in 32 bits.

/jakob





More information about the llvm-commits mailing list