|
Revision tags: llvmorg-20.1.0, llvmorg-20.1.0-rc3, llvmorg-20.1.0-rc2, llvmorg-20.1.0-rc1, llvmorg-21-init, llvmorg-19.1.7, llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4, llvmorg-19.1.3, llvmorg-19.1.2, llvmorg-19.1.1, llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2, llvmorg-19.1.0-rc1, llvmorg-20-init, llvmorg-18.1.8, llvmorg-18.1.7, llvmorg-18.1.6, llvmorg-18.1.5, llvmorg-18.1.4, llvmorg-18.1.3, llvmorg-18.1.2, llvmorg-18.1.1, llvmorg-18.1.0, llvmorg-18.1.0-rc4, llvmorg-18.1.0-rc3, llvmorg-18.1.0-rc2, llvmorg-18.1.0-rc1, llvmorg-19-init, llvmorg-17.0.6, llvmorg-17.0.5, llvmorg-17.0.4, llvmorg-17.0.3, llvmorg-17.0.2, llvmorg-17.0.1, llvmorg-17.0.0, llvmorg-17.0.0-rc4, llvmorg-17.0.0-rc3, llvmorg-17.0.0-rc2, llvmorg-17.0.0-rc1, llvmorg-18-init, llvmorg-16.0.6, llvmorg-16.0.5, llvmorg-16.0.4, llvmorg-16.0.3, llvmorg-16.0.2, llvmorg-16.0.1, llvmorg-16.0.0, llvmorg-16.0.0-rc4, llvmorg-16.0.0-rc3, llvmorg-16.0.0-rc2, llvmorg-16.0.0-rc1, llvmorg-17-init, llvmorg-15.0.7, llvmorg-15.0.6, llvmorg-15.0.5, llvmorg-15.0.4, llvmorg-15.0.3, llvmorg-15.0.2, llvmorg-15.0.1, llvmorg-15.0.0, llvmorg-15.0.0-rc3, llvmorg-15.0.0-rc2, llvmorg-15.0.0-rc1, llvmorg-16-init |
|
| #
05523dc3 |
| 14-Jul-2022 |
Huan Nguyen <[email protected]> |
[BOLT] Support multiple parents for split jump table
There are two assumptions regarding jump table: (a) It is accessed by only one fragment, say, Parent (b) All entries target instructions in Paren
[BOLT] Support multiple parents for split jump table
There are two assumptions regarding jump table: (a) It is accessed by only one fragment, say, Parent (b) All entries target instructions in Parent
For (a), BOLT stores jump table entries as relative offset to Parent. For (b), BOLT treats jump table entries target somewhere out of Parent as INVALID_OFFSET, including fragment of same split function.
In this update, we extend (a) and (b) to include fragment of same split functinon. For (a), we store jump table entries in absolute offset instead. In addition, jump table will store all fragments that access it. A fragment uses this information to only create label for jump table entries that target to that fragment.
For (b), using absolute offset allows jump table entries to target fragments of same split function, i.e., extend support for split jump table. This can be done using relocation (fragment start/size) and fragment detection heuristics (e.g., using symbol name pattern for non-stripped binaries).
For jump table targets that can only be reached by one fragment, we mark them as local label; otherwise, they would be the secondary function entry to the target fragment.
Test Plan ``` ninja check-bolt ```
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D128474
show more ...
|
| #
35efe1d8 |
| 06-Jul-2022 |
Vladislav Khmelevsky <[email protected]> |
[BOLT][AArch64] Handle gold linker veneers
The gold linker veneers are written between functions without symbols, so we to handle it specially in BOLT.
Vladislav Khmelevsky, Advanced Software Techn
[BOLT][AArch64] Handle gold linker veneers
The gold linker veneers are written between functions without symbols, so we to handle it specially in BOLT.
Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D129260
show more ...
|
| #
75641678 |
| 12-Jul-2022 |
Denis Revunov <[email protected]> |
[BOLT][AArch64] Use all supported CPU features on AArch64
Since we now have +all feature for AArch64 disassembler, we can use it in BOLT and allow it to disassemble all ARM instructions supported by
[BOLT][AArch64] Use all supported CPU features on AArch64
Since we now have +all feature for AArch64 disassembler, we can use it in BOLT and allow it to disassemble all ARM instructions supported by LLVM.
Reviewed by: rafauler
Differential Revision: https://reviews.llvm.org/D129139
show more ...
|
| #
e159abdb |
| 30-Jun-2022 |
Alexander Yermolovich <[email protected]> |
[BOLT][DWARF] Support mix mode DWARF
Added support for mixing monolithic DWARF5 with legacy DWARF, and monolithic legacy and DWARF5 split dwarf.
Reviewed By: maksfb
Differential Revision: https://
[BOLT][DWARF] Support mix mode DWARF
Added support for mixing monolithic DWARF5 with legacy DWARF, and monolithic legacy and DWARF5 split dwarf.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D128232
show more ...
|
| #
fc2d96c3 |
| 29-Jun-2022 |
Rafael Auler <[email protected]> |
Revert "[BOLT][AArch64] Handle gold linker veneers"
This reverts commit 425dda76e9fac93117289fd68a2abdfb1e4a0ba5.
This commit is currently causing BOLT to crash in one of our binaries and needs a b
Revert "[BOLT][AArch64] Handle gold linker veneers"
This reverts commit 425dda76e9fac93117289fd68a2abdfb1e4a0ba5.
This commit is currently causing BOLT to crash in one of our binaries and needs a bit more checking to make sure it is safe to land.
show more ...
|
|
Revision tags: llvmorg-14.0.6 |
|
| #
425dda76 |
| 15-Jun-2022 |
Vladislav Khmelevsky <[email protected]> |
[BOLT][AArch64] Handle gold linker veneers
The gold linker veneers are written between functions without symbols, so we to handle it specially in BOLT.
Vladislav Khmelevsky, Advanced Software Techn
[BOLT][AArch64] Handle gold linker veneers
The gold linker veneers are written between functions without symbols, so we to handle it specially in BOLT.
Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D128082
show more ...
|
| #
d2c87699 |
| 24-Jun-2022 |
Amir Ayupov <[email protected]> |
[BOLT][NFC] Use range-based STL wrappers
Replace `std::` algorithms taking begin/end iterators with `llvm::` counterparts accepting ranges.
Reviewed By: rafauler
Differential Revision: https://rev
[BOLT][NFC] Use range-based STL wrappers
Replace `std::` algorithms taking begin/end iterators with `llvm::` counterparts accepting ranges.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D128154
show more ...
|
| #
28b1dcb1 |
| 17-Jun-2022 |
Huan Nguyen <[email protected]> |
[BOLT] Allow function fragments to point to one jump table
Resolve a crash related to split functions
Due to split function optimization, a function can be divided to two
fragments, and both fragm
[BOLT] Allow function fragments to point to one jump table
Resolve a crash related to split functions
Due to split function optimization, a function can be divided to two
fragments, and both fragments can access same jump table. This violates
the assumption that a jump table can only have one parent function,
which causes a crash during instrumentation.
We want to support the case: different functions cannot access same jump tables, but different fragments of same function can!
As all fragments are from same function, we point JT::Parent to one specific fragment. Right now it is the first disassembled fragment, but we can point it to the function's main fragment later.
Functions are disassembled sequentially. Previously, at the end of processing a function, JT::OffsetEntries is cleared, so other fragment can no longer reuse JT::OffsetEntries. To extend the support for split function, we only clear JT::OffsetEntries after all functions are disassembled.
Let say A.hot and A.cold access JT of three targets {X, Y, Z}, where X and Y are in A.hot, and Z is in A.cold. Suppose that A.hot is disassembled first, JT::OffsetEntries = {X',Y',INVALID_OFFSET}. When A.cold is disassembled, it cannot reuse JT::OffsetEntries above due to different fragment start. A simple solution: A.hot = {X',Y',INVALID_OFFSET} A.cold = {INVALID_OFFSET, INVALID_OFFSET, INVALID_OFFSET}
We update the assertion to allow different fragments of same function to get the same JumpTable object.
Potential improvements: A.hot = {X',Y',INVALID_OFFSET} A.cold = {INVALID_OFFSET, INVALID_OFFSET, Z'} The main issue is A.hot and A.cold have separate CFGs, thus jump table targets are still constrained within fragment bounds.
Future improvements: A.hot = {X, Y, Z} A.cold = {X, Y, Z}
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D127924
show more ...
|
| #
7dee646b |
| 11-Jun-2022 |
Amir Ayupov <[email protected]> |
[BOLT][NFC] Move printDebugInfo out of BC::printInstruction
Simplify `BinaryContext::printInstruction`.
Reviewed By: ayermolo
Differential Revision: https://reviews.llvm.org/D127561
|
| #
adf4142f |
| 11-Jun-2022 |
Fangrui Song <[email protected]> |
[MC] De-capitalize SwitchSection. NFC
Add SwitchSection to return switchSection. The API will be removed soon.
|
| #
82095bd5 |
| 10-Jun-2022 |
Huan Nguyen <[email protected]> |
[BOLT] Mark fragments related to split jump table as non-simple
Mark fragments related to split jump table as non-simple.
A function could be splitted into hot and cold fragments. A split jump tabl
[BOLT] Mark fragments related to split jump table as non-simple
Mark fragments related to split jump table as non-simple.
A function could be splitted into hot and cold fragments. A split jump table is challenging for correctly reconstructing control flow graphs, so it was marked as ignored. This update marks those fragments as non-simple, allowing them to be printed and partial control flow graph construction.
Test Plan: ``` llvm-lit -a tools/bolt/test/X86/split-func-icf.s ``` This test has two functions (main, main2), each has a jump table target to the same cold portion main2.cold.1(*2). We try to print out only this cold portion. If it is ignored, it cannot be printed. If it is non-simple, it can be printed. We verify that it can be printed.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D127464
show more ...
|
|
Revision tags: llvmorg-14.0.5 |
|
| #
b92436ef |
| 05-Jun-2022 |
Fangrui Song <[email protected]> |
[bolt] Remove unneeded cl::ZeroOrMore for cl::opt options
|
|
Revision tags: llvmorg-14.0.4, llvmorg-14.0.3, llvmorg-14.0.2, llvmorg-14.0.1, llvmorg-14.0.0, llvmorg-14.0.0-rc4, llvmorg-14.0.0-rc3, llvmorg-14.0.0-rc2 |
|
| #
e290133c |
| 23-Feb-2022 |
Maksim Panchenko <[email protected]> |
[BOLT] Add new class for symbolizing X86 instructions
Summary: While disassembling instructions, we need to replace certain immediate operands with symbols. This symbolizing process relies on readin
[BOLT] Add new class for symbolizing X86 instructions
Summary: While disassembling instructions, we need to replace certain immediate operands with symbols. This symbolizing process relies on reading relocations against instructions. However, some X86 instructions can have multiple immediate operands and up to two relocations against them. Thus, correctly matching a relocation to an operand is not always possible without knowing the operand offset within the instruction.
Luckily, LLVM provides an interface for passing the required info from the disassembler via a virtual MCSymbolizer class. Creating a target-specific version allows a precise matching of relocations to operands.
This diff adds X86MCSymbolizer class that performs X86-specific symbolizing (currently limited to non-branch instructions).
Reviewers: yota9, Amir, ayermolo, rafauler, zr33
Differential Revision: https://reviews.llvm.org/D120928
show more ...
|
| #
8579db96 |
| 31-May-2022 |
Denis Revunov <[email protected]> |
[BOLT] [AArch64] Handle constant islands spanning multiple functions
Fix BOLT's constant island mapping when a constant island marked by $d spans multiple functions. Currently, because BOLT only mar
[BOLT] [AArch64] Handle constant islands spanning multiple functions
Fix BOLT's constant island mapping when a constant island marked by $d spans multiple functions. Currently, because BOLT only marks the constant island in the first function where $d is located, if the next function contains data at its start, BOLT will miss the data and try to disassemble it. This patch adds code to explicitly go through all symbols between $d and $x markers and mark their respective offsets as data, which stops BOLT from trying to disassemble data. It also adds MarkerType enum and refactors related functions.
Reviewed By: yota9, rafauler
Differential Revision: https://reviews.llvm.org/D126177
show more ...
|
| #
69f87b6c |
| 25-May-2022 |
Amir Ayupov <[email protected]> |
[BOLT][NFC] Customize endline character for printInstruction(s)
This would be used in `BF::dumpGraph` to dump left-justified text.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm
[BOLT][NFC] Customize endline character for printInstruction(s)
This would be used in `BF::dumpGraph` to dump left-justified text.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D126232
show more ...
|
| #
c907d6e0 |
| 17-May-2022 |
Amir Ayupov <[email protected]> |
[BOLT][NFC] Suppress unused variable warnings
Addresses the warnings emitted by Apple Clang 13.1.6 (Xcode 13.3.1). Tip @tschuett issue #55404.
Reviewed By: rafauler
Differential Revision: https://
[BOLT][NFC] Suppress unused variable warnings
Addresses the warnings emitted by Apple Clang 13.1.6 (Xcode 13.3.1). Tip @tschuett issue #55404.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D125733
show more ...
|
| #
ba1ac98c |
| 05-May-2022 |
Alexander Yermolovich <[email protected]> |
[BOLT][DWARF] Add version 5 split dwarf support
Added support for DWARF5 Split Dwarf.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D122988
|
| #
014cd37f |
| 21-Apr-2022 |
Alexander Yermolovich <[email protected]> |
[BOLT][DWARF] Implement monolithic DWARF5
Added implementation to support DWARF5 in monolithic mode. Next step DWARF5 split dwarf support.
Reviewed By: maksfb
Differential Revision: https://review
[BOLT][DWARF] Implement monolithic DWARF5
Added implementation to support DWARF5 in monolithic mode. Next step DWARF5 split dwarf support.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D121876
show more ...
|
| #
63686af1 |
| 19-Apr-2022 |
Vladislav Khmelevsky <[email protected]> |
[BOLT] Fix build with GCC 7.3.0
The gcc 7.3.0 version raises "could not covert" error without std::move used explicitly.
Differential Revision: https://reviews.llvm.org/D124009
|
| #
77b75ca5 |
| 14-Apr-2022 |
Maksim Panchenko <[email protected]> |
[BOLT][perf2bolt] Fix base address calculation for shared objects
When processing profile data for shared object or PIE, perf2bolt needs to calculate base address of the binary based on the map info
[BOLT][perf2bolt] Fix base address calculation for shared objects
When processing profile data for shared object or PIE, perf2bolt needs to calculate base address of the binary based on the map info reported by the perf tool. When the mapping data provided is for the second (or any other than the first) segment and the segment's file offset does not match its memory offset, perf2bolt uses wrong assumption about the binary base address.
Add a function to calculate binary base address using the reported memory mapping and use the returned base for further address adjustments.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D123755
show more ...
|
| #
4c14519e |
| 20-Mar-2022 |
Vladislav Khmelevsky <[email protected]> |
[BOLT] LongJmp: Check for shouldEmit
Check that the function will be emitted in the final binary. Preserving old function address is needed in case it is PLT trampiline, that is currently not moved
[BOLT] LongJmp: Check for shouldEmit
Check that the function will be emitted in the final binary. Preserving old function address is needed in case it is PLT trampiline, that is currently not moved by the BOLT.
Differential Revision: https://reviews.llvm.org/D122098
show more ...
|
| #
c31af7cf |
| 29-Mar-2022 |
Amir Ayupov <[email protected]> |
[MC][BOLT] Add setter for AllowAtInName
Use the setter in BOLT to allow printing names with variant kind in the name (e.g. "func@PLT"). Fixes BOLT buildbot tests that broke after D122516: https://la
[MC][BOLT] Add setter for AllowAtInName
Use the setter in BOLT to allow printing names with variant kind in the name (e.g. "func@PLT"). Fixes BOLT buildbot tests that broke after D122516: https://lab.llvm.org/buildbot/#/builders/215/builds/3595
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D122694
show more ...
|
| #
db65429d |
| 10-Mar-2022 |
Elvina Yakubova <[email protected]> |
[BOLT] Divide RegularPageSize for X86 and AArch64 cases
For AArch64 in some cases/some distributions ld uses 64K alignment of LOAD segments by default.
Reviewed By: yota9, maksfb
Differential Revi
[BOLT] Divide RegularPageSize for X86 and AArch64 cases
For AArch64 in some cases/some distributions ld uses 64K alignment of LOAD segments by default.
Reviewed By: yota9, maksfb
Differential Revision: https://reviews.llvm.org/D119267
show more ...
|
| #
32d2473a |
| 17-Feb-2022 |
Amir Ayupov <[email protected]> |
[BOLT][NFC] Report errors from createBinaryContext and RewriteInstance ctor
Refactor createBinaryContext and RewriteInstance/MachORewriteInstance constructors to report an error in a library and fuz
[BOLT][NFC] Report errors from createBinaryContext and RewriteInstance ctor
Refactor createBinaryContext and RewriteInstance/MachORewriteInstance constructors to report an error in a library and fuzzer-friendly way instead of returning a nullptr or exiting.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D119658
show more ...
|
| #
2aed07e9 |
| 16-Feb-2022 |
Shao-Ce SUN <[email protected]> |
[NFC][MC] remove unused argument `MCRegisterInfo` in `MCCodeEmitter`
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D119846
|