| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[BOLT] Extend Inliner to work on functions with Pointer Authentication (#162458) The inliner uses DirectSP to check if a function has instructions that modify the SP. Exceptions are stack Push and Pop instructions. We can also allow pointer signing and authenticating instructions. The inliner removes the Return instructions from the inlined functions. If it is a fused pointer-authentication-and-return (e.g. RETAA), we have to generate a new authentication instruction. | 8 个月前 | |
[BOLT] Add dump-dot-func option for selective function CFG dumping (#153007) ## Change: * Added --dump-dot-func command-line option that allows users to dump CFGs only for specific functions instead of dumping all functions (the current only available option being --dump-dot-all) ## Usage: * Users can now specify function names or regex patterns (e.g., --dump-dot-func=main,helper or --dump-dot-func="init.*") to generate .dot files only for functions of interest * Aims to save time when analysing specific functions in large binaries (e.g., only dumping graphs for performance-critical functions identified through profiling) and we can now avoid reduce output clutter from generating thousands of unnecessary .dot files when analysing large binaries ## Testing The introduced test dump-dot-func.test confirms the new option does the following: - [x] 1. dump-dot-func can correctly filter a specified functions - [x] 2. Can achieve the above with regexes - [x] 3. Can do 1. with a list of functions - [x] No option specified creates no dot files - [x] Passing in a non-existent function generates no dumping messages - [x] dump-dot-all continues to work as expected | 11 个月前 | |
RISCV: Remove shouldForceRelocation and unneeded relocations Follow-up to #140494 shouldForceRelocation is conservative and produces redundant relocations. For example, RISCVAsmBackend::ForceRelocs (introduced to support mixed relax/norelax code) leads to redundant relocations in the following example adapted from #77436 .option norelax j label // For assembly input, RISCVAsmParser::ParseInstruction sets ForceRelocs (https://reviews.llvm.org/D46423). // For direct object emission, RISCVELFStreamer sets ForceRelocs (#77436) .option relax call foo // linker-relaxable .option norelax j label // redundant relocation due to ForceRelocs .option relax label: Root problem: The isSymbolRefDifferenceFullyResolvedImpl condition in MCAssembler::evaluateFixup does not check whether two locations are separated by a fragment whose size can be indeterminate due to linker instruction (e.g. MCDataFragment with relaxation, or MCAlignFragment due to indeterminate start offst). This patch * Updates the fragment walk code in attemptToFoldSymbolOffsetDifference to treat MCRelaxableFragment (for --riscv-asm-relax-branches) as fixed size after finishLayout. * Adds a condition in addReloc to complement isSymbolRefDifferenceFullyResolvedImpl. * Removes the no longer needed shouldForceRelocation. This fragment walk code path handles nicely handles mixed relax/norelax case from https://discourse.llvm.org/t/possible-problem-related-to-subtarget-usage/75283 and allows us to remove MCSubtargetInfo argument (#73721) as a follow-up. This fragment walk code should be avoided in the absence of linker-relaxable fragments within the current section. Adjust two bolt/test/RISCV tests (#141310) Pull Request: https://github.com/llvm/llvm-project/pull/140692 | 1 年前 | |
[NFC][Py Reformat] Reformat python files in the rest of the dirs This is an ongoing series of commits that are reformatting our Python code. This catches the last of the python files to reformat. Since they where so few I bunched them together. Reformatting is done with black. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: jhenderson, #libc, Mordante, sivachandra Differential Revision: https://reviews.llvm.org/D150784 | 3 年前 | |
[BOLT] Move call probe information to CallSiteInfo Pseudo probe matching (#100446) needs callee information for call probes. Embed call probe information (probe id, inline tree node, indirect flag) into CallSiteInfo. As a consequence: - Remove call probes from PseudoProbeInfo to avoid duplication, making it only contain block probes. - Probe grouping across inline tree nodes becomes more potent + allows to unambiguously elide block id 1 (common case). Block mask (blx) encoding becomes a low-ROI optimization and will be replaced by a more compact encoding leveraging simplified PseudoProbeInfo in #166680. The size increase is ~3% for an XL profile (461->475MB). Compact block probe encoding shrinks it by ~6%. Test Plan: updated pseudoprobe-decoding-{inline,noinline}.test Reviewers: paschalis-mpeis, ayermolo, yota9, yozhu, rafaelauler, maksfb Reviewed By: rafaelauler Pull Request: https://github.com/llvm/llvm-project/pull/165490 | 9 个月前 | |
[BOLT] Gadget scanner: make use of C++17 features and LLVM helpers (#141665) Perform trivial syntactical cleanups: - make use of structured binding declarations - use LLVM utility functions when appropriate - omit braces around single expression inside single-line LLVM_DEBUG() This patch is NFC aside from minor debug output changes. | 10 个月前 | |
[BOLT] Add --ba flag to deprecate --nl (#164257) The --nl flag, originally for Non-LBR mode, is deprecated and will be replaced by --basic-events (alias --ba). --nl remains as a deprecated alias for backward compatibility. | 9 个月前 | |
[BOLT][NFC] Rename funtions with _negative suffix to _unknown when th… (#166536) …e size is unknown Keep _negative suffix only for test cases when the size is negative | 9 个月前 | |
[BOLT] Introduce binary analysis tool based on BOLT (#115330) This initial commit does not add any specific binary analyses yet, it merely contains the boilerplate to introduce a new BOLT-based tool. This basically combines the 4 first patches from the prototype pac-ret and stack-clash binary analyzer discussed in RFC https://discourse.llvm.org/t/rfc-bolt-based-binary-analysis-tool-to-verify-correctness-of-security-hardening/78148 and published at https://github.com/llvm/llvm-project/compare/main...kbeyls:llvm-project:bolt-gadget-scanner-prototype The introduction of such a BOLT-based binary analysis tool was proposed and discussed in at least the following places: - The RFC pointed to above - EuroLLVM 2024 round table https://discourse.llvm.org/t/summary-of-bolt-as-a-binary-analysis-tool-round-table-at-eurollvm/78441 The round table showed quite a few people interested in being able to build a custom binary analysis quickly with a tool like this. - Also at the US LLVM dev meeting a few weeks ago, I heard interest from a few people, asking when the tool would be available upstream. - The presentation "Adding Pointer Authentication ABI support for your ELF platform" (https://llvm.swoogo.com/2024devmtg/session/2512720/adding-pointer-authentication-abi-support-for-your-elf-platform) explicitly mentioned interest to extend the prototype tool to verify correct implementation of pauthabi. | 1 年前 | |
[BOLT][test] enable GNU extensions, use C++ compiler, remove unnecessary target (#117043) 1. With a Clang that doesn't default to GNU extensions they need to be enabled explicitly. 2. The X86 directory lit config sets it already, there's no reason for this test to do it by itself. 3. The C frontend executable will fail if there's for example a Clang resource file for the C++ mode that sets C++-specific options: + /home/tambre/dev/llvm/build/bin/clang --target=x86_64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -pie -fPIC -shared /home/tambre/dev/llvm/bolt/test/R_ABS.pic.lld.cpp -o /home/tambre/dev/llvm/build/tools/bolt/test/Output/R_ABS.pic.lld.cpp.tmp.so -Wl,-q -fuse-ld=lld clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] error: invalid argument '-std=c23' not allowed with 'C++' | 1 年前 | |
[BOLT] Implement '--assume-abi' option for AArch64 This patch implements the getCalleeSavedRegs function for AArch64, addressing the issue where the "not implemented" error occurs when both the --assume-abi option and options related to the RegAnalysis Pass (e.g., --indirect-call-promotion=all) are enabled. | 2 年前 | |
[BOLT][instr] Avoid WX segment (#128982) BOLT instrumented binary today has a readable (R), writeable (W) and also executable (X) segment, which Android system won't load due to its WX attribute. Such RWX segment was produced because BOLT has a two step linking, first for everything in the updated or rewritten input binary and next for runtime library. Each linking will layout sections in the order of RX sections followed by RO sections and then followed by RW sections. So we could end up having a RW section .bolt.instr.counters surrounded by a number of RO and RX sections, and a new text segment was then formed by including all RX sections which includes the RW section in the middle, and hence the RWX segment. One way to fix this is to separate the RW .bolt.instr.counters section into its own segment by a). assigning the starting addresses for section .bolt.instr.counters and its following section with regular page aligned addresses and b). creating two extra program headers accordingly. | 1 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT][TEST] Use double dash flags in tests Replace a single dash with a double dash for options that have more than a single letter. llvm-bolt-wrapper.py has special treatment for output options such as "-o" and "-w" causing issues when a single dash is used, e.g. for "-write-dwp". The wrapper can be fixed as well, but using a double dash has other advantages as well. Reviewed By: rafauler Differential Revision: https://reviews.llvm.org/D127538 | 4 年前 | |
[BOLT] Push code to higher addresses under options (#146180) When --hot-functions-at-end is used in combination with --use-old-text, allocate code at the highest possible addresses withing old .text. This feature is mostly useful for HHVM, where it is beneficial to have hot static code placed as close as possible to jitted code. | 1 年前 | |
[BOLT][test] Fix 'dump-dot-func' test execution on Windows host (#155522) Replaced non-existent %clang++ substitute with %clangxx. %clang++ gets became clang.exe++ on the Windows host that failures the test execution. | 11 个月前 | |
[BOLT][DWARF] Get DWO file via relative path if the CompilationDir does not exist (#154515) In distributed builds, the DWARF CompilationDir is often invalid, causing BOLT to fail when locating DWO files. If the default path does not exist, it seems better to consider the DWOName as a relative path in this case. The implementation of this patch will try to search for the DWO file in the following order: 1. CompDirOverride + DWOName (if CompDirOverride specified) 2. CompilationDir + DWOName (if CompilationDir exists) 3. **Current directory + DWOName (relative path as a fallback)** This patch also fixes a crash that occurs when DWOName is an absolute path and a DWP file is provided. | 11 个月前 | |
[BOLT] Overwrite .eh_frame_hdr in-place (#116730) If the new EH frame header can fit into the original .eh_frame_hdr section, overwrite it in-place and pad with zeroes. | 1 年前 | |
[BOLT] Overwrite .eh_frame and .gcc_except_table (#116755) Under --use-old-text or --strict, we completely rewrite contents of EH frames and exception tables sections. If new contents of either section do not exceed the size of the original section, rewrite the section in-place. | 1 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
Remove -no-pie case from indirect-goto-relocs.test (#133067) This test was added in PR: https://github.com/llvm/llvm-project/pull/120267. The -no-pie case in the above mentioned test needs to be removed as subsequent changes have caused it to fail. | 1 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT] Improve regexp in link_fdata.py (#152694) FileCheck accepts both '#' and '//' as leading chars for commands, but link_fdata.py only searched for lines starting with '#'. This changes the regexps in link_fdata.py to mirror FileCheck's behaviour. The comment syntax in test/timers.c is modified to present this capability. | 11 个月前 | |
[BOLT] Fix debug line emission for functions in multiple compilation units (#151230) This patch fixes a bug in BOLT's debug line emission where functions that belong to multiple compilation units (such as inline functions in header files) were not handled correctly. Previously, BOLT incorrectly assumed that a binary function could belong to only one compilation unit, leading to incomplete or incorrect debug line information. ### **Problem** When a function appears in multiple compilation units (common scenarios include): * Template instantiated functions * Inline functions defined in header files included by multiple source files BOLT would only emit debug line information for one compilation unit, losing debug information for other CUs where the function was compiled. This resulted in incomplete debugging information and could cause debuggers to fail to set breakpoints or show incorrect source locations. ### **Root Cause** The issue was in BOLT's assumption that each binary function maps to exactly one compilation unit. However, when the same function (e.g., an inline function from a header) is compiled into multiple object files, it legitimately belongs to multiple CUs in the final binary. | 11 个月前 | |
[NFCI][bolt][test] Use AT&T syntax explicitly (#167225) This enables building LLVM with -mllvm -x86-asm-syntax=intel in one's Clang config files (i.e. a global preference for Intel syntax). -masm=att is insufficient as it doesn't override a specification of -mllvm -x86-asm-syntax. | 9 个月前 | |
[BOLT] Enable standalone build (#97130) Continue from #87196 as author did not have much time, I have taken over working on this PR. We would like to have this so it'll be easier to package for Nix. Can be tested by copying cmake, bolt, third-party, and llvm directories out into their own directory with this PR applied and then build bolt. --------- Co-authored-by: pca006132 <john.lck40@gmail.com> | 2 年前 | |
[BOLT] Fixed calling clang++ in tests on Windows (#151193) RUN: %clang++ tried to execute clang.exe++ on Windows. Use %clangxx instead. | 1 年前 | |
[BOLT] Fix --max-funcs=<N> option Fix off-by-one error while handling of the --max-funcs=<N> option. We used to process N+1 functions when N was requested. Reviewed By: Amir Differential Revision: https://reviews.llvm.org/D152751 | 3 年前 | |
[BOLT][merge-fdata] Fix basic sample profile aggregation without LBR info (#118481) When a basic sample profile is gathered without LBR info, the generated profile contains a "no-lbr" tag in the first line of the fdata file. This PR fixes merge-fdata to recognize and save this tag to the output file. | 1 年前 | |
[BOLT] Fix counts aggregation in merge-fdata (#119652) merge-fdata used to consider misprediction count as part of "signature", or the aggregation key. This prevented it from collapsing profile lines with different misprediction counts, which resulted in duplicate (from, to) pairs with different misprediction and execution counts. Fix that by splitting out misprediction count and accumulating it separately. Test Plan: updated bolt/test/merge-fdata-lbr-mode.test | 1 年前 | |
[BOLT][NFC] Speedup merge-fdata (#119942) Eliminate splitting the buffer into lines, and use std::getline directly. Simplify no_lbr and boltedcollection handling as well. Test Plan: For a large fdata file (200MB), fstream version is ~10% faster. | 1 年前 | |
[BOLT][NFC] Speedup merge-fdata (#119942) Eliminate splitting the buffer into lines, and use std::getline directly. Simplify no_lbr and boltedcollection handling as well. Test Plan: For a large fdata file (200MB), fstream version is ~10% faster. | 1 年前 | |
[BOLT][merge-fdata] Fix basic sample profile aggregation without LBR info (#118481) When a basic sample profile is gathered without LBR info, the generated profile contains a "no-lbr" tag in the first line of the fdata file. This PR fixes merge-fdata to recognize and save this tag to the output file. | 1 年前 | |
| 1 年前 | ||
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT][NFC] Add keep-nops option to non-empty-debug-line.test (#137812) On openSUSE distribution test is failing due to different .debug_line size without the keep-nops option | 1 年前 | |
[BOLT] Fix tests that were unresolved when using lit's internal shell These two tests were unresolved when using lit's internal shell. In the case of tail-duplication-constant-prop, it was because they were using a echo $? line, and lit's internal echo implementation does not support $? to get the return code. The test was never actually asserting anything about the return code though, so I've removed the echo commands. In the case of permission.test, it was because umask was not supported before #155850, and afterwards not without an argument. The test also was not great at capturing what it was supposed to (leaving open possibilites like the system umask and what Bolt was using happening to match), so I've rewritten the test in the style of llvm/test/tools/llvm-objcopy/ELF/respect-umask.test. This fixes #102693. Reviewers: maksfb, yota9, ayermolo, yozhu, aaupov, rafaelauler, paschalis-mpeis Reviewed By: maksfb Pull Request: https://github.com/llvm/llvm-project/pull/156082 | 11 个月前 | |
[BOLT][test] enable GNU extensions, use C++ compiler, remove unnecessary target (#117043) 1. With a Clang that doesn't default to GNU extensions they need to be enabled explicitly. 2. The X86 directory lit config sets it already, there's no reason for this test to do it by itself. 3. The C frontend executable will fail if there's for example a Clang resource file for the C++ mode that sets C++-specific options: + /home/tambre/dev/llvm/build/bin/clang --target=x86_64-unknown-linux-gnu -fPIE -fuse-ld=lld -Wl,--unresolved-symbols=ignore-all -pie -fPIC -shared /home/tambre/dev/llvm/bolt/test/R_ABS.pic.lld.cpp -o /home/tambre/dev/llvm/build/tools/bolt/test/Output/R_ABS.pic.lld.cpp.tmp.so -Wl,-q -fuse-ld=lld clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] error: invalid argument '-std=c23' not allowed with 'C++' | 1 年前 | |
[BOLT][print] Add option '--print-only-file' (NFC) (#168023) With this option we can pass to BOLT names of functions to be printed through a file instead of specifying them all on command line. | 9 个月前 | |
[BOLT] Fix debug line emission for functions in multiple compilation units (#151230) This patch fixes a bug in BOLT's debug line emission where functions that belong to multiple compilation units (such as inline functions in header files) were not handled correctly. Previously, BOLT incorrectly assumed that a binary function could belong to only one compilation unit, leading to incomplete or incorrect debug line information. ### **Problem** When a function appears in multiple compilation units (common scenarios include): * Template instantiated functions * Inline functions defined in header files included by multiple source files BOLT would only emit debug line information for one compilation unit, losing debug information for other CUs where the function was compiled. This resulted in incomplete debugging information and could cause debuggers to fail to set breakpoints or show incorrect source locations. ### **Root Cause** The issue was in BOLT's assumption that each binary function maps to exactly one compilation unit. However, when the same function (e.g., an inline function from a header) is compiled into multiple object files, it legitimately belongs to multiple CUs in the final binary. | 11 个月前 | |
[BOLT] Fix program-header.test | 1 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT] Fix reorder data test for RISC-V (#68996) On RISC-V, small data objects are put in the .sdata section by default. This causes the reorder-data-writable-ptload.c test to fail since it hard-codes the section to optimize to .data. This patch passes the -fPIC -pie flags to clang to ensure the objects are added to .data on RISC-V. | 2 年前 | |
[BOLT][DWARF][NFC] Added double escape characters (#93348) Added double escape characters to lines that describe a test. | 2 年前 | |
[BOLT] Improve regexp in link_fdata.py (#152694) FileCheck accepts both '#' and '//' as leading chars for commands, but link_fdata.py only searched for lines starting with '#'. This changes the regexps in link_fdata.py to mirror FileCheck's behaviour. The comment syntax in test/timers.c is modified to present this capability. | 11 个月前 | |
[BOLT] Require non root user for unreadable-profile.test (#119816) This patch adds a requirement for a non root user in unreadable-profile.test. This test fails if run as a root user (like in a container without explicitly changing the user), which can lead to some CI test failures. | 1 年前 | |
[BOLT] Skip the validation of CFG after it is finalized When current state is CFG_Finalized, function validateCFG() should return true directly. Reviewed By: maksfb, yota9, Kepontry Differential Revision: https://reviews.llvm.org/D159410 | 2 年前 | |
[BOLT][test] Replace /dev/null with temp file (#73485) NFC processing time script identifies tests by output filename. When /dev/null is used as output filename, we're unable to tell the source test, and the reports are unhelpful. Replace /dev/null/ with %t.null which resolves the issue. | 2 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 8 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 9 个月前 | ||
| 10 个月前 | ||
| 9 个月前 | ||
| 9 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 11 个月前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 9 个月前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 11 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 |