[PATCH] D63676: Early exit from Hoist() in machine licm pass based on block hotness

Victor Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 15 15:42:57 PDT 2019


NeHuang added a comment.

Thanks @efriedma for the review and remind.

This patch adds an option to disable non-profitable hoisting from a cold to a hot basic block.

The stats below is collected based on Google benchmark. (The 3rd column indicates number of hoisting is disabled due to block frequency hotness, results varies from the loads of different benchmarks)

| Benchmark | Number of machine instructions hoisted out of loops | Number of instructions not hoisted due to block frequency hotness |
| Protobuf  | 20931                                               | 1706                                                              |
| Brotli    | 9935                                                | 17616                                                             |
| Gipfeli   | 471                                                 | 879                                                               |
| snappy    | 886                                                 | 1154                                                              |
| TCMalloc  | 6435                                                | 891                                                               |
| BoringSSL | 6115                                                | 501                                                               |
| FFMPEG    | 8324                                                | 17                                                                |
|

With the patch enabled, we found SPEC performance improvement, e.g. perlbench speeding up by 2.5%.

'100' is the block-freq-ratio-threshold used in our experiment to determine when to disable the hoisting, which is a configurable option.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D63676/new/

https://reviews.llvm.org/D63676





More information about the llvm-commits mailing list