#
2430a354 |
| 27-Jun-2024 |
shaw young <58664393+shawbyoung@users.noreply.github.com> |
[BOLT][NFC] Move CallGraph from Passes to Core (#96922)
Moved CallGraph and BinaryFunctionCallGraph from Passes to
Core for future use in stale matching.
|
#
46435ac1 |
| 08-May-2024 |
Kristof Beyls <kristof.beyls@arm.com> |
[NFC][BOLT] Remove dead code (SPTAllocatorsId) (#91477)
It seems that SPTAllocatorsId is no longer used in FrameAnalysis, so
let's remove it.
It seems the use of SPTAllocatorsId was removed back
[NFC][BOLT] Remove dead code (SPTAllocatorsId) (#91477)
It seems that SPTAllocatorsId is no longer used in FrameAnalysis, so
let's remove it.
It seems the use of SPTAllocatorsId was removed back in 2019, in commit
cc8415406c7.
show more ...
|
#
52cf0711 |
| 12-Feb-2024 |
Amir Ayupov <aaupov@fb.com> |
[BOLT][NFC] Log through JournalingStreams (#81524)
Make core BOLT functionality more friendly to being used as a
library instead of in our standalone driver llvm-bolt. To
accomplish this, we augme
[BOLT][NFC] Log through JournalingStreams (#81524)
Make core BOLT functionality more friendly to being used as a
library instead of in our standalone driver llvm-bolt. To
accomplish this, we augment BinaryContext with journaling streams
that are to be used by most BOLT code whenever something needs to
be logged to the screen. Users of the library can decide if logs
should be printed to a file, no file or to the screen, as
before. To illustrate this, this patch adds a new option
`--log-file` that allows the user to redirect BOLT logging to a
file on disk or completely hide it by using
`--log-file=/dev/null`. Future BOLT code should now use
`BinaryContext::outs()` for printing important messages instead of
`llvm::outs()`. A new test log.test enforces this by verifying that
no strings are print to screen once the `--log-file` option is
used.
In previous patches we also added a new BOLTError class to report
common and fatal errors, so code shouldn't call exit(1) now. To
easily handle problems as before (by quitting with exit(1)),
callers can now use
`BinaryContext::logBOLTErrorsAndQuitOnFatal(Error)` whenever code
needs to deal with BOLT errors. To test this, we have fatal.s
that checks we are correctly quitting and printing a fatal error
to the screen.
Because this is a significant change by itself, not all code was
yet ported. Code from Profiler libs (DataAggregator and friends)
still print errors directly to screen.
Co-authored-by: Rafael Auler <rafaelauler@fb.com>
Test Plan: NFC
show more ...
|
#
2eae9d8e |
| 14-Mar-2023 |
Amir Ayupov <amir.aupov@gmail.com> |
[BOLT][NFC] Use llvm::is_contained
Apply the replacement throughout BOLT.
Reviewed By: #bolt, rafauler
Differential Revision: https://reviews.llvm.org/D145464
|
#
f119a248 |
| 19-Aug-2022 |
Amir Ayupov <aaupov@fb.com> |
[BOLT][NFC] Use llvm::any_of
Replace the imperative pattern of the following kind ``` bool IsTrue = false; for (Element : Range) { if (Condition(Element)) { IsTrue = true; break; } } ```
[BOLT][NFC] Use llvm::any_of
Replace the imperative pattern of the following kind ``` bool IsTrue = false; for (Element : Range) { if (Condition(Element)) { IsTrue = true; break; } } ``` with functional style `llvm::any_of`: ``` bool IsTrue = llvm::any_of(Range, [&](Element) { return Condition(Element); }); ```
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D132276
show more ...
|
#
0972a390 |
| 09-Aug-2022 |
Fangrui Song <i@maskray.me> |
LLVM_FALLTHROUGH => [[fallthrough]]. NFC
|
#
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 ...
|
#
a3cfdd74 |
| 21-May-2022 |
Rafael Auler <rafaelauler@fb.com> |
[BOLT] Increase coverage of shrink wrapping [5/5]
Add -experimental-shrink-wrapping flag to control when we want to move callee-saved registers even when addresses of the stack frame are captured an
[BOLT] Increase coverage of shrink wrapping [5/5]
Add -experimental-shrink-wrapping flag to control when we want to move callee-saved registers even when addresses of the stack frame are captured and used in pointer arithmetic, making it more challenging to do alias analysis to prove that we do not access optimized stack positions. This alias analysis is not yet implemented, hence, it is experimental. In practice, though, no compiler would emit code to do pointer arithmetic to access a saved callee-saved register unless there is a memory bug or we are failing to identify a callee-saved reg, so I'm not sure how useful it would be to formally prove that.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D126115
show more ...
|
#
42465efd |
| 09-Mar-2022 |
Rafael Auler <rafaelauler@fb.com> |
[BOLT] Increase coverage of shrink wrapping [1/5]
Change how function score is calculated and provide more detailed statistics when reporting back frame optimizer and shrink wrapping results. In thi
[BOLT] Increase coverage of shrink wrapping [1/5]
Change how function score is calculated and provide more detailed statistics when reporting back frame optimizer and shrink wrapping results. In this new statistics, we provide dynamic coverage numbers. The main metric for shrink wrapping is the number of executed stores that were saved because of shrink wrapping (push instructions that were either entirely moved away from the hot block or converted to a stack adjustment instruction). There is still a number of reduced load instructions (pop) that we are not counting at the moment. Also update alloc combiner to report dynamic numbers, as well as frame optimizer.
For debugging purposes, we also include a list of top 10 functions optimized by shrink wrapping. These changes are aimed at better understanding the impact of shrink wrapping in a given binary.
We also remove an assertion in dataflow analysis to do not choke on empty functions (which makes no sense).
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D126111
show more ...
|
#
b92436ef |
| 05-Jun-2022 |
Fangrui Song <i@maskray.me> |
[bolt] Remove unneeded cl::ZeroOrMore for cl::opt options
|
#
57f7c7d9 |
| 09-Feb-2022 |
serge-sans-paille <sguelton@redhat.com> |
Add missing MC includes in bolt/
Changes needed after ef736a1c39f27ef4 that removes some implicit dependencies from MrCV headers.
|
#
f92ab6af |
| 29-Dec-2021 |
Amir Ayupov <aaupov@fb.com> |
[BOLT][NFC] Fix braces usage in Passes
Summary: Refactor bolt/*/Passes to follow the braces rule for if/else/loop from [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).
(cherry p
[BOLT][NFC] Fix braces usage in Passes
Summary: Refactor bolt/*/Passes to follow the braces rule for if/else/loop from [LLVM Coding Standards](https://llvm.org/docs/CodingStandards.html).
(cherry picked from FBD33344642)
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)
|
#
60b09997 |
| 26-Oct-2021 |
Maksim Panchenko <maks@fb.com> |
[BOLT][NFC] Do not pass BinaryContext alongside BinaryFunction
Summary: BinaryContext is available via BinaryFunction::getBinaryContext(), hence there's no reason to pass both as arguments to a func
[BOLT][NFC] Do not pass BinaryContext alongside BinaryFunction
Summary: BinaryContext is available via BinaryFunction::getBinaryContext(), hence there's no reason to pass both as arguments to a function.
In a similar fashion, BinaryBasicBlock has an access to BinaryFunction via getFunction(). Eliminate unneeded arguments.
(cherry picked from FBD31921680)
show more ...
|
#
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 ...
|