aboutsummaryrefslogtreecommitdiff
path: root/llvm/docs/CommandGuide
AgeCommit message (Collapse)AuthorFilesLines
2023-08-30[symbolizer] Change reaction on invalid inputSerge Pavlov1-2/+2
If llvm-symbolizer finds a malformed command, it echoes it to the standard output. New versions of binutils (starting from 2.39) allow to specify an address by a symbols. Implementation of this feature in llvm-symbolizer makes the current reaction on invalid input inappropriate. Almost any invalid command may be treated as a symbol name, so the right reaction should be "symbol not found" in such case. The exception are commands that are recognized but have incorrect syntax, like "FILE:FILE:". The utility must produce descriptive diagnostic for such input and route it to the stderr. This change implements the new reaction on invalid input and is a prerequisite for implementation of symbol lookup in llvm-symbolizer. Differential Revision: https://reviews.llvm.org/D157210
2023-08-29[lit] Drop "Script:", make -v and -a imply -vvJoel E. Denny1-10/+9
This patch and D156954 were discussed in <https://discourse.llvm.org/t/rfc-improving-lits-debug-output/72839>. **Motivation**: -a shows output from all tests, and -v shows output from just failed tests. Without this patch, that output from each test includes a section called "Script:", which includes all shell commands that lit has computed from RUN directives and will attempt to run for that test. The effect of -vv (which also implies -v if neither -a or -v is specified) is to extend that output with shell commands as they are executing so you can easily see which one failed. For example, when using lit's internal shell and -vv: ``` Script: -- : 'RUN: at line 1'; echo hello world : 'RUN: at line 2'; 3c40 hello world : 'RUN: at line 3'; echo hello world -- Exit Code: 127 Command Output (stdout): -- $ ":" "RUN: at line 1" $ "echo" "hello" "world" hello world $ ":" "RUN: at line 2" $ "3c40" "hello" "world" '3c40': command not found error: command failed with exit status: 127 -- ``` Notice that all shell commands that actually execute appear in the output twice, once for "Script:" and once for -vv. Especially for tests with many RUN directives, the result is noisy. When searching through the output for a particular shell command, it is easy to get lost and mistake shell commands under "Script:" for shell commands that actually executed. **Change**: With this patch, a test's output changes in two ways. First, the "Script:" section is never shown. Second, omitting -vv no longer disables printing of shell commands as they execute. That is, -a and -v imply -vv, and so -vv is deprecated as it is just an alias for -v. **Secondary motivation**: We are also working to introduce a PYTHON directive, which can appear between RUN directives. How should PYTHON directives be represented in the "Script:" section, which has previously been just a shell script? We could probably think of something, but adding info about PYTHON directive execution in the -vv trace seems more straight-forward and more useful. (This patch also removes a confusing point in the -vv documentation: at least when using bash as an external shell, -vv echoes commands to the shell's stderr not stdout.) Reviewed By: awarzynski, Endill, ldionne, MaskRay Differential Revision: https://reviews.llvm.org/D154984
2023-08-24[llvm-cov] Support directory layout in coverage reportsYuhao Gu1-0/+5
This is a GSoC 2023 project ([discourse link](https://discourse.llvm.org/t/coverage-support-a-hierarchical-directory-structure-in-generated-coverage-html-reports/68239)). llvm-cov currently generates a single top-level index HTML file, which causes rendering scalability issues in large projects. This patch adds support for hierarchical directory structure into the HTML reports to solve scalability issues by introducing the following changes: - Added a new command line option `--show-directory-coverage` for `llvm-cov show`. It works both for `--format=html` and `--format=text`. - Two new classes: `CoveragePrinterHTMLDirectory` and `CoveragePrinterTextDirectory` was added to support the new option. - A tool class `DirectoryCoverageReport` was added to support the two classes above. - Updated the document. - Added a new regression test for `--show-directory-coverage`. Reviewed By: phosek, gulfem Differential Revision: https://reviews.llvm.org/D151283
2023-08-23[llvm-cov] Allow multiple remaps in --path-equivalenceTomas Camin1-1/+5
Previously the --path-equivalence parameter would allow to specify a single remap pair (coverage data path - local source file path). This patch changes this allowing to pass as many remaps as needed. Reviewed By: keith Differential Revision: https://reviews.llvm.org/D154223
2023-08-18Reland "[llvm-cov] Support multi-source object files for convert-for-testing"Yuhao Gu1-0/+22
`llvm-cov convert-for-testing` only functions properly when the input binary contains a single source file. When the binary has multiple source files, a `Malformed coverage data` error will occur when the generated .covmapping is read back. This is because the testing format lacks support for indicating the size of its file records, and current implementation just assumes there's only one record in it. This patch fixes this problem by introducing a new testing format version. Changes to the code: - Add a new format version. The version number is stored in the the last 8 bytes of the orignial magic number field to be backward-compatible. - Output a LEB128 number before the file records section to indicate its size in the new version. - Change the format parsing code correspondingly. - Update the document to formalize the testing format. - Additionally, fix the bug when converting COFF binaries. Reviewed By: phosek, gulfem Differential Revision: https://reviews.llvm.org/D156611
2023-08-13Fix typos in documentationChris Cotter1-1/+1
2023-08-12Revert "[symbolizer] Change reaction on invalid input"Douglas Yung1-2/+2
This reverts commit a5fe6c7f5e2d1d265bd7c312ef55259fee7a68f9. This change is causing problems with Windows build bots due to a hanging zombie llvm-symbolizer.exe process.
2023-08-12[symbolizer] Change reaction on invalid inputSerge Pavlov1-2/+2
If llvm-symbolizer finds a malformed command, it echoes it to the standard output. New versions of binutils (starting from 2.39) allow to specify an address by a symbols. Implementation of this feature in llvm-symbolizer makes the current reaction on invalid input inappropriate. Almost any invalid command may be treated as a symbol name, so the right reaction should be "symbol not found" in such case. The exception are commands that are recognized but have incorrect syntax, like "FILE:FILE:". The utility must produce descriptive diagnostic for such input and route it to the stderr. This change implements the new reaction on invalid input and is a prerequisite for implementation of symbol lookup in llvm-symbolizer. Differential Revision: https://reviews.llvm.org/D157210
2023-08-11[Docs][llvm-exegesis] Use double dash long optionsAiden Grossman1-33/+33
Currently the llvm-exegesis docs use a mix of double dash and single dash options with seemingly no pattern. This patch makes everything double dash options as it has been suggested that we should be advertising double dash long options exclusively in the documentation. Reviewed By: MaskRay Differential Revision: https://reviews.llvm.org/D157641
2023-08-04[Docs][llvm-link] Add documentation an CLI optionsAiden Grossman1-1/+54
Currently the documentation on the command line options for llvm-link is quite sparse. This patch adds in the options that the tool understands that aren't currently present in the documentation. Reviewed By: tejohnson, MaskRay Differential Revision: https://reviews.llvm.org/D155904
2023-08-02Fix LLVM Sphinx buildAaron Ballman1-6/+6
This addresses issues found by: https://lab.llvm.org/buildbot/#/builders/30/builds/38316 as well as issues found when building locally.
2023-08-02[RemarkUtil] Refactor llvm-remarkutil to include size-diffZain Jaffal3-223/+221
This change follows from https://reviews.llvm.org/D156416 We include `llvm-remark-size-diff` as a part of `llvm-remarkutil` under a subcommand `size-diff`. Differential Revision: https://reviews.llvm.org/D156515
2023-08-01[lit][clang] Avoid realpath on Windows due to MAX_PATH limitationsSaleem Abdulrasool1-0/+10
Running lit tests on Windows can fail because its use of `os.path.realpath` expands substitute drives, which are used to keep paths short and avoid hitting MAX_PATH limitations. Changes lit logic to: Use `os.path.abspath` on Windows, where `MAX_PATH` is a concern that we can work around using substitute drives, which `os.path.realpath` would resolve. Use `os.path.realpath` on Unix, where the current directory always has symlinks resolved, so it is impossible to preserve symlinks in the presence of relative paths, and so we must make sure that all code paths use real paths. Also updates clang's `FileManager::getCanonicalName` and `ExtractAPI` code to avoid resolving substitute drives (i.e. resolving to a path under a different root). How tested: built with `-DLLVM_ENABLE_PROJECTS=clang` and built `check-all` on both Windows Differential Revision: https://reviews.llvm.org/D154130 Reviewed By: @benlangmuir Patch by Tristan Labelle <tristan@thebrowser.company>!
2023-07-26[LIT] Added an option to llvm-lit to emit the necessary test coverage data, ↵Shivam Gupta1-0/+6
divided per test case This patch is the first part of https://llvm.org/OpenProjects.html#llvm_patch_coverage. We have first define a new variable LLVM_TEST_COVERAGE which when set, pass --per-test-coverage option to llvm-lit which will help in setting a unique value to LLVM_PROFILE_FILE for each RUN. So for example coverage data for test case llvm/test/Analysis/AliasSet/memtransfer.ll will be emitted as build/test/Analysis/AliasSet/memtransfer0.profraw Reviewed By: hnrklssn Differential Revision: https://reviews.llvm.org/D154280
2023-07-25[llvm-objcopy] --set-section-flags: allow "large" to add SHF_X86_64_LARGEThomas Köppe1-2/+5
Currently, objcopy cannot set the new flag SHF_X86_64_LARGE. This change introduces the named flag "large" which translates to that section flag. An "invalid argument" error is produced if a user attempts to set the flag on an architecture other than X86_64. Reviewed By: jhenderson, MaskRay Differential Revision: https://reviews.llvm.org/D153262
2023-07-21Revert "[LIT] Added an option to llvm-lit to emit the necessary test ↵Shivam Gupta1-6/+0
coverage data, divided per test case" This reverts commit d8e26bccb3016d255298b7db78fe8bf05dd880b2. Test case are meant to run only when LLVM_INDIVIDUAL_TEST_COVERAGE is set.
2023-07-21[LIT] Added an option to llvm-lit to emit the necessary test coverage data, ↵Shivam Gupta1-0/+6
divided per test case This patch is the first part of https://llvm.org/OpenProjects.html#llvm_patch_coverage. We have first define a new variable LLVM_TEST_COVERAGE which when set, pass --emit-coverage option to llvm-lit which will help in setting a unique value to LLVM_PROFILE_FILE for each RUN. So for example coverage data for test case llvm/test/Analysis/AliasSet/memtransfer.ll will be emitted as build/test/Analysis/AliasSet/memtransfer.profraw Reviewed By: hnrklssn Differential Revision: https://reviews.llvm.org/D154280
2023-07-19[TableGen] Deprecate old GI Combiner Emitterpvanhout1-4/+10
Will be removed in a month or so. Reviewed By: aemerson Differential Revision: https://reviews.llvm.org/D154939
2023-07-18[Docs][llvm-exegesis] Add documentation for memory annotationsAiden Grossman1-1/+47
Reviewed By: gchatelet Differential Revision: https://reviews.llvm.org/D151039
2023-07-17[lit] Remove the --no-indirectly-run-check optionLouis Dionne1-8/+2
This option had originally been added in D83069 to allow disabling the check that something is going to get run at all when a specific test name is used on the command-line. Since we now use getTestsForPath() (from D151664) to get the tests to run for a specific path, we don't need a specific check for this anymore -- Lit will produce the same complaint it would produce if you provided a directory with no tests. If one needs to run a specific test on the command-line and the Lit configuration would normally not include that test, the configuration should be set up as a "standalone" configuration or it should be fixed to allow for that test to be found (i.e. probably fix the allowed test suffixes). Differential Revision: https://reviews.llvm.org/D153967
2023-07-12[llvm-objdump] Default to --mcpu=future for PPC32Fangrui Song1-1/+1
Extend D127824 to the 32-bit Power architecture. AFAICT GNU objdump -d dumps all instructions for 32-bit as well. Reviewed By: #powerpc, nemanjai Differential Revision: https://reviews.llvm.org/D155114
2023-07-06[AIX][XCOFF] print out the traceback infozhijian1-0/+4
Summary: Adding a new option -traceback-table to print out the traceback info of xcoff ojbect file. Reviewers: James Henderson, Fangrui Song, Stephen Peckham, Xing Xue Differential Revision: https://reviews.llvm.org/D89049
2023-06-26[llvm-libtool-darwin] Switch to OptTableSummaryAndres Villegas1-9/+0
Switch the parse of command line options fromllvm::cl to OptTable. The motivation for this change is to continue adding llvm based tools to the llvm driver multicall. Differential Revision: https://reviews.llvm.org/D153665
2023-06-06[InstrProf] Use BalancedPartitioning to order temporal profiling trace dataEllis Hoag1-0/+35
In [0] we described an algorithm called //BalancedPartitioning// (bp) to consume function traces [1] and compute a function order that reduces the number of page faults during startup. This patch adds the `order` command to the `llvm-profdata` tool which uses bp to output a function order that can be passed to the linker via `--symbol-ordering-file=`. Special thanks to Sergey Pupyrev and Julian Mestre for designing this balanced partitioning algorithm. [0] https://discourse.llvm.org/t/rfc-temporal-profiling-extension-for-irpgo/68068 [1] https://reviews.llvm.org/D147287 Reviewed By: spupyrev Differential Revision: https://reviews.llvm.org/D147812
2023-06-04[Docs][llvm-mc] Fix location of statementAiden Grossman1-4/+3
The comment moved is referring to the --output-asm-syntax flag rather than the --print-imm-hex flag, but seems to have mistakenly been put under the definition of that flag due to some misplaced line numbers on phabricator.
2023-05-26[Remarks] Retain all remarks by default, add option to drop without DL.Florian Hahn1-0/+4
At the moment, dsymutil drops all remarks without debug location. There are many cases where debug location may be missing for remarks, mostly due LLVM not preserving debug locations. When using bitstream remarks for statistical analysis, those missed remarks mean we get an incomplete picture. The patch flips the default to keeping all remarks and leaving it to tools that display remarks to filter out remarks without debug locations as needed. The new --remarks-drop-without-debug flag can be used to drop remarks without debug locations, i.e. restore the previous behavior. Reviewed By: thegameg Differential Revision: https://reviews.llvm.org/D151089
2023-05-16[Docs][llvm-exegesis] Specify platform support for different modesAiden Grossman1-2/+4
llvm-exegesis has both a capture mode and an analysis mode that can be used independently of each other. This patch makes it clear that analysis mode will work on other platforms that LLVM supports in the documentation which was unclear before. Reviewed By: courbet Differential Revision: https://reviews.llvm.org/D150536
2023-05-13[Docs][llvm-exegesis] Specify supported platforms and architecturesAiden Grossman1-0/+7
Currently, there is no documentation on what platforms and architectures llvm-exegesis is supported on. This patch adds in user-facing documentation in the CommandGuide about what architectures are supported as well as developer facing documentation detailing the technical reasons for why certain platforms are supported and some aren't. This is a follow-up after discussion in https://discourse.llvm.org/t/clarification-on-platform-support-for-llvm-exegesis/70206. Reviewed By: kpdev42 Differential Revision: https://reviews.llvm.org/D149378
2023-05-12[llvm] Fix typos in documentationKazu Hirata2-2/+2
2023-05-02[docs] Prefer --target= -masm=intel to -target -mllvm -x86-asm-syntax=intelFangrui Song1-2/+2
2023-05-02[RISCV][RISCV][clang] Split out SiFive Vector C intrinsics from riscv_vector.td4vtomat1-0/+8
Since we don't always need the vendor extension to be in riscv_vector.td, so it's better to make it be in separated header. Depends on D148223 and D148680 Differential Revision: https://reviews.llvm.org/D148308
2023-04-18[llvm-remarkutil] Add an option to display DebugLoc when collecting counts ↵Zain Jaffal1-2/+14
for remarks. Reviewed By: paquette Differential Revision: https://reviews.llvm.org/D148374
2023-04-13[InstrProf][Temporal] Add weight field to tracesEllis Hoag1-0/+12
As discussed in [0], add a `weight` field to temporal profiling traces found in profiles. This allows users to use the `--weighted-input=` flag in the `llvm-profdata merge` command to weight traces from different scenarios differently. Note that this is a breaking change, but since [1] landed very recently and there is no way to "use" this trace data, there should be no users of this feature. We believe it is acceptable to land this change without bumping the profile format version. [0] https://reviews.llvm.org/D147812#4259507 [1] https://reviews.llvm.org/D147287 Reviewed By: snehasish Differential Revision: https://reviews.llvm.org/D148150
2023-04-13[Docs] Point to the correct bug trackerJun Zhang1-1/+1
Signed-off-by: Jun Zhang <jun@junz.org>
2023-04-10[Docs][llvm-exegesis] Add documentation for --use-dummy-perf-countersAiden Grossman1-0/+7
This patch adds in documentation for the --use-dummy-perf-counters option (introduced in D146301). Reviewed By: kpdev42 Differential Revision: https://reviews.llvm.org/D147842
2023-04-08[Docs][llvm-remarkutil] Fix dangling reference in documentationAiden Grossman1-0/+2
D147710 introduced a new annotation-count subcommand to llvm-remarkutil and added in documentation. However, the reference added under the subcommands list never actually pointed to anything. This patch adds a marker for the reference to point to so that the link works and the sphinx build finishes without any errors.
2023-04-07[llvm-remarkutil] Add missing new line for ↵Zain Jaffal1-0/+1
`llvm/docs/CommandGuide/llvm-remarkutil.rst`
2023-04-07Recommit "Add an option to print out annotation remark count."Zain Jaffal1-1/+22
Add missing new line for `llvm/docs/CommandGuide/llvm-remarkutil.rst` This reverts commit 0f7fcb4c670fbef2c25b835fdfdd29598c6c13ae.
2023-04-07Revert "Add an option to print out annotation remark count."Zain Jaffal1-22/+1
This reverts commit 7cc80ef5fa359b68ee85033f98b1bef1f37fb21c.
2023-04-07Add an option to print out annotation remark count.Zain Jaffal1-1/+22
This adds a `annotation-count` option to llvm-remarkutil. ``` llvm-remarkutil annotation-count -remark=REMARK ``` This will print out the remark count for a pass that uses annotation remarks. Differential Revision: https://reviews.llvm.org/D147710
2023-04-06[Docs][typo] Done the required fix for the #61690aabhinavg1-0/+9
Differential Revision: https://reviews.llvm.org/D146898
2023-03-30fix docs warning in llvm-profdata.rstwlei1-2/+2
2023-03-30[AutoFDO] Use flattened profiles for profile staleness metricswlei1-0/+6
For profile staleness report, before it only counts for the top-level function samples in the nested profile, the samples in the inlinees are ignored. This could affect the quality of the metrics when there are heavily inlined functions. This change adds a feature to flatten the nested profile and we're changing to use flatten profile as the input for stale profile detection and matching. Example for profile flattening: ``` Original profile: _Z3bazi:20301:1000 1: 1000 3: 2000 5: inline1:1600 1: 600 3: inline2:500 1: 500 Flattened profile: _Z3bazi:18701:1000 1: 1000 3: 2000 5: 600 inline1:600 inline1:1100:600 1: 600 3: 500 inline2: 500 inline2:500:500 1: 500 ``` This feature could be useful for offline analysis, like understanding the hotness of each individual function. So I'm adding the support to `llvm-profdata merge` under `--gen-flattened-profile`. Reviewed By: hoy, wenlei Differential Revision: https://reviews.llvm.org/D146452
2023-03-30[Docs][llvm-cov] Correct flag name.Daniel Thornburgh1-3/+3
2023-03-27[dsymutil] Add the ability to generate universal binaries with a fat64 headerJonas Devlieghere1-0/+4
Add the ability to generate universal binaries with a fat64 header. rdar://107223939 Differential revision: https://reviews.llvm.org/D146879
2023-03-27[Docs][llvm-exegesis] Refactor snippet annotations in documentationAiden Grossman1-10/+29
Currently, the llvm-exegesis documentation page has all snippet annotation information under an example. This patch refactors the annotation documentation to a separate section to make things more clear and to make adding future annotations easier. This patch also significantly expands the documentation on the memory scratch space to which a pointer can be passed through a register as the documentation on this was quite sparse previously. Reviewed By: courbet Differential Revision: https://reviews.llvm.org/D146890
2023-03-25[Docs][llvm-mc] Add documentation on --filetype flagAiden Grossman1-0/+7
Currently the filetype flag is not documented, and knowing the behavior of this flag is fairly important for doing anything other than disassembling to text assembly. Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D146878
2023-03-17[Docs] Fix llvm-cov debuginfod option formatting.Daniel Thornburgh1-23/+24
2023-03-14[Docs] Added llvm-reduce docs in CommandGuideaabhinavg2-0/+109
[Docs] Added llvm-reduce docs in CommandGuide Differential Revision: https://reviews.llvm.org/D146020
2023-03-14[Docs] Added llvm-mc documentationaabhinavg2-0/+157
Fix #61313 Reviewed By: lattner Differential Revision: https://reviews.llvm.org/D145844