summaryrefslogtreecommitdiff
path: root/bolt/runtime/hugify.cpp
AgeCommit message (Collapse)Author
2025-10-14[bolt] Fix typos discovered by codespell (#124726)Christian Clauss
https://github.com/codespell-project/codespell ```bash codespell bolt --skip="*.yaml,Maintainers.txt" --write-changes \ --ignore-words-list=acount,alledges,ans,archtype,defin,iself,mis,mmaped,othere,outweight,vas ```
2025-04-15[BOLT] Fix conditional compilation of hugify.cpp (#135880)Maksim Panchenko
Fix builds after #117158: do not build hugify.cpp on Apple platforms.
2025-04-15[BOLT] Enable hugify for AArch64 (#117158)alekuz01
Add required hugify instrumentation and runtime libraries support for AArch64. Fixes #58226 Unblocks #62695
2025-03-04[BOLT] Fix kernel version check for THP in hugify (#129380)Eric Wang
BOLT --hugify does not work in kernel 6.x. Co-authored-by: rfwang07 <wangrufeng5@huawei.com>
2022-11-04[BOLT][Hugify] Fix apple buildsRafael Auler
Fix placement of ifdefs in hugify.cpp after D129107 landed.
2022-11-04adds huge pages support of PIE/no-PIE binariesAlexey Moksyakov
This patch adds the huge pages support (-hugify) for PIE/no-PIE binaries. Also returned functionality to support the kernels < 5.10 where there is a problem in a dynamic loader with the alignment of pages addresses. Differential Revision: https://reviews.llvm.org/D129107
2022-07-06[BOLT] Add runtime functions required by freestanding environmentMaksim Panchenko
Compiler can generate calls to some functions implicitly, even under constraints of freestanding environment. Make sure these functions are available in our runtime objects. Fixes test failures on some systems after https://reviews.llvm.org/D128960. Reviewed By: yota9 Differential Revision: https://reviews.llvm.org/D129168
2021-12-21[BOLT][NFC] Fix file-description commentsMaksim Panchenko
Summary: Fix comments at the start of source files. (cherry picked from FBD33274597)
2021-10-16[PR] Disable instrumentation and hugify build for aarch64Vladislav Khmelevsky
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)
2021-06-02[BOLT] Hugify: check for THP support via sysfsAmir Ayupov
Summary: Remove dependence on kernel version check, query sysfs directly instead. (cherry picked from FBD28858208)
2021-03-17Fix license for a few remaining filesRafael Auler
Summary: As titled. (cherry picked from FBD28112137)
2020-10-15Add first bits to cross-compile the runtime for OSXAlexander Shaposhnikov
Summary: Add first bits to cross-compile the runtime for OSX. (cherry picked from FBD24330977)
2020-07-27[BOLT] Fix stack alignment for runtime libRafael Auler
Summary: Right now, the SAVE_ALL sequence executed upon entry of both of our runtime libs (hugify and instrumentation) will cause the stack to not be aligned at a 16B boundary because it saves 15 8-byte regs. Change the code sequence to adjust for that. The compiler may generate code that assumes the stack is aligned by using movaps instructions, which will crash. (cherry picked from FBD22744307)
2020-07-02[Bolt] Improve coding style for runtime lib related codeXun Li
Summary: Reading through the LLVM coding standard again, realized a few places where I didn't follow the standard when coding. Addressing them: 1. prefer static functions over functions in unnamed namespace. 2. #include as little as possible in headers 3. Have vtable anchors. (cherry picked from FBD22353046)
2020-05-02Adding automatic huge page supportXun Li
Summary: This patch enables automated hugify for Bolt. When running Bolt against a binary with -hugify specified, Bolt will inject a call to a runtime library function at the entry of the binary. The runtime library calls madvise to map the hot code region into a 2M huge page. We support both new kernel with THP support and old kernels. For kernels with THP support we simply make a madvise call, while for old kernels, we first copy the code out, remap the memory with huge page, and then copy the code back. With this change, we no longer need to manually call into hugify_self and precompile it with --hot-text. Instead, we could simply combine --hugify option with existing optimizations, and at runtime it will automatically move hot code into 2M pages. Some details around the changes made: 1. Add an command line option to support --hugify. --hugify will automatically turn on --hot-text to get the proper hot code symbols. However, running with both --hugify and --hot-text is not allowed, since --hot-text is used on binaries that has precompiled call to hugify_self, which contradicts with the purpose of --hugify. 2. Moved the common utility functions out of instr.cpp to common.h, which will also be used by hugify.cpp. Added a few new system calls definitions. 3. Added a new class that inherits RuntimeLibrary, and implemented the necessary emit and link logic for hugify. 4. Added a simple test for hugify. (cherry picked from FBD21384529)