[PATCH] D11605: [LoopUnswitch] Add block frequency analysis to recognize hot/cold regions

Chen Li meloli87 at gmail.com
Wed Jul 29 12:02:56 PDT 2015


chenli created this revision.
chenli added reviewers: reames, broune.
chenli added a subscriber: llvm-commits.

This patch adds block frequency analysis to LoopUnswitch pass to recognize hot/cold regions. For cold regions the pass only performs trivial unswitches since they do not increase code size, and for hot regions everything works as before. This helps to minimize code growth in cold regions and be more aggressive in hot regions. Currently the default cold regions are blocks with frequencies below 20% of function entry frequency, and it can be adjusted via -loop-unswitch-cold-block-frequency flag. The entire feature is controlled via -loop-unswitch-with-block-frequency flag and it is off by default.

http://reviews.llvm.org/D11605

Files:
  lib/Transforms/Scalar/LoopUnswitch.cpp
  test/Transforms/LoopUnswitch/cold-loop.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11605.30937.patch
Type: text/x-patch
Size: 5113 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150729/4fecf091/attachment.bin>


More information about the llvm-commits mailing list