Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/bolt
AgeCommit message (Collapse)Author
2022-02-10Update all LLVM documentation mentioning runtimes in LLVM_ENABLE_PROJECTSLouis Dionne
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
2022-02-09Add missing MC includes in bolt/serge-sans-paille
Changes needed after ef736a1c39f27ef4 that removes some implicit dependencies from MrCV headers.
2022-02-09[BOLT][DWARF] Remove caching of ranges/abbrevsAlexander Yermolovich
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
2022-02-08[BOLT][TEST] Add .so instrumentation testAmir Ayupov
Summary: Shared object instrumentation test Test Plan: bin/llvm-lit -a bolt/test/X86/internal-call-instrument-so.s Reviewers: rafauler FBD34064557
2022-02-08[BOLT][CMAKE][NFC] Update runtime/CMakeLists.txtAmir Ayupov
Summary: - Specify compiler flags for runtime libraries as BOLT_RT_FLAGS, - Remove redundant CMake definitions. Reviewers: maksfb FBD34048561
2022-02-08[BOLT] Add ld.lld substitutionAmir Ayupov
Register ld.lld substition (tests were failing) Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D118738
2022-02-08[BOLT] Fix runtime osx cross-compile buildVladislav Khmelevsky
Place include elf.h under !apple condition Differential Revision: https://reviews.llvm.org/D119038
2022-02-08[BOLT] Add aarch64 support for peephole passesVladislav Khmelevsky
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
2022-02-07[BOLT] Refactor heatmap to be standalone toolVladislav Khmelevsky
Separate heatmap from bolt and build it as standalone tool. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D118946
2022-02-05[BOLT] Add nfc-check-setup scriptAmir Ayupov
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
2022-02-05[BOLT-UnitTests] Fix shared libraries buildAmir Ayupov
Fix build with `-DBUILD_SHARED_LIBS=ON` (add explicit deps). Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D119042
2022-02-05[BOLT][NFC] Fix compiler warningsAmir Ayupov
Summary: - variable 'TotalSize' set but not used - variable 'TotalCallsTopN' set but not used - use of bitwise '|' with boolean operands Reviewed By: maksfb FBD33911129
2022-02-04[BOLT][TEST] Add section flags for .gcc_except_tableAmir Ayupov
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
2022-02-03[BOLT][NFC] Use isInt<> instead of range checksAmir Ayupov
Summary: Reuse LLVM isInt check Reviewed By: maksfb FBD33945182
2022-02-03[BOLT][TEST] Add heatmap.testAmir Ayupov
Add a basic test for heatmap mode Reviewed By: maksfb, ayermolo Differential Revision: https://reviews.llvm.org/D118868
2022-02-01[BOLT][CMAKE] Add extra BOLT_INCLUDE_TESTS condition for merge-fdata ↵Amir Ayupov
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
2022-01-31[BOLT][DWARF] Handle shared abbrev sectionAlexander Yermolovich
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
2022-01-31[BOLT][TEST] Fix building some tests with clang-14 by passing -no-pieAmir Ayupov
Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D118556
2022-01-28[BOLT] Imported llvm-bolt-wrapper scriptAmir Ayupov
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)
2022-01-28[BOLT] Fix AARCH64 registers aliasingVladislav Khmelevsky
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
2022-01-27[BOLT][DWARF] Fix gdb index sectionAlexander Yermolovich
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
2022-01-27[BOLT][TEST] Adjust tests for BOLT_CLANG_EXE=clang-{6..9}Amir Ayupov
Fix tests to pass with clang-6..9 on Ubuntu 20.04. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D118282
2022-01-27[BOLT] Fix DWARFv5 for aarch64Vladislav Khmelevsky
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
2022-01-27[BOLT][docs] Add note regarding DWARF v5 support to README.mdMaksim Panchenko
Reviewed By: Amir, yota9 Differential Revision: https://reviews.llvm.org/D118284
2022-01-27[BOLT] Prepare BOLT for unit-testingVladislav Khmelevsky
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
2022-01-25DWARFv5 default: Switch bolt tests to use DWARFv4 since Bolt doesn't support ↵David Blaikie
v5 yet Rough attempt to fix these, since I don't have bolt building locally. Will see how the buildbots go with it...
2022-01-24[BOLT] Add missing <memory> in InstrumentationRuntimeLibrary.hAmir Ayupov
<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
2022-01-21[BOLT][NFC] Reduce includes with include-what-you-useAmir Ayupov
Summary: Removed redundant includes with IWYU Test Plan: ninja bolt Reviewers: maksfb FBD32043568
2022-01-21[BOLT] Make ICP target selection (more) deterministicAmir Ayupov
Summary: Break ties by selecting targets with lower addresses. Reviewers: maksfb FBD33677001
2022-01-21[BOLT][NFC] Expand auto types pt.2Amir Ayupov
Summary: Expand autos where it may lead to differences in the BOLT binary. Test Plan: NFC Reviewers: maksfb Reviewed By: maks FBD27673231
2022-01-19[BOLT] Remove unreachable uncond branch after returnVladislav Khmelevsky
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
2022-01-19[BOLT][CMAKE] Use BOLT_CLANG_EXE and BOLT_LLD_EXE as isAmir Ayupov
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
2022-01-19[BOLT][NFC] Delimit bytes in MCAnnotation bitmaskAmir Ayupov
Summary: Show individual bytes in the annotation mask. Test Plan: ninja llvm-bolt Reviewers: maksfb FBD30026393
2022-01-19[BOLT][NFC] Move Offset annotation to Group 1Amir Ayupov
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
2022-01-18updateDWARFObjectAddressRanges: nullify low pcVladislav Khmelevsky
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
2022-01-18[BOLT][TEST] Update exceptions-instrumentation.testAmir Aupov
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
2022-01-15[BOLT][CMAKE] Accept BOLT_CLANG_EXE and BOLT_LLD_EXEAmir Ayupov
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
2022-01-15[BOLT][DWARF] Reduce overhead for sized deallocAlexander Yermolovich
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
2022-01-15[BOLT][NFC] Remove redundant dependent template typeAmir Ayupov
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
2022-01-15[BOLT][CMAKE] Use IN_LIST checkAmir Ayupov
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
2022-01-15[BOLT][DWARF] Fix high pc patchingVladislav Khmelevsky
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
2022-01-14[BOLT][NFC] Refactor reset-release to move assignmentAmir Ayupov
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())`.
2022-01-14[BOLT][NFC] Remove uses of `std::vector<bool>`Amir Ayupov
Summary: LLVM Programmer’s Manual strongly discourages the use of `std::vector<bool>` and suggests `llvm::BitVector` as a possible replacement.
2022-01-13[BOLT] Update repo location in DockerfileAmir Ayupov
2022-01-13[bolt] Fix relative links in READMEShoaib Meenai
The README is in the `bolt` subdirectory now, so relative links need to be adjusted accordingly.
2022-01-12[BOLT][TEST] Move exceptions-instrumentation.test to X86Amir Ayupov
The aarch64 instrumentation is currently unsupported so the test is failing. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D117102
2022-01-12[BOLT] Update README build instructionsAmir Ayupov
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
2022-01-12[BOLT] README: address @apinski-cavium commentAmir Aupov
Address the comment at: https://github.com/llvm/llvm-project/commit/4c106cfdf7cf7eec861ad3983a3dd9a9e8f3a8ae#r63658159 Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D117083
2022-01-10[BOLT][NFC] Format braced initializer listsAmir Ayupov
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)
2022-01-09[BOLT][NFC] Refactor AArch64MCPlusBuilderMaksim Panchenko
Summary: Selectively apply clang-format to the code in AArch64MCPlusBuilder.cpp. (cherry picked from FBD33495653)