1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 18:54:02 +01:00
llvm-mirror/lib
Reid Kleckner c18c30409c [PGO] Don't reference functions unless value profiling is enabled
This reduces the size of chrome.dll.pdb built with optimizations,
coverage, and line table info from 4,690,210,816 to 2,181,128,192, which
makes it possible to fit under the 4GB limit.

This change can greatly reduce binary size in coverage builds, which do
not need value profiling. IR PGO builds are unaffected. There is a minor
behavior change for frontend PGO.

PGO and coverage both use InstrProfiling to create profile data with
counters. PGO records the address of each function in the __profd_
global. It is used later to map runtime function pointer values back to
source-level function names. Coverage does not appear to use this
information.

Recording the address of every function with code coverage drastically
increases code size. Consider this program:

  void foo();
  void bar();
  inline void inlineMe(int x) {
    if (x > 0)
      foo();
    else
      bar();
  }
  int getVal();
  int main() { inlineMe(getVal()); }

With code coverage, the InstrProfiling pass runs before inlining, and it
captures the address of inlineMe in the __profd_ global. This greatly
increases code size, because now the compiler can no longer delete
trivial code.

One downside to this approach is that users of frontend PGO must apply
the -mllvm -enable-value-profiling flag globally in TUs that enable PGO.
Otherwise, some inline virtual method addresses may not be recorded and
will not be able to be promoted. My assumption is that this mllvm flag
is not popular, and most frontend PGO users don't enable it.

Differential Revision: https://reviews.llvm.org/D102818
2021-05-20 11:09:24 -07:00
..
Analysis [ScalarEvolution] Remove unused ExitLimit::hasOperand() method (NFC) 2021-05-19 18:42:14 +02:00
AsmParser [OpaquePtr] Make atomicrmw work with opaque pointers 2021-05-19 12:49:28 -07:00
BinaryFormat
Bitcode [IR][AutoUpgrade] Drop alignment from non-pointer parameters and returns 2021-05-20 09:54:38 -07:00
Bitstream
CodeGen [RISCV] Ensure shuffle splat operands are type-legal 2021-05-20 18:00:03 +01:00
DebugInfo Add support for DWARF embedded source to llvm-symbolizer. 2021-05-20 21:40:28 +04:00
Demangle [Demangle][Rust] Speculative fix for bot build failure 2021-05-19 00:40:24 +02:00
DWARFLinker [MC] Untangle MCContext and MCObjectFileInfo 2021-05-05 10:03:02 -07:00
ExecutionEngine [RuntimeDyld] Add allowStubs/allowZeroSyms 2021-05-18 11:35:27 -07:00
Extensions
FileCheck
Frontend [OpenMP][MLIR]Add support for guided, auto and runtime scheduling 2021-05-10 09:18:52 +00:00
Fuzzer
FuzzMutate
InterfaceStub
IR [IR][AutoUpgrade] Drop alignment from non-pointer parameters and returns 2021-05-20 09:54:38 -07:00
IRReader
LineEditor
Linker
LTO [SampleFDO] New hierarchical discriminator for Flow Sensitive SampleFDO 2021-05-18 16:23:43 -07:00
MC [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
MCA [MCA][RegisterFile] Refactor the move elimination logic to address PR50258. 2021-05-08 18:10:35 +01:00
Object [WebAssembly] Fix PIC/GOT codegen for wasm64 2021-05-20 09:59:31 -07:00
ObjectYAML [AMDGPU] Add gfx1034 target 2021-05-13 14:25:18 -04:00
Option
Passes [NewPM] Add options to PrintPassInstrumentation 2021-05-18 20:59:35 -07:00
ProfileData [CoverageMapping] Handle gaps in counter IDs for source-based coverage 2021-05-19 10:46:38 -07:00
Remarks
Support [AMDGPU] Add gfx1034 target 2021-05-13 14:25:18 -04:00
TableGen [TableGen] Make the NUL character invalid in .td files 2021-05-13 10:17:45 -04:00
Target [X86][Atom] Fix vector fadd/fcmp/fmul resource/throughputs 2021-05-20 18:56:58 +01:00
Testing
TextAPI [TextAPI] Reformat llvm_unreachable message 2021-05-11 09:59:26 -07:00
ToolDrivers
Transforms [PGO] Don't reference functions unless value profiling is enabled 2021-05-20 11:09:24 -07:00
WindowsManifest
XRay
CMakeLists.txt