aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide
AgeCommit message (Collapse)AuthorFilesLines
15 hours[IR2Vec][llvm-ir2vec] Changing clEnumValN to cl::SubCommand (#151384)S. VenkataKeerthy1-58/+62
Refactor llvm-ir2vec to use subcommands instead of a mode flag for better CLI usability. - Converted the `--mode` flag to three distinct subcommands: `triplets`, `entities`, and `embeddings` - Updated documentation, tests, and python script
46 hours[llvm] Proofread *.rst (#151087)Kazu Hirata8-15/+15
This patch hyphenates words that are used as adjecives, such as: - architecture specific - human readable - implementation defined - language independent - language specific - machine readable - machine specific - target independent - target specific
47 hours[Docs] Update Opt's Option to Specify Pass Pipeline (NFC) (#148402)veera1-5/+5
Since the new pass manager, we use `--passes=<string>` to specify the pass pipeline instead of the `-{passname}` syntax.
3 days[lit] Optionally exclude xfail tests (#151191)Mircea Trofin1-0/+5
See the related issue. We want to set up a build bot where `opt` runs with `-enable-profcheck`, which inserts `MD_prof` before running the rest of the pipeline requested from `opt`, and then validates resulting profile information (more info in the RFC linked by the aforementioned issue) In that setup, we will also ignore `FileCheck`: while the profile info inserted is, currently, equivalent to the profile info a pass would observe via `BranchProbabilityInfo`/`BlockFrequencyInfo`, (1) we may want to change that, and (2) some tests are quite sensitive to the output IR, and break if, for instance, extra metadata is present (which it would be due to `-enable-profcheck`). Since we're just interested in profile consistency on the upcoming bot, ignoring `FileCheck` is simpler and sufficient. However, this has the effect of passing XFAIL tests. Rather than listing them all, the alternative is to just exclude XFAIL tests. This PR adds support for that by introducing a `--exclude-xfail` option to `llvm-lit`. Issue #147390
4 days[IR2Vec] Add triplet generation utility script for vocabulary training (#149215)S. VenkataKeerthy1-0/+3
Added a Python utility script for generating IR2Vec triplets and updated documentation to reference it. The script generates triplets in a form suitable for training the vocabulary. (Tracking issues - #141817, #141834; closes - #141834)
5 days[IR2Vec][llvm-ir2vec] Revamp triplet generation and add entity mapping mode ↵S. VenkataKeerthy1-13/+66
(#149214) Add entity mapping mode to llvm-ir2vec and improve triplet generation format for knowledge graph embedding training. This change streamlines the workflow for training the vocabulary embeddings with IR2Vec by: 1. Directly generating numeric IDs instead of requiring string-to-ID preprocessing 2. Providing entity mappings in standard knowledge graph embedding format 3. Structuring triplet output in train2id format compatible with knowledge graph embedding frameworks 4. Adding metadata headers to simplify post-processing and training setup These improvements make IR2Vec more compatible with standard knowledge graph embedding training pipelines and reduce the preprocessing steps needed before training. See #149215 for more details on how it is used. (Tracking issues - #141817, #141834)
13 days[llvm-objdump] Add inlined function display support (#142246)gulfemsavrun1-10/+16
This patch adds the support for displaying inlined functions into llvm-objdump. 1) It extends the source variable display support for inlined functions both for ascii and unicode formats. 2) It also introduces a new format called limits-only that only prints a line for the start and end of an inlined function without line-drawing characters.
2025-07-17[IR2Vec] Adding documentation for llvm-ir2vec tool (#148719)S. VenkataKeerthy2-0/+171
Tracking issues - #141817, #141834
2025-06-25[llvm-objdump] Support --symbolize-operand on AArch64Alexis Engelke1-1/+1
Similar to the existing implementations for X86 and PPC, support symbolizing branch targets for AArch64. Do not omit the address for ADRP as the target is typically not at an intended location. Pull Request: https://github.com/llvm/llvm-project/pull/145009
2025-06-18[Remarks] Remove yaml-strtab format (#144527)Tobias Stadler1-1/+0
Background: The yaml-strtab format looks just like the yaml format, except that the values in the key/value pairs of the remarks are deduplicated and replaced by indices into a string table (see removed test cases for examples). The motivation behind this format was to reduce size of the remarks files. However, it was quickly superseded by the bitstream format. Therefore, remove the yaml-strtab format, as it doesn't have a good usecase anymore: - It isn't particularly efficient - It isn't human-readable - It isn't straightforward to parse in external tools that can't use the remarks library. We don't even support it in opt-viewer. llvm-remarkutil is also missing options to parse/convert yaml-strtab, so the chance that anyone is actually using this format is low.
2025-06-16[llvm-debuginfo-analyzer] Fix ODR violation in llvm::logicalview::LVObject ↵Javier Lopez-Gomez1-2/+1
(#140265) Some data members are only part of a class definition in a Debug build, e.g. `LVObject::ID`. If `debuginfologicalview` is used as a library, `NDEBUG` cannot be used for this purpose, as this PP macro may have a different definition in a downstream project, which in turn triggers an ODR violation. Fix it by - Making `LVObject::ID` an unconditional data member. - Making `LVObject::dump()` non-virtual. Rationale: `virtual` is not needed (and it calls `print()`, which is virtual anyway). Fixes #139098.
2025-06-13Reland "[llvm-cov] Add support for baseline coverage" (#144130)Fabian Meumertzheim1-0/+15
When no profile is provided, but the new --empty-profile option is specified, the export/report/show commands now emit coverage data equivalent to that obtained from a profile with all zero counters ("baseline coverage"). This is useful for build systems (e.g. Bazel) that can track coverage information for each build target, even those that are never linked into tests and thus don't have runtime coverage data recorded. By merging in baseline coverage, lines in files that aren't linked into tests are correctly reported as uncovered. Reland with fixes to `CoverageMappingTest.cpp`. Reverts llvm/llvm-project#144121
2025-06-13Revert "[llvm-cov] Add support for baseline coverage" (#144121)Keith Smiley1-15/+0
Reverts llvm/llvm-project#117910 ``` /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp /home/buildbots/llvm-external-buildbots/workers/ppc64le-lld-multistage-test/ppc64le-lld-multistage-test/llvm-project/llvm/unittests/ProfileData/CoverageMappingTest.cpp:281:28: error: 'std::reference_wrapper' may not intend to support class template argument deduction [-Werror,-Wctad-maybe-unsupported] 281 | std::make_optional(std::reference_wrapper(*ProfileReader)); | ^ /usr/lib/gcc/ppc64le-redhat-linux/8/../../../../include/c++/8/bits/refwrap.h:289:11: note: add a deduction guide to suppress this warning 289 | class reference_wrapper | ^ ```
2025-06-13[llvm-cov] Add support for baseline coverage (#117910)Fabian Meumertzheim1-0/+15
When no profile is provided, but the new --empty-profile option is specifed, the export/report/show commands now emit coverage data equivalent to that obtained from a profile with all zero counters ("baseline coverage"). This is useful for build systems (e.g. Bazel) that can track coverage information for each build target, even those that are never linked into tests and thus don't have runtime coverage data recorded. By merging in baseline coverage, lines in files that aren't linked into tests are correctly reported as uncovered.
2025-06-11[llvm] Add a tool to check mustache compliance against the public spec (#142813)Paul Kirth2-0/+38
This is a cli tool to that tests the conformance of LLVM's mustache implementation against the public Mustache spec, hosted at https://github.com/mustache/spec. This is a revised version of the patches in #111487. Co-authored-by: Peter Chou <peter.chou@mail.utoronto.ca>
2025-06-06[llvm-debuginfo-analyzer] Add support for parsing DWARF / CodeView ↵Javier Lopez-Gomez1-1/+3
SourceLanguage (#137223) This pull request adds support for parsing the source language in both DWARF and CodeView. Specifically, - The `LVSourceLanguage` class is introduced to represent any supported language by any of the debug info representations. - Update `LVDWARFReader.cpp` and `LVCodeViewVisitor.cpp` to parse the source language where it applies. Added a new `=Language` attribute; `getAttributeLanguage()` is internally used to control whether this information is being printed.
2025-06-06[symbolizer] Update Release notes. (#142951)Ebuka Ezike1-0/+3
Also add post-commit changes from commit #71ba852 in PR #135857 --------- Co-authored-by: James Henderson <James.Henderson@sony.com>
2025-06-06[lit] show retry attempts (#142413)Konrad Kleine1-0/+8
If a test took more than one attempt to complete, show the number of attempts and the maximum allowed attempts as `2 of 4 attempts` inside the `<progress info>` (see [TEST RUN OUTPUT FORMAT](https://llvm.org/docs/CommandGuide/lit.html#test-run-output-format)). NOTE: Additionally this is a fixup for #141851 where the tests were not quite right. `max-retries-per-test/allow-retries-test_retry_attempts/test.py` was added but never used there. Now we're calling it. To correlate better between the test output and the test script I've used higher numbers of max allowed retries.
2025-06-04[docs] don't use "=" in lit options with arguments (#142340)Konrad Kleine1-14/+14
This is a fixup for #141851 and removes `=` from all options with additional arguments. Before 14 out of 22 options with arguments used "=" and 7 didn't.
2025-05-31[lit] add --max-retries-per-test execution option (#141851)Konrad Kleine1-0/+13
When packaging LLVM we've seen arbitrary tests fail. It happened sporadically and most of the times the test do work if they are run a second time on the next day. The tests themselves were always different and we didn't know ahead of time which ones we wanted to re-run. That's we filter-out a lot of `libomp` and `libarcher` tests [1]. This change allows us to set `LIT_OPTS="--max-retries-per-test=12"` when running any "check-XXX" build target. Then any lit test will at most be re-run 12 times, unless there's an `ALLOW_RETRIES:` in one of the test scripts that's specifying a different value than `12`. `12` is just an example here, any positive integer will work. Please note, that this only adds the possibility to re-run lit tests. It does not actually do it until the caller specifies `--max-retries-per-test=<POSITIVE_INT>` either on a call to `lit` or in `LIT_OPTS`. Also note, that one can still use `ALLOW_RETRIES:` in test scripts and it will always rule over `--max-retries-per-test`. When `--max-retries-per-test` is set too low, but the `config.test_retry_attempts` is high enough, it works as well. Any option in the list below overrules its predecessor: * `--max-retries-per-test` * `config.test_retry_attempts` * `ALLOW_RETRIES` keyword From the above options to re-run tests, `--max-retries-per-test` is the only one that doesn't require a change in the test scripts or the test config. [1]: https://src.fedoraproject.org/rpms/llvm/blob/rawhide/f/llvm.spec#_2326 Downstream PR to make use of the `--max-retries-per-test` option: https://src.fedoraproject.org/rpms/llvm/pull-request/434 Downstream ticket: https://issues.redhat.com/browse/LLVM-145
2025-05-24[llvm-exegesis][Docs] --dump-object-to-disk option is specified by filename ↵Jim Lin1-1/+1
rather than bool (#141178)
2025-05-23[llvm] Fix a typo in documentation (#141204)Kazu Hirata1-1/+1
2025-05-23Extend llvm objdump fatbin (#140286)David Salinas1-1/+1
Utilize the new extensions to the LLVM Offloading API to extend to llvm-objdump to handle dumping fatbin offload bundles generated by HIP. This extension to llvm-objdump adds the option --offload-fatbin. Specifying this option will take the input object/executable and extract all offload fatbin bundle entries into distinct code object files with names reflecting the source file name combined with the Bundle Entry ID. Users can also use the --arch-name option to filter offload fatbin bundle entries by their target triple. --------- Co-authored-by: dsalinas <dsalinas@MKM-L1-DSALINAS.amd.com>
2025-05-22[llvm] Fix typos in documentation (#141078)Kazu Hirata2-2/+2
2025-05-22[llvm-debuginfo-analyzer] Add support for DWARF `DW_AT_byte_size` (#139110)Javier Lopez-Gomez1-1/+4
This PR was split from https://github.com/llvm/llvm-project/pull/137228 (which introduced support for `DW_TAG_module` and `DW_AT_byte_size`). This PR improves `LVDWARFReader` by introducing handling of `DW_AT_byte_size`. Most DWARF emitters include this attribute for types to specify the size of an entity of the given type.
2025-05-21[llvm-debuginfo-analyzer] Support DW_TAG_module (#137228)Javier Lopez-Gomez1-1/+2
- Adds support for `DW_TAG_module` DIEs and recurse over their children. Prior to this patch, entities hanging below `DW_TAG_module` were just not visible. This DIE kind is commonly generated by Objective-C modules. This patch will represent such entities, which will print as ``` [001] {CompileUnit} '/llvm/tools/clang/test/modules/<stdin>' [002] {Producer} 'LLVM version 3.7.0' {Directory} '/llvm/tools/clang/test/modules' {File} '<stdin>' [002] {Module} 'DebugModule' ``` The minimal test case included is just the result of ``` $ llc llvm/test/DebugInfo/X86/DIModule.ll -accel-tables=Dwarf -o llvm/unittests/DebugInfo/LogicalView/Inputs/test-dwarf-clang-module.o -filetype=obj ```
2025-05-16Revert "Reapply: [llvm-objdump] Add support for HIP offload bundles (#140128)"Kazu Hirata1-1/+1
This reverts commit 910220b84fa18ce2cbb2e21dd53b9f3d0ae582a7. Multiple buildbot failures have been reported: https://github.com/llvm/llvm-project/pull/140128
2025-05-16Reapply: [llvm-objdump] Add support for HIP offload bundles (#140128)David Salinas1-1/+1
Utilize the new extensions to the LLVM Offloading API to extend to llvm-objdump to handle dumping fatbin offload bundles generated by HIP. This extension to llvm-objdump adds the option --offload-fatbin. Specifying this option will take the input object/executable and extract all offload fatbin bundle entries into distinct code object files with names reflecting the source file name combined with the Bundle Entry ID. Users can also use the --arch-name option to filter offload fatbin bundle entries by their target triple. --------- Co-authored-by: dsalinas <dsalinas@MKM-L1-DSALINAS.amd.com>
2025-05-08Revert "[llvm-objdump] Add support for HIP offload bundles (#114834)"Kazu Hirata1-1/+1
This reverts commit 06d6623bc304d5fc2fe11b80b62b4c5d10f9eaa1. Buildbot failure: https://lab.llvm.org/buildbot/#/builders/145/builds/6871/steps/5/logs/stdio
2025-05-08[llvm-objdump] Add support for HIP offload bundles (#114834)David Salinas1-1/+1
Utilize the new extensions to the LLVM Offloading API to extend to llvm-objdump to handle dumping fatbin offload bundles generated by HIP. This extension to llvm-objdump adds the option --offload-fatbin. Specifying this option will take the input object/executable and extract all offload fatbin bundle entries into distinct code object files with names reflecting the source file name combined with the Bundle Entry ID. Users can also use the --arch-name option to filter offload fatbin bundle entries by their target triple. --------- Co-authored-by: dsalinas <dsalinas@MKM-L1-DSALINAS.amd.com>
2025-05-02llvm-reduce: Fix trailing whitespace in command guide (#138240)Matt Arsenault1-15/+15
2025-04-28Clarify `lit`'s definition of failure and conditions when it exits with exit ↵i-ky1-5/+8
code 1 (#136190) Documentation of when `lit` exits with code 1 is out of date. It is no longer just "FAIL or XPASS", there are more failure types: https://github.com/llvm/llvm-project/blob/b30100b87f24847afd6407b4939a184ebcf16ef9/llvm/utils/lit/lit/Test.py#L51-L55 Exit code can also be affected by `--ignore-fail` option: https://github.com/llvm/llvm-project/blob/b30100b87f24847afd6407b4939a184ebcf16ef9/llvm/utils/lit/lit/main.py#L154-L162 This PR extracts a clear definition of "failure" from the description of `--report-failures-only` option: https://github.com/llvm/llvm-project/blob/b30100b87f24847afd6407b4939a184ebcf16ef9/llvm/docs/CommandGuide/lit.rst?plain=1#L194-L196 ...puts it into "Test Status Results" section and references it when describing exit codes and `--ignore-fail` option.
2025-04-08[llc] Add -M for InstPrinter optionsFangrui Song1-0/+5
For many targets, llvm-objdump and llvm-mc (https://reviews.llvm.org/D103004) support -M no-aliases (e.g. `RISCVInstPrinter::applyTargetSpecificCLOption`). This patch implements -M for llc. While here, rename "DisassemblerOptions" in llvm-mc to the more appropriate "InstPrinterOptions". For llvm-mc --assemble, there is no disassembler involved. Pull Request: https://github.com/llvm/llvm-project/pull/121078
2025-04-02llvm-reduce: Change exit code for uninteresting inputs (#134021)Matt Arsenault1-2/+3
This makes it easier to reduce llvm-reduce with llvm-reduce to filter cases where the input reduced too much. Not sure if it's possible to test the exit code in lit.
2025-03-31Add RISC-V support information to readme (#132699)AnastasiyaChernikova1-4/+5
2025-03-29llvm-reduce: Do not assert if the input is no longer interesting (#133386)Matt Arsenault1-0/+6
If the interestingness script is flaky, we should not assert. Print a warning, and continue. This could still happen as a result of an llvm-reduce bug, so make a note of that. Add a --skip-verify-interesting-after-counting-chunks option to avoid the extra run of the reduction script, and to silence the warning.
2025-03-25[MCA] Extend -instruction-tables option with verbosity levels (#130574)Julien Villette1-1/+19
Option becomes: -instruction-tables=`<level>` The choice of `<level>` controls number of printed information. `<level>` may be `none` (default), `normal`, `full`. Note: If the option is used without `<label>`, default is `normal` (legacy). When `<level>` is `full`, additional information are: - `<Bypass Latency>`: Latency when a bypass is implemented between operands in pipelines (see SchedReadAdvance). - `<LLVM Opcode Name>`: mnemonic plus operands identifier. - `<Resources units>`: Used resources associated with LLVM Opcode. - `<instruction comment>`: reports comment if any from source assembly. Level `full` can be used to better check scheduling info when TableGen is modified. LLVM Opcode name help to find right instruction regexp to fix TableGen Scheduling Info. -instruction-tables=full option is validated on AArch64/Neoverse/V1-sve-instructions.s Follow up of MR #126703 --------- Co-authored-by: Julien Villette <julien.villette@sipearl.com>
2025-03-24Reapply "lit: Move RUN at line comment after the command."Peter Collingbourne1-1/+1
This reverts commit 57e89c97c2c1b4e41f07a90c2f4d36649696e619. Updated lit tests.
2025-03-24Revert "lit: Move RUN at line comment after the command."Peter Collingbourne1-1/+1
This reverts commit 8d3dc1ed5656a3e69e4195d58684a7f4bf0ff5cc. Test needs to be updated.
2025-03-24lit: Move RUN at line comment after the command.Peter Collingbourne1-1/+1
When a developer copy/pastes a failing command line into their shell to rerun it, they have to manually delete the "RUN: at line N:" prefix. To make life easier for such developers, let's make it possible to copy/paste a command without needing to modify it while still showing the line number in the output by moving the line number to a comment at the end of the command line. Reviewers: jroelofs, MaskRay Reviewed By: jroelofs, MaskRay Pull Request: https://github.com/llvm/llvm-project/pull/132485
2025-03-17[docs] Mention --discard-locals/--discard-all change for llvm-stripFangrui Song1-4/+5
PR #130704 updated llvm-strip as well. Suggested by @nga888 Pull Request: https://github.com/llvm/llvm-project/pull/131491
2025-03-11[llvm-objcopy,ELF] --discard-locals/--discard-all: allow and keep symbols ↵Fangrui Song1-4/+5
referenced by relocations In GNU objcopy, symbols referenced by relocations are retained. Our COFF (https://reviews.llvm.org/D56480) and Mach-O (https://reviews.llvm.org/D75104) ports port the behavior, but the ELF port doesn't. This PR implements the behavior for ELF. Close #47468 (tcl has a use case that requires `strip -x tclStubLib.o` to strip local symbols not referenced by relocations.) Pull Request: https://github.com/llvm/llvm-project/pull/130704
2025-01-23Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"Igor Kudrin1-0/+5
This fixes "unused-local-typedef" warnings in 9324e6a7a5. This adds an option `--remove-note=[name/]type` to selectively delete notes in ELF files, where `type` is the numeric value of the note type and `name` is the name of the originator. The name can be omitted, in which case all notes of the specified type will be removed. For now, only `SHT_NOTE` sections that are not associated with segments are handled. The implementation can be extended later as needed. RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491
2025-01-23Revert "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"Igor Kudrin1-5/+0
This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.
2025-01-23[llvm-objcopy][ELF] Add an option to remove notes (#118739)Igor Kudrin1-0/+5
This adds an option `--remove-note=[name/]type` to selectively delete notes in ELF files, where `type` is the numeric value of the note type and `name` is the name of the originator. The name can be omitted, in which case all notes of the specified type will be removed. For now, only `SHT_NOTE` sections that are not associated with segments are handled. The implementation can be extended later as needed. RFC: https://discourse.llvm.org/t/rfc-llvm-objcopy-feature-for-editing-notes/83491
2025-01-14Revert "Reland: "[Exegesis] Add the ability to dry-run the measurement phase ↵Min Hsu1-1/+0
(#121991)" (#122775)" This reverts commit a39aaf35d3858a5542f532e399482c2bb0259dac and 63d3bd6d0caf8185aba49540fe2f67512fdf3a98. Due to test failures on MacOSX.
2025-01-13Reland: "[Exegesis] Add the ability to dry-run the measurement phase ↵Min-Yih Hsu1-0/+1
(#121991)" (#122775) This relands f8f8598fd886cddfd374fa43eb6d7d37d301b576 Follow up on #122371: The problem here is a little subtle: when we dry-run the measurement phase, we create a LLJIT instance without actually executing the snippets. The key is, LLJIT has its own TargetMachine which uses triple designated by LLVM_TARGET_ARCH (which is default to host). On a machine that does not support Exegesis, the LLJIT would fail to create its TargetMachine because llvm-exegesis don't even register the host's target! Putting this test into any of the target-specific folder won't help, because it's about the host. And personally I don't really want to use `exegesis-can-execute-<arch>` for generic tests like this -- it's too strict as we don't actually need to execute the snippet. My solution here is creating another test feature which is added only when LLVM_TARGET_ARCH is supported by llvm-exegesis. This feature is something in between `<arch>-registered-target` and `exegesis-can-execute-<arch>`.
2025-01-09Revert "[Exegesis] Add the ability to dry-run the measurement phase (… ↵Min-Yih Hsu1-1/+0
(#122371) …#121991)" This reverts commit f8f8598fd886cddfd374fa43eb6d7d37d301b576. This breaks ARMv7 and s390x buildbot with the following message: ``` llvm-exegesis error: No available targets are compatible with triple "armv8l-unknown-linux-gnueabihf" FileCheck error: '<stdin>' is empty. FileCheck command line: /home/tcwg-buildbot/worker/clang-armv7-2stage/stage2/bin/FileCheck /home/tcwg-buildbot/worker/clang-armv7-2stage/llvm/llvm/test/tools/llvm-exegesis/dry-run-measurement.test ```
2025-01-09[Exegesis] Add the ability to dry-run the measurement phase (#121991)Min-Yih Hsu1-0/+1
With the new benchmark phase, `dry-run-measurement`, llvm-exegesis can run everything except the actual snippet execution. It is useful when we want to test some parts of the code between the `assemble-measured-code` and `measure` phase without actually running on native platforms.
2024-12-24[llvm-exegesis][Docs] Add documentation on benchmark-process-cpu optionAiden Grossman1-0/+8
This patch adds documentation on the benchmark-process-cpu option. I apparently did not add any documentation when originally implementing the feature.