[PATCH] D11442: Provide an interface normalizeSuccWeights in MachineBasicBlock to normalize its successors' weights and use it in other places.

Cong Hou congh at google.com
Wed Jul 29 15:16:50 PDT 2015


congh retitled this revision from "Create a utility function normalizeEdgeWeights() in BranchProbabilityInfo that is used to normalize a list of weights so that the sum of them does not exceed UINT32_MAX." to "Provide an interface normalizeSuccWeights in MachineBasicBlock to normalize its successors' weights and use it in other places.".
congh added a reviewer: chandlerc.
congh updated this revision to Diff 30953.
congh added a comment.

Several updates:

1. Move normalizeEdgeWeights() from BranchProbabilityInfo to MachineBranchProbabilityInfo.
2. Provide an interface in MachineBasicBlock to normalize its successors' weights.
3. Add a flag int 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.


http://reviews.llvm.org/D11442

Files:
  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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11442.30953.patch
Type: text/x-patch
Size: 11926 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/9f96eab0/attachment.bin>


More information about the llvm-commits mailing list