llvm-project/llvm/test/Analysis/BlockFrequencyInfo
Cong Hou 15ea016346 Use fixed-point representation for BranchProbability.
BranchProbability now is represented by its numerator and denominator in uint32_t type. This patch changes this representation into a fixed point that is represented by the numerator in uint32_t type and a constant denominator 1<<31. This is quite similar to the representation of BlockMass in BlockFrequencyInfoImpl.h. There are several pros and cons of this change:

Pros:

1. It uses only a half space of the current one.
2. Some operations are much faster like plus, subtraction, comparison, and scaling by an integer.

Cons:

1. Constructing a probability using arbitrary numerator and denominator needs additional calculations.
2. It is a little less precise than before as we use a fixed denominator. For example, 1 - 1/3 may not be exactly identical to 1 / 3 (this will lead to many BranchProbability unit test failures). This should not matter when we only use it for branch probability. If we use it like a rational value for some precise calculations we may need another construct like ValueRatio.

One important reason for this change is that we propose to store branch probabilities instead of edge weights in MachineBasicBlock. We also want clients to use probability instead of weight when adding successors to a MBB. The current BranchProbability has more space which may be a concern.

Differential revision: http://reviews.llvm.org/D12603

llvm-svn: 248633
2015-09-25 23:09:59 +00:00
..
bad_input.ll Remove 4,096 loop scale limitation. 2015-04-01 17:42:27 +00:00
basic.ll Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
double_backedge.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
double_exit.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
extremely-likely-loop-successor.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
irreducible.ll Add documentation for new backedge mass propagation in irregular loops. 2015-06-17 16:28:22 +00:00
irreducible_loop_crash.ll Fix PR 24723 - Handle 0-mass backedges in irreducible loops 2015-09-08 19:22:17 +00:00
loop_with_branch.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00
loops_with_profile_info.ll Use fixed-point representation for BranchProbability. 2015-09-25 23:09:59 +00:00
nested_loop_with_branches.ll IR: Make metadata typeless in assembly 2014-12-15 19:07:53 +00:00