[PATCH] Remove 4,096 loop scale limitation.

Diego Novillo dnovillo at google.com
Tue Mar 31 05:07:52 PDT 2015


Hi dexonsmith,

This is part 1 of fixes to address the problems described in
https://llvm.org/bugs/show_bug.cgi?id=22719.

The restriction to limit loop scales to 4,096 does not really prevent
overflows anymore, as the underlying algorithm has changed and does
not seem to suffer from this problem.

Additionally, artificially restricting loop scales to such a low number
skews frequency information, making loops of equal hotness appear to
have very different hotness properties.

The only loops that are artificially restricted to a scale of 4096 are
infinite loops (those loops with an exit mass of 0). This prevents
infinite loops from skewing the frequencies of other regions in the CFG.

At the end of propagation, frequencies are scaled to values that take no
more than 32 bits to represent. This is to prevent issues with
transformations that cannot deal with large numbers.

Tested on x86_64.

http://reviews.llvm.org/D8718

Files:
  include/llvm/Analysis/BlockFrequencyInfoImpl.h
  lib/Analysis/BlockFrequencyInfoImpl.cpp
  test/Analysis/BlockFrequencyInfo/bad_input.ll
  test/Analysis/BlockFrequencyInfo/loops_with_profile_info.ll

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8718.22939.patch
Type: text/x-patch
Size: 11372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150331/4f97c1a9/attachment.bin>


More information about the llvm-commits mailing list