#
dcba0771 |
| 12-Jan-2024 |
Amir Ayupov <aaupov@fb.com> |
[BOLT] Embed cold mapping info into function entry in BAT (#76903)
Reduces BAT section size:
- large binary: to 12283500 bytes (0.32x original size),
- medium binary: to 1616020 bytes (0.27x origi
[BOLT] Embed cold mapping info into function entry in BAT (#76903)
Reduces BAT section size:
- large binary: to 12283500 bytes (0.32x original size),
- medium binary: to 1616020 bytes (0.27x original size),
- small binary: to 404 bytes (0.28x original size).
Test Plan: Updated bolt/test/X86/bolt-address-translation.test
show more ...
|
#
8fb8ad66 |
| 11-Jan-2024 |
Amir Ayupov <aaupov@fb.com> |
[BOLT] Delta-encode function start addresses in BAT (#76902)
Further reduce the size of BAT section:
- large binary: to 12716312 bytes (0.33x original),
- medium binary: to 1649472 bytes (0.28x or
[BOLT] Delta-encode function start addresses in BAT (#76902)
Further reduce the size of BAT section:
- large binary: to 12716312 bytes (0.33x original),
- medium binary: to 1649472 bytes (0.28x original),
- small binary: to 428 bytes (0.30x original).
Test Plan: Updated bolt/test/X86/bolt-address-translation.test
show more ...
|
#
bbe07989 |
| 11-Jan-2024 |
Amir Ayupov <aaupov@fb.com> |
[BOLT] Delta-encode offsets in BAT (#76900)
This change further reduces the size of BAT:
- large binary: to 13073904 bytes (0.34x original),
- medium binary: to 1703116 bytes (0.29x original),
-
[BOLT] Delta-encode offsets in BAT (#76900)
This change further reduces the size of BAT:
- large binary: to 13073904 bytes (0.34x original),
- medium binary: to 1703116 bytes (0.29x original),
- small binary: to 436 bytes (0.30x original).
Test Plan: Updated bolt/test/X86/bolt-address-translation.test
show more ...
|
#
565f40d6 |
| 21-Dec-2023 |
Amir Ayupov <aaupov@fb.com> |
[BOLT] Encode BAT using ULEB128 (#76899)
Reduces BAT section size, bytes: - large binary: 38676872 -> 23262524 (0.60x), - medium binary (trunk clang): 5938004 -> 3213504 (0.54x), - small binary (X86
[BOLT] Encode BAT using ULEB128 (#76899)
Reduces BAT section size, bytes: - large binary: 38676872 -> 23262524 (0.60x), - medium binary (trunk clang): 5938004 -> 3213504 (0.54x), - small binary (X86/bolt-address-translation.test): 1436 -> 680 (0.47x).
Test Plan: Updated bolt/test/X86/bolt-address-translation.test
show more ...
|
#
23c8d382 |
| 21-Aug-2023 |
Job Noorman <jnoorman@igalia.com> |
[BOLT] Calculate input to output address map using BOLTLinker
BOLT uses MCAsmLayout to calculate the output values of basic blocks. This means output values are calculated based on a pre-linking sta
[BOLT] Calculate input to output address map using BOLTLinker
BOLT uses MCAsmLayout to calculate the output values of basic blocks. This means output values are calculated based on a pre-linking state and any changes to symbol values during linking will cause incorrect values to be used.
This issue was first addressed in D154604 by adding all basic block symbols to the symbol table for the linker to resolve them. However, the runtime overhead of handling this huge symbol table turned out to be prohibitively large.
This patch solves the issue in a different way. First, a temporary section containing [input address, output symbol] pairs is emitted to the intermediary object file. The linker will resolve all these references so we end up with a section of [input address, output address] pairs. This section is then parsed and used to: - Replace BinaryBasicBlock::OffsetTranslationTable - Replace BinaryFunction::InputOffsetToAddressMap - Update BinaryBasicBlock::OutputAddressRange
Note that the reason this is more performant than the previous attempt is that these symbol references do not cause entries to be added to the symbol table. Instead, section-relative references are used for the relocations.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D155604
show more ...
|
#
3d573fdb |
| 11-Dec-2022 |
Amir Ayupov <aaupov@fb.com> |
[BOLT][NFC] Use std::optional in BAT
|
#
e324a80f |
| 03-Dec-2022 |
Kazu Hirata <kazu@google.com> |
[BOLT] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of ma
[BOLT] Use std::nullopt instead of None (NFC)
This patch mechanically replaces None with std::nullopt where the compiler would warn if None were deprecated. The intent is to reduce the amount of manual work required in migrating from Optional to std::optional.
This is part of an effort to migrate from llvm::Optional to std::optional:
https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
show more ...
|
#
1fa870b1 |
| 20-Nov-2022 |
Kazu Hirata <kazu@google.com> |
Use None consistently (NFC)
This patch replaces NoneType() and NoneType::None with None in preparation for migration from llvm::Optional to std::optional.
In the std::optional world, we are not gur
Use None consistently (NFC)
This patch replaces NoneType() and NoneType::None with None in preparation for migration from llvm::Optional to std::optional.
In the std::optional world, we are not guranteed to be able to default-construct std::nullopt_t or peek what's inside it, so neither NoneType() nor NoneType::None has a corresponding expression in the std::optional world.
Once we consistently use None, we should even be able to replace the contents of llvm/include/llvm/ADT/None.h with something like:
using NoneType = std::nullopt_t; inline constexpr std::nullopt_t None = std::nullopt;
to ease the migration from llvm::Optional to std::optional.
Differential Revision: https://reviews.llvm.org/D138376
show more ...
|
#
9b6e7861 |
| 25-Aug-2022 |
Fabian Parzefall <parzefall@fb.com> |
[BOLT] Track fragment info for all split fragments
To generate all symbols correctly, it is necessary to record the address of each fragment. This patch moves the address info for the main and cold
[BOLT] Track fragment info for all split fragments
To generate all symbols correctly, it is necessary to record the address of each fragment. This patch moves the address info for the main and cold fragments from BinaryFunction to FunctionFragment, where this data is recorded for all fragments.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D132051
show more ...
|
#
6304e382 |
| 24-Aug-2022 |
Fabian Parzefall <parzefall@fb.com> |
Revert "[BOLT] Track fragment info for all split fragments"
This reverts commit 7e254818e49454a53bd00e3737007025b62d0f79.
|
#
7e254818 |
| 24-Aug-2022 |
Fabian Parzefall <parzefall@fb.com> |
[BOLT] Track fragment info for all split fragments
To generate all symbols correctly, it is necessary to record the address of each fragment. This patch moves the address info for the main and cold
[BOLT] Track fragment info for all split fragments
To generate all symbols correctly, it is necessary to record the address of each fragment. This patch moves the address info for the main and cold fragments from BinaryFunction to FunctionFragment, where this data is recorded for all fragments.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D132051
show more ...
|
#
fc0ced73 |
| 06-Jul-2022 |
Rafael Auler <rafaelauler@fb.com> |
Add BAT testing framework
This patch refactors BAT to be testable as a library, so we can have open-source tests on it. This further fixes an issue with basic blocks that lack a valid input offset,
Add BAT testing framework
This patch refactors BAT to be testable as a library, so we can have open-source tests on it. This further fixes an issue with basic blocks that lack a valid input offset, making BAT omit those when writing translation tables.
Test Plan: new testcases added, new testing tool added (llvm-bat-dump)
Differential Revision: https://reviews.llvm.org/D129382
show more ...
|
#
8477bc67 |
| 17-Jul-2022 |
Fabian Parzefall <parzefall@fb.com> |
[BOLT] Add function layout class
This patch adds a dedicated class to keep track of each function's layout. It also lays the groundwork for splitting functions into multiple fragments (as opposed to
[BOLT] Add function layout class
This patch adds a dedicated class to keep track of each function's layout. It also lays the groundwork for splitting functions into multiple fragments (as opposed to a strict hot/cold split).
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D129518
show more ...
|
#
def464aa |
| 29-Dec-2021 |
Amir Ayupov <aaupov@fb.com> |
[BOLT][NFC] Fix braces usage in Profile
Summary: Refactor bolt/*/Profile to follow the braces rule for if/else/loop from [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).
(cherry
[BOLT][NFC] Fix braces usage in Profile
Summary: Refactor bolt/*/Profile to follow the braces rule for if/else/loop from [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).
(cherry picked from FBD33345741)
show more ...
|
#
2f09f445 |
| 21-Dec-2021 |
Maksim Panchenko <maks@fb.com> |
[BOLT][NFC] Fix file-description comments
Summary: Fix comments at the start of source files.
(cherry picked from FBD33274597)
|
#
40c2e0fa |
| 15-Dec-2021 |
Maksim Panchenko <maks@fb.com> |
[BOLT][NFC] Reformat with clang-format
Summary: Selectively apply clang-format to BOLT code base.
(cherry picked from FBD33119052)
|
#
a34c753f |
| 08-Oct-2021 |
Rafael Auler <rafaelauler@fb.com> |
Rebase: [NFC] Refactor sources to be buildable in shared mode
Summary: Moves source files into separate components, and make explicit component dependency on each other, so LLVM build system knows h
Rebase: [NFC] Refactor sources to be buildable in shared mode
Summary: Moves source files into separate components, and make explicit component dependency on each other, so LLVM build system knows how to build BOLT in BUILD_SHARED_LIBS=ON.
Please use the -c merge.renamelimit=230 git option when rebasing your work on top of this change.
To achieve this, we create a new library to hold core IR files (most classes beginning with Binary in their names), a new library to hold Utils, some command line options shared across both RewriteInstance and core IR files, a new library called Rewrite to hold most classes concerned with running top-level functions coordinating the binary rewriting process, and a new library called Profile to hold classes dealing with profile reading and writing.
To remove the dependency from BinaryContext into X86-specific classes, we do some refactoring on the BinaryContext constructor to receive a reference to the specific backend directly from RewriteInstance. Then, the dependency on X86 or AArch64-specific classes is transfered to the Rewrite library. We can't have the Core library depend on targets because targets depend on Core (which would create a cycle).
Files implementing the entry point of a tool are transferred to the tools/ folder. All header files are transferred to the include/ folder. The src/ folder was renamed to lib/.
(cherry picked from FBD32746834)
show more ...
|