- Apr 02, 2021
-
-
Amir Ayupov authored
Summary: Implemented support for Debug Fission. For the most part it doesn't impact Monolithic execution path. One area that was changed is the DW_AT_low_pc/DW_AT_high_pc conversion. Before it was to DW_AT_ranges/DW_AT_low_pc, now DW_AT_low_pc is kept in same place. Another more visible impact is in Skeleton CU the DW_AT_low_pc is replaced with DW_AT_ranges_base if it's not originally present and bolt converted ranges conversion inside the dwo units. Output of this are multiple .dwo files with updated debug information. (cherry picked from FBD29569788)
-
- May 14, 2021
-
-
Amir Ayupov authored
(cherry picked from FBD28427352)
-
- May 13, 2021
-
-
Maksim Panchenko authored
Summary: Remove relocations against internal function labels, e.g. jump table relocations, only when overwriting them. While reading an input file with relocations, we create internal relocations against code references (we skip PIC relocations). Later, when we discover jump tables, we remove corresponding relocations with the assumption that original relocations will either be ignored or replaced by new relocations. However, it is possible to miss some references to the jump table, in which case the original entries will not be ignored. While such situation is abnormal, it is still a better/safer approach to preserve relocations if we are not replacing them with new ones. (cherry picked from FBD28406628)
-
Maksim Panchenko authored
(cherry picked from FBD28406629)
-
- May 11, 2021
-
-
Amir Ayupov authored
Summary: Explicit assignment operator can be replaced with an implicit one. Remove it to allow an implicit copy constructor: ``` bolt/src/Passes/DataflowAnalysis.h:74:8: warning: definition of implicit copy constructor for 'ProgramPoint' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy] void operator=(const ProgramPoint &PP) { ^ bolt/src/Passes/DataflowAnalysis.h:62:14: note: in implicit copy constructor for 'llvm::bolt::ProgramPoint' first required here return ProgramPoint(&*Last); ``` (cherry picked from FBD28335138)
-
- May 14, 2021
-
-
Maksim Panchenko authored
(cherry picked from FBD28417604)
-
- May 11, 2021
-
-
Vladislav Khmelevsky authored
Summary: Adds missing headers removed by IWYU. NB: this caused build breakage on ubuntu-latest Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD28368185)
-
Vladislav Khmelevsky authored
Summary: Since gcc/ld could produce and expect PIE files we need to pass -no-pie option to avoid linking errors for tests. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei (cherry picked from FBD28360045)
-
- Apr 23, 2021
-
-
Alexey Moksyakov authored
Summary: Reorder-blocks optimization pass doesn't take into account that available offset for legacy Jcc instructions (for example, JRCXZ - operand 8 bits) has to be less than 255 bytes. It's rare case and to exclude such functions with unsupported instructions from optimization passes added extra checking Alexey Moksyakov Advanced Software Technology Lab, Huawei (cherry picked from FBD28264117)
-
- May 08, 2021
-
-
Amir Ayupov authored
Summary: Small refactoring inspired by clang-tidy modernize-use-emplace (cherry picked from FBD28307493)
-
- May 05, 2021
-
-
Amir Ayupov authored
Summary: Replace binutils tools with llvm tools (cherry picked from FBD29575630)
-
- May 01, 2021
-
-
Amir Ayupov authored
Summary: Ran iwyu multiple times, manually picked header remove lines. Reached fixed point wrt removal: iwyu doesn't automatically remove any more headers or forward declarations. (cherry picked from FBD29569221)
-
Maksim Panchenko authored
Summary: Previously, we used p_align value of the code segment to predict the mapping of the segment at runtime. However, at times the reported value is not aligned and at other times the actual aligned value will be different because of the different page size used. All we know is that the page size used at runtime should not exceed p_align value. Adjust our segment address matching accordingly. (cherry picked from FBD28133066)
-
- Apr 22, 2021
-
-
Maksim Panchenko authored
(cherry picked from FBD27918126)
-
Maksim Panchenko authored
Summary: The option duplicates functionality of "llvm-dwarfdump -eh-frame". (cherry picked from FBD27917505)
-
Maksim Panchenko authored
(cherry picked from FBD27915725)
-
- Apr 18, 2021
-
-
Amir Ayupov authored
Summary: Addressing comments from the review for "Expand auto types". Use const reference in MCPlusBuilder for MCInstrDesc where the copy is not necessary. (cherry picked from FBD27844344)
-
- Apr 08, 2021
-
-
Amir Ayupov authored
Summary: Expanded auto types across BOLT semi-automatically with the aid of clangd LSP (cherry picked from FBD33289309)
-
Rafael Auler authored
Summary: We can't use a fragment of the old LibPath as an input to create a new one. (cherry picked from FBD27642728)
-
- Apr 07, 2021
-
-
Rafael Auler authored
Summary: We may have a CU with empty ranges, so accept errors coming from DWARFDie::getAddressRanges(). This happens when using tools that selectively strip debuginfo from the binary. (cherry picked from FBD27602731)
-
- Mar 19, 2021
-
-
Amir Ayupov authored
Summary: Refactor SectionPatches to avoid the use of extra map and a cast from StringRef to std::string. cherry-picked from FBD26756560 (cherry picked from FBD27490641)
-
- Mar 30, 2021
-
-
Amir Ayupov authored
Summary: The user may wish to run BOLT for printing statistics only (i.e. to check that the profile is valid). Add an option to run BOLT without writing any output file, similar to a dry run. This option is triggered by supplying -o with "/dev/null". (cherry picked from FBD29568632)
-
- Mar 24, 2021
-
-
Maksim Panchenko authored
Summary: During the initial indirect jump analysis, we used to assert that the discovered jump table type matched the pattern of the corresponding instruction sequence. E.g., for PIC jump table memory we expected the PIC jump table instruction sequence. The assertions were too conservative, as in the case of a mismatch we can mark the indirect jump as having an unknown control flow. That should be sufficient to either skip the function processing or rely on relocation information for possible recovery of the control flow. (cherry picked from FBD27255816)
-
- Mar 16, 2021
-
-
Rafael Auler authored
Summary: Fix a bug with instrumentation when trying to instrument functions that share a jump table with multiple indirect jumps. Usually, each indirect jump that uses a JT will have its own copy of it. When this does not happen, we need to duplicate the jump table safely, so we can split the edges correctly (each copy of the jump table may have different split edges). For this to happen, we need to correctly match the sequence of instructions that perform the indirect jump to identify the base address of the jump table and patch it to point to the new cloned JT. It was reported to us a case in which the compiler generated suboptimal code to do an indirect jump which our matcher failed to identify. Fixes facebookincubator/BOLT#126 (cherry picked from FBD27065579)
-
Maksim Panchenko authored
Summary: Whenever BOLT encounters a data reference in code, it tries to convert it into <Object+Offset> form. The primary reason behind this approach is to support read-only data-reordering optimization. However, with the current level of the linker and compiler support we don't have enough information to always correctly restore the original <Object+Offset>. E.g. with zero-sized symbols we have to speculate that the actual size of the underlying object extends to the next symbol. Most of the time, there will be an object pointed by a zero-sized symbol and even if we are guessing incorrectly, there will be no harm in creating references of such form. The problem happens when there's no object corresponding to the original symbol and the next object is an (unmarked) jump table: A: # <- zero-sized object .LJUMP_TABLE: .long <entry1> .long <entry2> .... .LB: .long 21 .LC: .long 42 The jump table will be moved and all references past it (up to the next named object) will be incorrectly updated. We should not speculate about the size of A in a case like that and treat all discovered data objects (and thus references) independently. (cherry picked from FBD27005660)
-
- Mar 10, 2021
-
-
Vladislav Khmelevsky authored
Summary: This PR introduces 2 new instrumentation options: 1. instrumentation-no-counters-clear: Discussed at https://github.com/facebookincubator/BOLT/issues/121 2. instrumentation-wait-forks: Since the instrumentation counters are mapped as MAP_SHARED it will be nice to add ability to wait until all forks of the parent process will die using tracking of process group. The last patch is just emitBinary code refactor. Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Pull Request resolved: https://github.com/facebookincubator/BOLT/pull/125 GitHub Author: Vladislav Khmelevskyi <Vladislav.Khmelevskyi@huawei.com> (cherry picked from FBD26919011)
-
- Mar 05, 2021
-
-
Maksim Panchenko authored
Summary: TBSS section is a "virtual" section that does not take memory or file space. Ignore it completely while adjusting section sizes. (cherry picked from FBD26824484)
-
- Feb 18, 2021
-
-
Vladislav Khmelevsky authored
Summary: NONE relocations should not be processed during dynamic relocations read process Vladislav Khmelevsky, Advanced Software Technology Lab, Huawei Pull Request resolved: https://github.com/facebookincubator/BOLT/pull/118 GitHub Author: Vladislav Khmelevsky <Vladislav.Khmelevskyi@huawei.com> (cherry picked from FBD26489881)
-
- Mar 18, 2021
-
-
Alexander Yermolovich authored
Summary: As titled. (cherry picked from FBD28112186)
-
Rafael Auler authored
Summary: As titled. (cherry picked from FBD28112137)
-
- Feb 18, 2021
-
-
Alexander Yermolovich authored
Summary: There is no real link between CU and TU, so relying on fact that address are the same, and we are updating all of them. (cherry picked from FBD28112114)
-
- Mar 16, 2021
-
-
Rafael Auler authored
Summary: Update license and fix headers for some files. (cherry picked from FBD28112041)
-
- Dec 02, 2020
-
-
Amir Ayupov authored
Summary: This commit is the first step in rebasing all of BOLT history in the LLVM monorepo. It also solves trivial build issues by updating BOLT codebase to use current LLVM. There is still work left in rebasing some BOLT features and in making sure everything is working as intended. History has been rewritten to put BOLT in the /bolt folder, as opposed to /tools/llvm-bolt. (cherry picked from FBD33289252)
-
- Jan 30, 2021
-
-
Alexander Shaposhnikov authored
Summary: Add support for reading profile on Mach-O. (cherry picked from FBD25777049)
-
- Jan 29, 2021
-
-
Alexander Shaposhnikov authored
Summary: Add support for dumping profile on MacOS. (cherry picked from FBD25751363)
-
Alexander Shaposhnikov authored
Summary: Add support for dumping counters on MacOS (cherry picked from FBD25750516)
-
Alexander Shaposhnikov authored
Summary: 1. Add support for __literal16 section in the instrumentation runtime library for MacOS. 2. Fix emitting __counters section. (cherry picked from FBD25746342)
-
- Jan 28, 2021
-
-
Sergey Pupyrev authored
Summary: a few minor updates in block reordering: - some refactoring to improve readability; - optimized chain splitting strategy to improve quality of layout and performance of the algorithm. (cherry picked from FBD25126220)
-
- Jan 21, 2021
-
-
Alexander Shaposhnikov authored
Summary: Enable intToStr et al. in the runtime library for MacOS. (cherry picked from FBD25745358)
-
Alexander Shaposhnikov authored
Summary: Use size_t for the first parameter of operator new. https://en.cppreference.com/w/cpp/memory/new/operator_new (cherry picked from FBD25750921)
-