1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-23 04:52:54 +02:00
llvm-mirror/test
Dehao Chen 0f5497429b Implement callsite-hotness based inline cost for Sample-based PGO
Summary:
For sample-based PGO, using BFI to calculate callsite count is sometime not accurate. This is because with sampling based approach, if a callsite resides in a hot loop deeply nested in a bunch of cold branches, the callsite's BFI frequency would be inaccurately calculated due to lack of samples in the cold branch.

E.g.

if (A1 && A2 && A3 && ..... && A10) {
  for (i=0; i < 100000000; i++) {
    callsite();
  }
}

Assume that A1 to A100 are all 100% taken, and callsite has 1000 samples and thus is considerred hot. Because the loop's trip count is huge, it's normal that all branches outside the loop has no sample at all. As a result, we can only use static branch probability to derive the the frequency of the loop header. Assuming that static heuristic thinks each branch is 50% taken, then the count calculated from BFI will be 1/(2^10) of the actual value.

In order to get more accurate callsite count, we directly annotate the weight on the call instruction, and directly use it when checking callsite hotness.

Note that this mechanism can also be shared by instrumentation based callsite hotness analysis. The side benefit is that it breaks the dependency from Inliner to BFI as call count is embedded in the IR.

Reviewers: davidxl, eraman, dnovillo

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D22118

llvm-svn: 275073
2016-07-11 16:48:54 +00:00
..
Analysis Teach isDereferenceablePointer to look through returned-argument functions 2016-07-11 03:08:49 +00:00
Assembler [codeview] Add DISubprogram::ThisAdjustment 2016-07-01 02:41:21 +00:00
Bindings Add writeonly IR attribute 2016-07-04 08:01:29 +00:00
Bitcode Add writeonly IR attribute 2016-07-04 08:01:29 +00:00
BugPoint
CodeGen [x86] make some of the tests 256-bit for testing diversity 2016-07-11 15:08:37 +00:00
DebugInfo [COFF, Dwarf] Don't emit DW_AT_location for dllimported entities 2016-07-09 20:47:48 +00:00
Examples
ExecutionEngine ExecutionEngine: add preliminary support for COFF ARM 2016-06-24 14:11:44 +00:00
Feature Temporarily remove a test case to unblock PPC bots. 2016-07-08 00:35:39 +00:00
FileCheck Make check lines not match themselves. 2016-06-16 19:38:48 +00:00
Instrumentation [tsan] Try harder to not instrument gcov counters 2016-07-07 22:45:28 +00:00
Integer
JitListener
LibDriver
Linker Don't verify inputs to the Linker if ODR merging. 2016-06-29 18:31:48 +00:00
LTO Add writeonly IR attribute 2016-07-04 08:01:29 +00:00
MC Fix branch relaxation in 16-bit mode. 2016-07-11 14:23:53 +00:00
Object Add checks to the MachOObjectFile() constructor to make sure load commands sizes 2016-07-07 22:11:42 +00:00
ObjectYAML [YAML] Fix YAML tags appearing before the start of sequence elements 2016-06-28 21:10:26 +00:00
Other Temporarily remove one test run line to unblock PPC bots. 2016-07-08 00:32:58 +00:00
SymbolRewriter
TableGen tests: accept different TargetOpcode values. 2016-07-07 17:51:42 +00:00
ThinLTO/X86 ThinLTO: Do not take into account whether a definition has multiple copies when promoting. 2016-07-07 18:31:51 +00:00
tools [llvm-cov] Add support for creating html reports 2016-07-06 21:44:05 +00:00
Transforms Implement callsite-hotness based inline cost for Sample-based PGO 2016-07-11 16:48:54 +00:00
Unit
Verifier Add writeonly IR attribute 2016-07-04 08:01:29 +00:00
YAMLParser
.clang-format
CMakeLists.txt [cmake] Fix builds with LLVM_ENABLE_PIC=0 2016-06-02 16:29:07 +00:00
lit.cfg Added REQUIRES to TestingGuide documentation 2016-07-08 23:47:29 +00:00
lit.site.cfg.in
TestRunner.sh