OSDN Git Service

Record whether the weights on out-edges from a MBB are normalized.
authorCong Hou <congh@google.com>
Wed, 5 Aug 2015 22:01:20 +0000 (22:01 +0000)
committerCong Hou <congh@google.com>
Wed, 5 Aug 2015 22:01:20 +0000 (22:01 +0000)
commit3f81410d8cebd10248c2201c701ae8308a0ca2d8
tree6aee41a96ac50a9512f112e1503e46eddf41206d
parent71414244472d8b14a0dd3b07a4b71fa449b13189
Record whether the weights on out-edges from a MBB are normalized.

1. Create a utility function normalizeEdgeWeights() in MachineBranchProbabilityInfo that normalizes a list of edge weights so that the sum of then can fit in uint32_t.
2. Provide an interface in MachineBasicBlock to normalize its successors' weights.
3. Add a flag in MachineBasicBlock that tracks whether its successors' weights are normalized.
4. Provide an overload of getSumForBlock that accepts a non-const pointer to a MBB so that it can force normalizing this MBB's successors' weights.
5. Update several uses of getSumForBlock() by eliminating the once needed weight scale.

Differential Revision: http://reviews.llvm.org/D11442

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@244154 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineBasicBlock.h
include/llvm/CodeGen/MachineBranchProbabilityInfo.h
lib/CodeGen/IfConversion.cpp
lib/CodeGen/MachineBasicBlock.cpp
lib/CodeGen/MachineBlockPlacement.cpp
lib/CodeGen/MachineBranchProbabilityInfo.cpp