[llvm] r184590 - Revert "BlockFrequency: Saturate at 1 instead of 0 when multiplying a frequency with a branch probability."

Chandler Carruth chandlerc at google.com
Mon Jun 24 15:38:59 PDT 2013


On Mon, Jun 24, 2013 at 3:29 PM, Jakob Stoklund Olesen <stoklund at 2pi.dk>wrote:

> I am proposing that we use a number representation with non-sticky
> saturation in both ends of the representable range. We already have that in
> the high end: Calculations saturate at UINT64_MAX, but unlike IEEE
> infinity, they don’t stay saturated when multiplied by fractions < 1.
>
> We need the same behavior at the low end: Saturate to 1 instead of 0. This
> limit is non-sticky so multiplying it by a fraction > 1 can still give you
> a larger number.
>

I think the problem is that we end up saturating at 1 *a lot* in highly
branchy situations (think large switches, or nested large switches), and
then the summing behavior that happens at merge points introduces really
problematic artifacts. Whatever scheme we end up with, the key (to me) is
making the merge points not introduce distortion into the frequency graph.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130624/e2d2e6bb/attachment.html>


More information about the llvm-commits mailing list