OSDN Git Service

[HotColdSplitting] Refine definition of unlikelyExecuted
authorVedant Kumar <vsk@apple.com>
Fri, 7 Dec 2018 20:24:04 +0000 (20:24 +0000)
committerVedant Kumar <vsk@apple.com>
Fri, 7 Dec 2018 20:24:04 +0000 (20:24 +0000)
commitd0e8089e646a7254aa3e4e00cdc016f29d73678a
treea4377dea21c17704b494bb33091efa511b053707
parentb7c4b42cc3b3061be8ca3ee105a32e0fc0425d1d
[HotColdSplitting] Refine definition of unlikelyExecuted

The splitting pass uses its 'unlikelyExecuted' predicate to statically
decide which blocks are cold.

- Do not treat noreturn calls as if they are cold unless they are actually
  marked cold. This is motivated by functions like exit() and longjmp(), which
  are not beneficial to outline.

- Do not treat inline asm as an outlining barrier. In practice asm("") is
  frequently used to inhibit basic block merging; enabling outlining in this case
  results in substantial memory savings.

- Treat invokes of cold functions as cold.

As a drive-by, remove the 'exceptionHandlingFunctions' predicate, because it's
no longer needed. The pass can identify & outline blocks dominated by EH pads,
so there's no need to special-case __cxa_begin_catch etc.

Differential Revision: https://reviews.llvm.org/D54244

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@348640 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/IPO/HotColdSplitting.cpp
test/Transforms/HotColdSplit/eh-pads.ll
test/Transforms/HotColdSplit/noreturn.ll [new file with mode: 0644]
test/Transforms/HotColdSplit/outline-cold-asm.ll [new file with mode: 0644]