OSDN Git Service

PGO branch weight: keep halving the weights until they can fit into
authorManman Ren <manman.ren@gmail.com>
Mon, 27 Jan 2014 23:39:03 +0000 (23:39 +0000)
committerManman Ren <manman.ren@gmail.com>
Mon, 27 Jan 2014 23:39:03 +0000 (23:39 +0000)
commitaa6627016ff797a0b206791d170aa7e677096553
tree47bfb0fdea769fcb8932872907583e0f83e7877e
parent01df6842c1e8890d8f529683ed6d6e7b6bb172d8
PGO branch weight: keep halving the weights until they can fit into
uint32.

When folding branches to common destination, the updated branch weights
can exceed uint32 by more than factor of 2. We should keep halving the
weights until they can fit into uint32.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200262 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/preserve-branchweights.ll