llvm-project/clang/test
Rahman Lavaee 7841e21c98 Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols.
This patch introduces the new .bb_addr_map section feature which allows us to emit the bits needed for mapping binary profiles to basic blocks into a separate section.
The format of the emitted data is represented as follows. It includes a header for every function:

|  Address of the function                      |  -> 8 bytes (pointer size)
|  Number of basic blocks in this function (>0) |  -> ULEB128

The header is followed by a BB record for every basic block. These records are ordered in the same order as MachineBasicBlocks are placed in the function. Each BB Info is structured as follows:

|  Offset of the basic block relative to function begin |  -> ULEB128
|  Binary size of the basic block                       |  -> ULEB128
|  BB metadata                                          |  -> ULEB128  [ MBB.isReturn() OR MBB.hasTailCall() << 1  OR  MBB.isEHPad() << 2 ]

The new feature will replace the existing "BB labels" functionality with -basic-block-sections=labels.
The .bb_addr_map section scrubs the specially-encoded BB symbols from the binary and makes it friendly to profilers and debuggers.
Furthermore, the new feature reduces the binary size overhead from 70% bloat to only 12%.

For more information and results please refer to the RFC: https://lists.llvm.org/pipermail/llvm-dev/2020-July/143512.html

Reviewed By: MaskRay, snehasish

Differential Revision: https://reviews.llvm.org/D85408
2020-09-14 10:16:44 -07:00
..
ARCMT
AST [AST][FPEnv] Keep FP options in trailing storage of CastExpr 2020-09-14 12:15:21 +07:00
ASTMerge
Analysis [analyzer][z3] Use more elaborate Z3 variable names 2020-09-14 08:43:56 +02:00
CXX Revert "Canonicalize declaration pointers when forming APValues." 2020-09-04 10:13:28 -04:00
ClangScanDeps
CodeCompletion [clang] Make signature help work with dependent args 2020-08-17 10:06:36 +02:00
CodeGen Let -basic-block-sections=labels emit basicblock metadata in a new .bb_addr_map section, instead of emitting special unary-encoded symbols. 2020-09-14 10:16:44 -07:00
CodeGenCUDA Revert "[HIP] Change default --gpu-max-threads-per-block value to 1024" 2020-09-02 16:12:28 -04:00
CodeGenCXX [Clang] Add option to allow marking pass-by-value args as noalias. 2020-09-12 14:56:13 +01:00
CodeGenCoroutines [Coroutine][Sema] Tighten the lifetime of symmetric transfer returned handle 2020-09-11 13:35:37 -07:00
CodeGenHIP [NFC] Fixed ignored .hip test. 2020-06-29 18:57:14 +03:00
CodeGenObjC [Clang] Add option to allow marking pass-by-value args as noalias. 2020-09-12 14:56:13 +01:00
CodeGenObjCXX Re-enable "[InstCombine] Simplify boolean Phis with const inputs using CFG" 2020-07-16 16:09:08 +07:00
CodeGenOpenCL clang: Use byref for aggregate kernel arguments 2020-08-06 15:52:26 -04:00
CodeGenOpenCLCXX
CodeGenSYCL
Coverage
CoverageMapping Revert "[Coverage] Enable emitting gap area between macros" 2020-08-25 15:28:42 -07:00
Driver [lld][WebAssembly] Error on import/export of mutable global without `mutable-globals` feature 2020-09-12 14:28:14 -07:00
FixIt
Format [clang-format] Add a test showing the current config file list parsing 2020-09-04 16:57:46 +01:00
Frontend Set alignment of .llvmbc and .llvmcmd to 1 2020-08-29 18:27:34 -07:00
Headers [WebAssembly] Fix types in wasm_simd128.h and add tests 2020-08-05 14:00:01 -07:00
Import [clang] Rework how and when APValues are dumped 2020-07-06 22:03:08 +01:00
Index [clang] Do not consider the template arguments of bases to be bases themselves 2020-09-01 19:18:03 -04:00
Integration
InterfaceStubs [llvm-readobj] Update tests because of changes in llvm-readobj behavior 2020-07-20 10:39:04 +01:00
Layout [AIX] Implement AIX special alignment rule about double/long double 2020-07-27 15:13:03 -04:00
Lexer [SystemZ][z/OS] enable trigraphs by default on z/OS 2020-08-13 16:02:07 -04:00
Misc Sema: add support for `__attribute__((__swift_objc_members__))` 2020-09-14 15:24:41 +00:00
Modules [X86] Default to -mtune=generic unless -march is passed to the driver. Add TuneCPU to the AST serialization 2020-08-26 14:52:03 -07:00
OpenMP Reland [AssumeBundles] Use operand bundles to encode alignment assumptions 2020-09-12 15:36:06 +02:00
PCH Set InvalidDecl directly when deserializing a Decl 2020-09-05 14:26:43 +02:00
Parser [FPEnv] Partially implement #pragma STDC FENV_ROUND 2020-09-04 16:47:10 +07:00
ParserSYCL
Preprocessor [clang][Sparc] Default to -mcpu=v9 for Sparc V8 on Solaris 2020-09-11 09:53:19 +02:00
Profile [PGO] Include the mem ops into the function hash. 2020-07-30 09:26:20 -07:00
Refactor
Rewriter
Sema Implements [[likely]] and [[unlikely]] in IfStmt. 2020-09-09 20:48:37 +02:00
SemaCUDA recommit 4fc752b30b [CUDA][HIP] Always defer diagnostics for wrong-sided reference 2020-07-17 09:14:39 -04:00
SemaCXX Implements [[likely]] and [[unlikely]] in IfStmt. 2020-09-09 20:48:37 +02:00
SemaObjC Sema: add support for `__attribute__((__swift_objc_members__))` 2020-09-14 15:24:41 +00:00
SemaObjCXX Clang crashed while checking for deletion of copy and move ctors 2020-07-07 14:40:37 -04:00
SemaOpenCL [OpenCL] Add global_device and global_host address spaces 2020-07-29 17:24:53 +03:00
SemaOpenCLCXX [OpenCL] Fixed missing address space for templated copy constructor. 2020-07-27 15:18:49 +01:00
SemaSYCL
SemaTemplate PR37556: Don't diagnose conflicts between instantiated unqualified 2020-08-24 23:26:15 -07:00
TableGen
Templight
Tooling [clang] Rework how and when APValues are dumped 2020-07-06 22:03:08 +01:00
Unit
VFS
clang-rename
utils/update_cc_test_checks [UpdateTestChecks] include { in function signature check line 2020-08-28 23:44:03 +02:00
.clang-format [clang] Partially revert "Disable a few formatting options for test/" 2020-07-21 14:53:37 +01:00
CMakeLists.txt Revert "Re-Re-land: [CodeView] Add full repro to LF_BUILDINFO record" 2020-08-17 15:49:18 -04:00
TestRunner.sh
cxx-sections.data
lit.cfg.py Reland [Coverage] Add comment to skipped regions 2020-07-28 13:20:57 -07:00
lit.site.cfg.py.in [CMake] Simplify CMake handling for zlib 2020-08-11 20:22:11 -07:00
make_test_dirs.pl