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-05-09[BOLT][DWARF] Fix assert for split dwarf.Alexander Yermolovich
Fixing a small bug where it would assert if CU does not modify .debug_addr section. Differential Revision: https://reviews.llvm.org/D125181
2022-05-06[BOLT][DWARF] Add version 5 split dwarf supportAlexander Yermolovich
Added support for DWARF5 Split Dwarf. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D122988
2022-05-05[BOLT] Report per-section hotness in bolt-heatmap.Rahman Lavaee
This patch adds a new feature to bolt heatmap to print the hotness of each section in terms of the percentage of samples within that section. Sample output generated for the clang binary: Section Name, Begin Address, End Address, Percentage Hotness .text, 0x1a7b9b0, 0x20a2cc0, 1.4709 .init, 0x20a2cc0, 0x20a2ce1, 0.0001 .fini, 0x20a2ce4, 0x20a2cf2, 0.0000 .text.unlikely, 0x20a2d00, 0x431990c, 0.3061 .text.hot, 0x4319910, 0x4bc6927, 97.2197 .text.startup, 0x4bc6930, 0x4c10c89, 0.0058 .plt, 0x4c10c90, 0x4c12010, 0.9974 Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124412
2022-05-05[BOLT][CMAKE] Check build target architecture for runtime libsAmir Ayupov
Account for cross-compilation build scenarios (X86 to ARM, Linux to Windows, etc). Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124712
2022-05-05[BOLT][NFC] Move getInliningInfo out of Inliner classAmir Ayupov
`getInliningInfo` is useful in other passes that need to check inlining eligibility for some function. Move the declaration and InliningInfo definition out of Inliner class. Prepare for subsequent use in ICP. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124899
2022-05-05[BOLT][NFC] Minor cleanup in ICP getCallTargets and canPromoteCallsiteAmir Ayupov
Minor refactoring. NFC. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124898
2022-05-04[BOLT][NFC] Fix MCPlusBuilder::getAliases caching behaviorAmir Ayupov
Caching behavior of `getAliases` causes a failure in unit tests where two MCPlusBuilder objects are created corresponding to AArch64 and X86: the alias cache is created for AArch64 but then used for X86. https://lab.llvm.org/staging/#/builders/211/builds/126 The issue only affects unit tests as we only construct one MCPlusBuilder for ELF binary. Resolve the issue by moving alias bitvectors to MCPlusBuilder object. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D124942
2022-05-04[BOLT] Fix ICPJumpTablesTopN option useAmir Ayupov
Fix non-sensical `opts::ICPJumpTablesTopN != 0 ? opts::ICPTopN : opts::ICPTopN`. Refactor/simplify another similar assignment. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124880
2022-05-04[BOLT][NFC] Make ICP options naming uniformAmir Ayupov
Rename `opts::IndirectCallPromotion*` to `opts::ICP*`, making option naming uniform and easier to follow. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124879
2022-05-04[BOLT][NFC] ICP: simplify findTargetsIndexAmir Ayupov
Unnest lambda and use `llvm::is_contained`. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124877
2022-05-04[BOLT][NFC] Refactor ICP::findCallTargetSymbolsAmir Ayupov
Reduce nesting making it easier to read. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124876
2022-05-04[BOLT][CMAKE] Fix llvm-bolt-fuzzer buildAmir Ayupov
Add X86/AArch64 targets to resolve missing dependencies, e.g.: `undefined reference to `LLVMInitializeX86AsmParser'` Follow-up to D124206 Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124886
2022-05-04[BOLT][TEST] Fix test failures on AArch64 builderAmir Ayupov
Address X86 tests failures on AArch64 builder: https://lab.llvm.org/staging/#/builders/211/builds/82 Inputs fail to cross-compile due to a missing header: ``` /usr/include/stdio.h:27:10: fatal error: 'bits/libc-header-start.h' file not found #include <bits/libc-header-start.h> ``` As inputs are linked with `-nostdlib` anyway, don't include stdio.h. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D124863
2022-05-03Revert "[BOLT][TEST] Fix test failures on AArch64 builder"Amir Ayupov
This reverts commit 88b6d3211c836021a9b570ac6090dd1bf42da449.
2022-05-03[BOLT][TEST] Fix test failures on AArch64 builderAmir Ayupov
Address X86 tests failures on AArch64 builder: https://lab.llvm.org/staging/#/builders/211/builds/82 Inputs fail to cross-compile due to a missing header: ``` /usr/include/stdio.h:27:10: fatal error: 'bits/libc-header-start.h' file not found #include <bits/libc-header-start.h> ``` As inputs are linked with `-nostdlib` anyway, don't include stdio.h. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D124863
2022-05-03[BOLT] [NFC] Remove unused variablePaul Kirth
This patch fixes a warning from -Wunused-but-set-variable MismatchedBranches are counted, but are never reported. Since evaluateProfileData() should already identify and report these cases, we can safely remove the unused variable. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124588
2022-04-30[BOLT][NFC] Reduce Target/{AArch64,X86} dependenciesAmir Ayupov
We don't actually depend on entire X86/AArch64 components that pull in CodeGen, SelectionDAG etc., just the Desc part with opcode and other definitions. Note that it doesn't decouple BOLT from these components - we still pull in X86 and AArch64 from top-level llvm-bolt dependencies as we use assembler and disassembler. It's difficult to reduce these as this requires non-trivial changes to X86/AArch64 components themselves (e.g. moving out AsmPrinter). Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D124206
2022-04-28[BOLT] Fix r_aarch64_prelxx testAlexey Moksyakov
The relocation value is calculated using the formula S + A - P, the verification of the value is performed by inversely calculating the location address Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D124270
2022-04-27[BOLT][NFC] Fix warning for unqualified call to std::movePaul Kirth
Fixes warning from RetpolineInsertion.cpp:171:44: warning: unqualified call to std::move [-Wunqualified-std-cast-call] Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D124482
2022-04-25[BOLT] Refactor DataAggregator::printLBRHeatMap.Rahman Lavaee
This also fixes some logs that were impacted by D123067. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D124281
2022-04-23[BOLT][CMAKE] Simplify Clang/LLD identificationAmir Ayupov
Refactor nested conditions. NFC Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D123861
2022-04-22[BOLT][DWARF] Implement monolithic DWARF5Alexander Yermolovich
Added implementation to support DWARF5 in monolithic mode. Next step DWARF5 split dwarf support. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D121876
2022-04-21[BOLT] Add R_AARCH64_PREL16/32/64 relocations supportAlexey Moksyakov
Reviewed By: yota9, rafauler Differential Revision: https://reviews.llvm.org/D122294
2022-04-21[BOLT] Fix build with GCC 7.3.0Vladislav Khmelevsky
The gcc 7.3.0 version raises "could not covert" error without std::move used explicitly. Differential Revision: https://reviews.llvm.org/D124009
2022-04-21[BOLT] Add fuzzy function name matching for LLVM LTOMaksim Panchenko
LLVM with LTO can generate function names in the form func.llvm.<number>, where <number> could vary based on the compilation environment. As a result, if a profiled binary originated from a different build than a corresponding binary used for BOLT optimization, then profiles for such LTO functions will be ignored. To fix the problem, use "fuzzy" matching with "func.llvm.*" form. Reviewed By: yota9, Amir Differential Revision: https://reviews.llvm.org/D124117
2022-04-21[BOLT][DWARF] Handle Error returned by visitLocationListAlexander Yermolovich
Looks like implementation in llvm changed, and now we need to process error being returned. Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D124133
2022-04-20Speculatively fix build botsAaron Ballman
This should address the issue found in: https://lab.llvm.org/buildbot/#/builders/215/builds/4610
2022-04-20Speculatively fix build botsAaron Ballman
This should address build failures found in: https://lab.llvm.org/buildbot/#/builders/217/builds/3610 https://lab.llvm.org/buildbot/#/builders/215/builds/4609 https://lab.llvm.org/buildbot/#/builders/68/builds/31012
2022-04-15[BOLT] Check if LLVM_REVISION is definedAmir Ayupov
Handle the case where LLVM_REVISION is undefined (due to LLVM_APPEND_VC_REV=OFF or otherwise) by setting "<unknown>" value as before D123549. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D123852
2022-04-15[BOLT][NFC] Use LLVM_REVISION instead of BOLT_VERSION_STRINGAmir Ayupov
Remove duplicate version string identification Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D123549
2022-04-14[BOLT][perf2bolt] Fix base address calculation for shared objectsMaksim Panchenko
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
2022-04-13[BOLT] Update skipRelocation for aarch64Vladislav Khmelevsky
The ld might relax ADRP+ADD or ADRP+LDR sequences to the ADR+NOP, add the new case to the skipRelocation for aarch64. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Differential Revision: https://reviews.llvm.org/D123334
2022-04-13[BOLT][TEST] Add -no-pie to two testsAmir Ayupov
Missed these two tests in D123329 in a rebase.
2022-04-13[BOLT][TEST] Remove -no-pie from cflags/cxxflagsAmir Ayupov
Align with an upstream change D120305 to make PIE the default on linux-gnu. Add `-no-pie` to tests that require it. Reviewed By: maksfb, yota9 Differential Revision: https://reviews.llvm.org/D123329
2022-04-13[BOLT] Ignore PC-relative relocations from data to dataMaksim Panchenko
BOLT expects PC-relative relocations in data sections to reference code and the relocated data to form a jump table. However, there are cases where PC-relative addressing is used for data-to-data references (e.g. clang-15 can generate such code). BOLT should recognize and ignore such relocations. Otherwise, they will be considered relocations not claimed by any jump table and cause a failure in the strict mode. Reviewed By: yota9, Amir Differential Revision: https://reviews.llvm.org/D123650
2022-04-13[BOLT] Fix data race in shortenInstructionsAmir Ayupov
Address ThreadSanitizer warning Reviewed By: maksfb Differential Revision: https://reviews.llvm.org/D121338
2022-04-13[BOLT] Fix two aarch64 testsVladislav Khmelevsky
tls-lld test might be broken since compiler might optimize plt function call and use address directly from got table. The test is removed since plt-gnu-ld checks the same functionality + versioning symbol matching, no need to keep both of the tests. The toolchain might optimize relocations in runtime-relocs test, replace the test compilation with yaml files. Differential Revision: https://reviews.llvm.org/D123332
2022-04-12[BOLT] Compact legacy profilesYi Kong
Merging multiple legacy profiles (produced by instrumentation BOLT) can easily reach GiBs. Let merge-fdata compact the profiles during merge to significantly reduce space usage. Differential Revision: https://reviews.llvm.org/D123513
2022-04-12Allow building heatmaps from basic sampled events with `-nl`.Rahman Lavaee
I find that this is useful for finding event hotspots. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D123067
2022-04-09[BOLT] Check MCContext errorsAmir Ayupov
Abort on emission errors to prevent a malformed binary being written. Example: ``` <unknown>:0: error: Undefined temporary symbol .Ltmp26310 <unknown>:0: error: Undefined temporary symbol .Ltmp26311 <unknown>:0: error: Undefined temporary symbol .Ltmp26312 <unknown>:0: error: Undefined temporary symbol .Ltmp26313 <unknown>:0: error: Undefined temporary symbol .Ltmp26314 <unknown>:0: error: Undefined temporary symbol .Ltmp26315 BOLT-ERROR: Emission failed. ``` Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D123263
2022-04-06[BOLT][test] Fix X86 testsVladislav Khmelevsky
Differential Revision: https://reviews.llvm.org/D123133
2022-04-06[Support/Hash functions] Change the `final()` and `result()` of the hashing ↵Argyrios Kyrtzidis
functions to return an array of bytes Returning `std::array<uint8_t, N>` is better ergonomics for the hashing functions usage, instead of a `StringRef`: * When returning `StringRef`, client code is "jumping through hoops" to do string manipulations instead of dealing with fixed array of bytes directly, which is more natural * Returning `std::array<uint8_t, N>` avoids the need for the hasher classes to keep a field just for the purpose of wrapping it and returning it as a `StringRef` As part of this patch also: * Introduce `TruncatedBLAKE3` which is useful for using BLAKE3 as the hasher type for `HashBuilder` with non-default hash sizes. * Make `MD5Result` inherit from `std::array<uint8_t, 16>` which improves & simplifies its API. Differential Revision: https://reviews.llvm.org/D123100
2022-04-06[BOLT][NFC] Move isADD64rr and isADDri out of MCPlusBuilder classAmir Ayupov
Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D123077
2022-04-05[BOLT] Check for !isTailCall in isUnconditionalBranchVladislav Khmelevsky
Add !isTailCall in isUnconditionalBranch check in order to sync the x86 and aarch64 and fix the fixDoubleJumps pass on aarch64. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Differential Revision: https://reviews.llvm.org/D122929
2022-04-05[BOLT] Fix plt relocations symbol matchVladislav Khmelevsky
The bfd linker adds the symbol versioning string to the symbol name in symtab. Skip the versioning part in order to find the registered PLT function. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Differential Revision: https://reviews.llvm.org/D122039
2022-04-05[BOLT][test] Fix AArch64 testMaksim Panchenko
Remove header dependency from cross-platform test. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D123107
2022-04-05[BOLT][test] Enable cross-target testingMaksim Panchenko
Check for supported target architecture instead of the host arch when deciding to execute non-runtime tests. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D122498
2022-04-05[BOLT][test] Fix X86 cross-platform testsMaksim Panchenko
Use target-specific flags for building X86 non-runnable tests. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D123072
2022-04-05[BOLT][NFC] Use X86 mnemonic checksAmir Ayupov
Remove switches in X86MCPlusBuilder.cpp, use mnemonic checks instead Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D122853
2022-04-03[BOLT] AArch64: Read all static relocationsVladislav Khmelevsky
Read static relocs on the same address, as dynamic in order to update constant island data address properly. Differential Revision: https://reviews.llvm.org/D122100