[PATCH] D54244: [HotColdSplitting] Refine definition of unlikelyExecuted

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 7 17:14:13 PST 2018


vsk created this revision.
vsk added reviewers: sebpop, hiraditya, junbuml.
vsk edited the summary of this revision.

The splitting pass uses its 'unlikelyExecuted' predicate to statically
decide which blocks are cold. This patch makes two changes to it:

- 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. Mark @llvm.trap cold to compensate.

- 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.

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 certain
__cxa_begin_catch etc.


https://reviews.llvm.org/D54244

Files:
  llvm/docs/LangRef.rst
  llvm/include/llvm/IR/Intrinsics.td
  llvm/lib/Transforms/IPO/HotColdSplitting.cpp
  llvm/test/Feature/intrinsics.ll
  llvm/test/Transforms/HotColdSplit/noreturn.ll
  llvm/test/Transforms/HotColdSplit/outline-cold-asm.ll
  llvm/test/Transforms/SimplifyCFG/switch-on-const-select.ll
  llvm/utils/TableGen/CodeGenIntrinsics.h
  llvm/utils/TableGen/CodeGenTarget.cpp
  llvm/utils/TableGen/IntrinsicEmitter.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54244.173094.patch
Type: text/x-patch
Size: 8748 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181108/035c4628/attachment.bin>


More information about the llvm-commits mailing list