Age | Commit message (Collapse) | Author |
|
We are moving away from building the runtimes with LLVM_ENABLE_PROJECTS,
however the documentation was largely outdated. This commit updates all
the documentation I could find to use LLVM_ENABLE_RUNTIMES instead of
LLVM_ENABLE_PROJECTS for building runtimes.
Note that in the near future, libcxx, libcxxabi and libunwind will stop
supporting being built with LLVM_ENABLE_PROJECTS altogether. I don't know
what the plans are for other runtimes like libc, openmp and compiler-rt,
so I didn't make any changes to the documentation that would imply
something for those projects.
Once this lands, I will also cherry-pick this on the release/14.x branch
to make sure that LLVM's documentation is up-to-date and reflects what
we intend to support in the future.
Differential Revision: https://reviews.llvm.org/D119351
|
|
Changes needed after ef736a1c39f27ef4 that removes some implicit
dependencies from MrCV headers.
|
|
Removing caching of ranges/abbrevs to simplify the code.
Before we were doing it to get around a gdb limitation.
FBD34015613
Reviewed By: Amir, maksfb
Differential Revision: https://reviews.llvm.org/D119276
|
|
Summary: Shared object instrumentation test
Test Plan: bin/llvm-lit -a bolt/test/X86/internal-call-instrument-so.s
Reviewers: rafauler
FBD34064557
|
|
Summary:
- Specify compiler flags for runtime libraries as BOLT_RT_FLAGS,
- Remove redundant CMake definitions.
Reviewers: maksfb
FBD34048561
|
|
Register ld.lld substition (tests were failing)
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D118738
|
|
Place include elf.h under !apple condition
Differential Revision: https://reviews.llvm.org/D119038
|
|
Enable peephole optimizations for aarch64.
Also small code refactoring - add PeepholeOpts under Peepholes class.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D118732
|
|
Separate heatmap from bolt and build it as standalone tool.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D118946
|
|
Add the script to set up llvm-bolt-wrapper. The intended use is to run NFC
checks manually and automatically on a buildbot.
Reviewed By: rafauler
Differential Revision: https://reviews.llvm.org/D118516
|
|
Fix build with `-DBUILD_SHARED_LIBS=ON` (add explicit deps).
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D119042
|
|
Summary:
- variable 'TotalSize' set but not used
- variable 'TotalCallsTopN' set but not used
- use of bitwise '|' with boolean operands
Reviewed By: maksfb
FBD33911129
|
|
clang-10 complains about changed section flags in two tests:
- X86/shrinkwrapping.test
- X86/exceptions-args.test
Fix that by adding the missing flags.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D119014
|
|
Summary: Reuse LLVM isInt check
Reviewed By: maksfb
FBD33945182
|
|
Add a basic test for heatmap mode
Reviewed By: maksfb, ayermolo
Differential Revision: https://reviews.llvm.org/D118868
|
|
emit-relocs option
Only enable --emit-relocs linker option for merge-fdata target if tests are enabled.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D118580
|
|
We can have a scenario where multiple CUs share an abbrev table.
We modify or don't modify one CU, which leads to other CUs having invalid abbrev section.
Example that caused it.
All of CUs shared the same abbrev table. First CU just had compile_unit and sub_program.
It was not modified. Next CU had DW_TAG_lexical_block with
DW_AT_low_pc/DW_AT_high_pc converted to DW_AT_low_pc/DW_AT_ranges.
We used unmodified abbrev section for first and subsequent CUs.
So when parsing subsequent CUs debug info was corrupted.
In this patch we will now duplicate all sections that are modified and are different.
This also means that if .debug_types is present and it shares Abbrev table, and
they usually are, we now can have two Abbrev tables. One for CU that was modified,
and unmodified one for TU.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D118517
|
|
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D118556
|
|
Commit history in chronological order:
[BOLT] llvm-bolt-wrapper: added wrapper for bolt binary matching
Summary:
Wrapper to compare two versions of BOLT to see if they produce the same output
binary given the same input.
(cherry picked from FBD26626137)
[BOLT] llvm-bolt-wrapper: support for no-output tests and heatmap mode
Summary:
- Added an option `skip_binary_cmp` to support invocations that don't output
a binary
- Minor fixes for heatmap mode, timeout, log comparison
- Rearranged in-line config example to be copy-pasteable
(cherry picked from FBD26822016)
[BOLT] llvm-bolt-wrapper: merge stdout/stderr, search for config in script dir
(cherry picked from FBD27529335)
[BOLT] llvm-bolt-wrapper: handle /dev/null
Summary:
Fixed the wrapper to preserve `-o /dev/null` and skip binary matching for such
invocations.
(cherry picked from FBD28013747)
[BOLT] llvm-bolt-wrapper: handle cases where output binary doesn't exist
Summary:
Handle invocations where output binary is not generated (e.g. due to an expected
assertion or exit with BOLT-ERROR) and skip binary comparison in such cases.
(cherry picked from FBD28080158)
[BOLT] llvm-bolt-wrapper: handle boltdiff mode
Summary:
Handle `llvm-boltdiff` invocation similarly to `perf2bolt`
(cherry picked from FBD28080157)
[BOLT] llvm-bolt-wrapper: find section with mismatch
Summary:
For mismatching ELF files, find section with mismatch and print sections table
with highlighted mismatch section.
(cherry picked from FBD28087231)
[BOLT] llvm-bolt-wrapper: ignore-build-id in perf2bolt mode
Summary:
When perf2bolt fails to match build-id from perf output for cmp binary, we need
to use -ignore-build-id option to override the strict checking behavior.
(cherry picked from FBD28087232)
[BOLT] llvm-bolt-wrapper: suppress -bolt-info=0 in heatmap mode
Summary:
Heatmap mode is incompatible with `-bolt-info=0` used to suppress binary
differences. Remove it.
(cherry picked from FBD28087230)
[BOLT] llvm-bolt-wrapper: add config-generator mode
Summary:
llvm-bolt-wrapper config can be generated by the script itself.
It makes the workflow more reliable compared to preparing the config manually.
(cherry picked from FBD28358939)
[BOLT] llvm-bolt-wrapper: fix mismatch reporting
Summary:
1. Fixed header comparison issue where headers were skipped due to
`skip_end == 0` (`lst[:-n]` does not work if n==0).
2. Detect color support while printing mismatching section:
- use bold color if terminal supports ANSI escape codes,
- otherwise print ">" at mismatching section.
3. Remove extra 0x before mismatching offset.
(cherry picked from FBD28691979)
[BOLT] llvm-bolt-wrapper: handle perf2bolt tests with ignore-build-id
Summary:
`ignore-build-id` must be passed not more than once. Account for that.
(cherry picked from FBD29830266)
[BOLT] llvm-bolt-wrapper: fix running subprocesses in parallel
Summary:
The commands were running sequentially due to the use of blocking `communicate`
call, which is needed when stdout/stderr are directed to a pipe.
Fix this behavior by directing the output to a file.
(cherry picked from FBD29951863)
|
|
The aarch64 platform has special registers like X0_X1_X2_X3_X4_X5_X6_X7.
Using the downwards propagation this register will become a super
register for all X0..X7 and its super registers which is not right. This
patch replaces the downwards propagation with caching all the aliases using MCRegAliasIterator.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117394
|
|
Since we now re-write .debug_info the DWARF CU Offsets can change.
Just like for .debug_aranges the GDB Index will need to be updated.
Reviewed By: Amir, maksfb
Differential Revision: https://reviews.llvm.org/D118273
|
|
Fix tests to pass with clang-6..9 on Ubuntu 20.04.
Reviewed By: yota9
Differential Revision: https://reviews.llvm.org/D118282
|
|
This patch reverts patch "DWARFv5 default: Switch bolt tests to use
DWARFv4 since Bolt doesn't support v5 yet" and places the -gdwarf-4 flag
to the global cflags config file.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D118283
|
|
Reviewed By: Amir, yota9
Differential Revision: https://reviews.llvm.org/D118284
|
|
This patch adds unit testing support for BOLT. In order to do this we will need at least do this changes on the code level:
* Make createMCPlusBuilder accessible externally
* Remove positional InputFilename argument to bolt utlity sources
And prepare the cmake and lit for the new tests.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Reviewed By: maksfb, Amir
Differential Revision: https://reviews.llvm.org/D118271
|
|
v5 yet
Rough attempt to fix these, since I don't have bolt building locally.
Will see how the buildbots go with it...
|
|
<memory> is no longer included as a result of 5f290c090a24
("Move STLFunctionalExtras out of STLExtras").
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D118064
|
|
Summary: Removed redundant includes with IWYU
Test Plan: ninja bolt
Reviewers: maksfb
FBD32043568
|
|
Summary: Break ties by selecting targets with lower addresses.
Reviewers: maksfb
FBD33677001
|
|
Summary: Expand autos where it may lead to differences in the BOLT binary.
Test Plan: NFC
Reviewers: maksfb
Reviewed By: maks
FBD27673231
|
|
This patch fixes the removal of unreachable uncondtional branch located
after return instruction.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D117677
|
|
Add an ability to provide paths that don't match tool name exactly:
e.g. clang-13.
Remove use_lld call that sets up unused extra tools.
Test plan:
```
cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt" -DBOLT_CLANG_EXE=/usr/bin/clang-13 -DBOLT_LLD_EXE=/usr/bin/lld-13
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /usr/bin/lld-13
cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;lld" -DBOLT_CLANG_EXE=/usr/bin/clang-13
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /usr/bin/clang-13
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build2/bin/lld
cmake -G Ninja ../llvm-project/llvm -DLLVM_TARGETS_TO_BUILD="X86;AArch64" -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_ASSERTIONS=ON -DLLVM_ENABLE_PROJECTS="bolt;clang;lld"
...
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /data/llvm-build3/bin/clang
llvm-lit: /data/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld: /data/llvm-build3/bin/lld
```
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117446
|
|
Summary: Show individual bytes in the annotation mask.
Test Plan: ninja llvm-bolt
Reviewers: maksfb
FBD30026393
|
|
Summary:
Move the annotation to avoid dynamic memory allocations.
Improves the CPU time of instrumenting a large binary by 1% (+-0.8%, p-value 0.01)
Test Plan: NFC
Reviewers: maksfb
FBD30091656
|
|
In case the case the DW_AT_ranges tag already exists for the object the
low pc values won't be updated and will be incorrect in
after-bolt binaries.
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Differential Revision: https://reviews.llvm.org/D117216
|
|
Matching an exact byte offset is fragile if a different version of compiler
is used (e.g. distro clang).
Resolves an issue with running with BOLT_CLANG_EXE + clang-12
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117440
|
|
Add CMake options to supply clang and lld binaries for use in check-bolt
instead of requiring the build of clang and lld projects.
Suggested by Mehdi Amini in https://lists.llvm.org/pipermail/llvm-dev/2021-December/154426.html
Test Plan:
```
cmake -G Ninja ~/local/llvm-project/llvm \
-DLLVM_TARGETS_TO_BUILD="X86" \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_ENABLE_ASSERTIONS=ON \
-DLLVM_ENABLE_PROJECTS="bolt" \
-DBOLT_CLANG_EXE=~/local/bin/clang \
-DBOLT_LLD_EXE=~/local/bin/lld
ninja check-bolt
...
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using clang: /home/aaupov/local/bin/clang
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld.lld: /home/aaupov/local/bin/ld.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using lld-link: /home/aaupov/local/bin/lld-link
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using ld64.lld: /home/aaupov/local/bin/ld64.lld
llvm-lit: /home/aaupov/local/llvm-project/llvm/utils/lit/lit/llvm/config.py:436: note: using wasm-ld: /home/aaupov/local/bin/wasm-ld
...
```
Tested all configurations:
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + no BOLT_*_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang" + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;lld" + BOLT_CLANG_EXE
- LLVM_ENABLE_PROJECTS="bolt" + BOLT_CLANG_EXE + BOLT_LLD_EXE
- LLVM_ENABLE_PROJECTS="bolt;clang;lld" + BOLT_CLANG_EXE + BOLT_LLD_EXE
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117061
|
|
This is a follow up to Fix size mismatch error with jemalloc.
4243b6582cf3bb5fbcde908913d4779ded731321
Although that fix works it increased memory footprint.
With this patch we go back to original memory footprint.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117341
|
|
Summary:
Reduce code size by removing redundant dependent template type
from RewriteInstance methods.
Code size savings (via bloaty on llvm-bolt Debug build):
```
symbol,vmsize,filesize -> vmsize,filesize (delta vmsize,filesize)
updateELFSymbolTable 57096,59600 -> 56656,59048 (440,552)
updateELFSymbolTable::lambda 35957,55277 -> 35949,54485 (8,792)
getOutputSections 20592,21440 -> 20372,21156 (220,284)
getOutputSections::lambda 1792,5300 -> 1792,5372 (0,-72)
total delta (668,1556)
```
Reviewed By: maksfb
FBD33589393
|
|
Summary:
Address @smeenai feedback https://reviews.llvm.org/D117061#inline-1122106:
>CMake has if(IN_LIST) now, which you can use instead of the string(FIND)
IN_LIST is available since CMake 3.3 released in 2015.
Reviewed By: smeenai
FBD33590959
|
|
The DW_FORM_addr form of highPC address is written in absolute addres,
the data form is written in offset-from-low pc format.
Due to the large test binary the test is prepared separately in
https://github.com/rafaelauler/bolt-tests/pull/8
Vladislav Khmelevsky,
Advanced Software Technology Lab, Huawei
Reviewed By: ayermolo
Differential Revision: https://reviews.llvm.org/D117217
|
|
Summary:
Follow the clang-tidy suggestion to replace reset-release with move assignment.
Move assignment's effect for unique_ptr:
> Effects: Transfers ownership from `u` to `*this` as if by calling `reset(u.release())`
followed by an assignment from `std::forward<D>(u.get_deleter())`.
|
|
Summary:
LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>`
and suggests `llvm::BitVector` as a possible replacement.
|
|
|
|
The README is in the `bolt` subdirectory now, so relative links need to
be adjusted accordingly.
|
|
The aarch64 instrumentation is currently unsupported so the test is failing.
Reviewed By: Amir
Differential Revision: https://reviews.llvm.org/D117102
|
|
Mehdi spotted that our build instructions don't make sense in a monorepo:
https://github.com/facebookincubator/BOLT/pull/269.
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117062
|
|
Address the comment at:
https://github.com/llvm/llvm-project/commit/4c106cfdf7cf7eec861ad3983a3dd9a9e8f3a8ae#r63658159
Reviewed By: maksfb
Differential Revision: https://reviews.llvm.org/D117083
|
|
Summary:
Use assignment (`=`) with braced initializer lists when constructing
aggregate temporaries in expressions.
https://llvm.org/docs/CodingStandards.html#braced-initializer-lists
(cherry picked from FBD33515669)
|
|
Summary: Selectively apply clang-format to the code in AArch64MCPlusBuilder.cpp.
(cherry picked from FBD33495653)
|