With PGO information, we can do more aggressive outlining of cold regions in the...
authorGraham Yiu <gyiu@ca.ibm.com>
Thu, 30 Nov 2017 02:41:36 +0000 (02:41 +0000)
committerGraham Yiu <gyiu@ca.ibm.com>
Thu, 30 Nov 2017 02:41:36 +0000 (02:41 +0000)
commit8b1882c186747f53fcb0a653473342acbfd0c273
treed20230309aa3cca6dd41fadeed0edc6a3780a45c
parent954cfd56c7fa8497ba4248c9c8a0f85307fce774
With PGO information, we can do more aggressive outlining of cold regions in the inline candidate function. This contrasts with the scheme of keeping only the 'early return' portion of the inline candidate and outlining the rest of the function as a single function call.

Support for outlining multiple regions of each function is added, as well as some basic heuristics to determine which regions are good to outline. Outline candidates limited to regions that are single-entry & single-exit. We also avoid outlining regions that produce live-exit variables, which may inhibit some forms of code motion (like commoning).

Fallback to the regular partial inlining scheme is retained when either i) no regions are identified for outlining in the function, or ii) the outlined function could not be inlined in any of its callers.

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

llvm-svn: 319398
llvm/include/llvm/Analysis/ProfileSummaryInfo.h
llvm/lib/Transforms/IPO/PartialInlining.cpp