- Nov 12, 2021
-
-
Rafael Auler authored
Summary: Make BOLT build in VisualStudio compiler and run without crashing on a simple test. Other tests are not running. (cherry picked from FBD32378736)
-
Amir Ayupov authored
Summary: Imported small internal tests. (cherry picked from FBD32371964)
-
- Nov 11, 2021
-
-
Maksim Panchenko authored
(cherry picked from FBD32337755)
-
- Nov 09, 2021
-
-
Amir Ayupov authored
Summary: Moved the FDATA printing under the condition of non-empty profile data. The change reduces the assembly dumps. (cherry picked from FBD32262675)
-
Amir Ayupov authored
Summary: Import the test. The assembly input has three functions with associated fdata. The old link_fdata.sh script only replaces the symbol names with symbol values, whereas fdata format expects to have symbol offsets against the anchor symbol. Introduce the link_fdata.py script which is able to parse the input and produce either an offset or an absolute symbol value. (cherry picked from FBD32256351)
-
- Nov 05, 2021
-
-
Amir Ayupov authored
Summary: The majority of tests in LLVM projects are using - instead of _ in the name, i.e. `check-something.test` is preferred over `check_something.test`. It makes sense for us to adopt the same naming scheme for our future tests and to rename existing ones. (cherry picked from FBD32185879)
-
- Nov 04, 2021
-
-
Amir Ayupov authored
Summary: Imported small internal tests: - fallthrough-to-noop.test (cherry picked from FBD32158100)
-
Amir Ayupov authored
Summary: BOLT meta test using merge-fdata tool. This tests BOLT instrumentation for a non-trivial binary, running instrumented binary, and using the instrumentation profile for BOLT optimizations. The results are verified between original, instrumented, and optimized binaries. Additional tested features: boltdiff mode and merge-fdata for two profiles. merge-fdata tool is linked with relocs on Linux to support this test. (cherry picked from FBD32141812)
-
- Oct 30, 2021
-
-
Amir Ayupov authored
Summary: Imported small internal tests: - asm_func_debug.test - basic_instrumentation.test - bolt_icf.test - ctc_and_unreachable.test - double_jump.test - exceptions_args.test - exceptions_instrumentation.test - fptr.test (cherry picked from FBD32032684)
-
- Nov 10, 2021
-
-
Amir Ayupov authored
Summary: Replace erroneous check for function eligibility from `Function.isIgnored()` to `shouldOptimize(Function)`. This prevents non-simple functions from being processed. (cherry picked from FBD32301958)
-
- Nov 09, 2021
-
-
Maksim Panchenko authored
(cherry picked from FBD32272387)
-
- Oct 28, 2021
-
-
Maksim Panchenko authored
Summary: With LTO, it's possible for multiple DWARF compile units to share the same abbreviation section set, i.e. to have the same abbrev_offset. When units sharing the same abbrev set are located next to each other and neither of them is being processed (i.e. contain processed functions), it can trigger a bug in BOLT. When this happened, the abbrev set is considered empty. Additionally, different units may patch abbrev section differently. The fix is to not rely on the next unit offset when detecting abbreviation set boundaries and to delay writing abbrev section until all units are processed. (cherry picked from FBD31985046)
-
- Oct 19, 2021
-
-
Vladislav Khmelevsky authored
Summary: Add R_AARCH64_ABS32 and R_AARCH64_ABS16 relocations support Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31875254)
-
- Oct 12, 2021
-
-
Alexey Moksyakov authored
Summary: This commit uses reviews.llvm.org/D6629 as a reference to optimize X86::EFLAGS load/store in the instrumentation snippet by using lahf/sahf instructions instead of pushf/popf. (cherry picked from FBD31662303)
-
- Sep 28, 2021
-
-
Rafael Auler authored
Summary: Added new functionality of dumping simple functions into assembly. This includes: - function control flow (basic blocks, instructions), - profile information as `FDATA` directives, to be consumed by link_fdata, - data labels, - CFI directives, - symbols for callee functions, - jump table symbols. Envisioned usage: 1. Find a function that triggers BOLT crash (e.g. with `bughunter.sh`). 2. Generate reproducer asm source for that function (using `-funcs`). 3. Attach it to an issue. 4. Reduce and include as a test case. Current limitations: 1. Emitted assembly won't match input file relocations. 2. No DWARF support. 3. Data is not emitted. (cherry picked from FBD32746857)
-
- Oct 26, 2021
-
-
Maksim Panchenko authored
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)
-
- Oct 27, 2021
-
-
Rafael Auler authored
Summary: Change cmake config in BOLT to only support Linux. In other platforms, we print a warning that we won't build BOLT. Change configs to determine whether we will build BOLT runtime libs. This only happens in x86 hosts. If true, we will build the runtime and enable bolt-runtime tests. New tests that depend on the bolt_rt lib needs to be marked REQUIRES:bolt-runtime. I updated the relevant tests. Fix cmake to do not crash when building llvm with a target that BOLT does not support. (cherry picked from FBD31935760)
-
- Oct 09, 2021
-
-
Rafael Auler authored
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)
-
- Oct 26, 2021
-
-
Marius Wachtler authored
Summary: Increase the hard limit from 256 to 4096. This fixes the 'Assertion failed: failed to open binary path' error I'm seeing. (cherry picked from FBD31911946)
-
- Oct 24, 2021
-
-
Maksim Panchenko authored
Summary: Dockerfile based on Ubuntu:20.04. Fixes facebookincubator/BOLT#214. (cherry picked from FBD31883210)
-
- Oct 16, 2021
-
-
Vladislav Khmelevsky authored
Summary: This patch introduces remove-symtab option to be able to skip emitting symtab section in the final binary. Also this patch adds ".zdebug_*" (compressed debug section) in the list of debug section names. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31738239)
-
- Oct 17, 2021
-
-
Vladislav Khmelevsky authored
Summary: Fix control reaches end of non-void function warning (cherry picked from FBD31738391)
-
- Oct 12, 2021
-
-
Maksim Panchenko authored
Summary: Some compilation units will contain only code that is left unmodified by BOLT, e.g. there is no profile data available for any function from such units as they are rarely or never executed. To save processing time and memory, we disable building line info tables for such units and write unmodified tables to the output file. (cherry picked from FBD31599759)
-
- Oct 16, 2021
-
-
Vladislav Khmelevsky authored
Summary: This patch temporarily disables instrumentation and higufy build not for x86 platforms to be able to build llvm-bolt tool on aarch64. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31738306)
-
- Oct 17, 2021
-
-
Vladislav Khmelevsky authored
Summary: To supress warning of unsupported relocations Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31738420)
-
- Oct 16, 2021
-
-
Vladislav Khmelevsky authored
Summary: Sync the file with storage device on data dump to stabilize instrumentation testing Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31738021)
-
Vladislav Khmelevsky authored
Summary: After the "Allocate memory for constant islands on-demand" patch there are couple of problems found in constant islands handling: 1. When creating constant island dependency we need to check that we already allocated IslandInfo for BF. 2. In ADRRelaxationPass we need to set constant island check under new hasIslandsInfo condition. 3. In binaryemitter we need to replace hasConstantIsland with hasIslandsInfo check since originally the BF might not have constant island, but might have access to other's BF CI. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31737935)
-
- Oct 12, 2021
-
-
Alexander Yermolovich authored
Summary: Refactored Loc and LocList writers to write out entries during finalization phase, and hid some of the details in a class. This simplifies things from impelementation details, and also will be needed for DWARF5 where we need to know how many locLists entries there are there. (cherry picked from FBD31563795)
-
- Oct 11, 2021
-
-
Elvina Yakubova authored
Summary: Add lit.local.cfg to X86 and AArch64 folders. Fix host_arch in lit config for AArch64. Fix AArch64 and X86 tests. Elvina Yakubova, Advanced Software Technology Lab, Huawei (cherry picked from FBD31702068)
-
- Oct 05, 2021
-
-
Vladislav Khmelevsky authored
Summary: This patch handles 2 problems with LongJmp pass: 1. The pass should be executed before FinalizeFunctions, since the pass may add new entry points for the function, and the BinaryFunction::addEntryPoint has an assert "CurrentState == State::CFG" 2. Replaced shortJmp implementation with position-independent code. Currently we could handle PIC binaries with max +-4Gb offsets, the longJmp uses absolute addreses and could could be used only in non-PIE binaries. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD31416925)
-
- Oct 14, 2021
-
-
Maksim Panchenko authored
Summary: Use MCAsmLayout to update stmt_list in updateLineTableOffsets() instead of manually calculating the layout. (cherry picked from FBD31623071)
-
- Oct 12, 2021
-
-
Maksim Panchenko authored
(cherry picked from FBD31550675)
-
- Oct 09, 2021
-
-
Maksim Panchenko authored
Summary: Allocate memory for storing constant island info only when needed. (cherry picked from FBD31510149)
-
Amir Ayupov authored
Summary: Imported small internal tests: - shared_object.test - shrinkwrapping.test - static_exe.test - tailcall.test - vararg.test (cherry picked from FBD31523478)
-
Amir Ayupov authored
Summary: Imported small internal tests: - sctc_bug{,2,3,4}.test (cherry picked from FBD31517120) -
Amir Ayupov authored
Summary: Imported small internal tests: - re-optimize.test - relaxed_tailcall.test - remove_unused.test - retpoline_synthetic.test (cherry picked from FBD31516680)
-
Amir Ayupov authored
Summary: Imported small internal tests: - cfi_instrs_reordered.s - no_entry_reordering.test - no_relocs.test - pie.test (cherry picked from FBD31514823)
-
- Oct 08, 2021
-
-
Amir Ayupov authored
Summary: Imported small internal tests: - keep_aranges.test - layout_heuristic.test - line_number.test - block_reordering.test - branch_data.test - reader.test (cherry picked from FBD31486371)
-
- Oct 07, 2021
-
-
Amir Ayupov authored
Summary: Imported small internal tests: - jmp_optimization.test - jmpjmp.test - jump_table_footprint_reduction.test - jump_table_reference.test (cherry picked from FBD31483122)
-
Amir Ayupov authored
Summary: Imported small internal tests: - indirect_goto.test - indirect_goto_pie.test - inlined_function_mixed.test (cherry picked from FBD31446571)
-