1188 Commits

Author SHA1 Message Date
Aiden Grossman
c402498f9a [Docs][llvm-link] Add documentation an CLI options
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-04 20:08:27 -07:00
Aaron Ballman
abb09a6788 Fix LLVM Sphinx build
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 07:53:21 -04:00
Zain Jaffal
24f320e48c [RemarkUtil] Refactor llvm-remarkutil to include size-diff
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-02 10:33:18 +01:00
Saleem Abdulrasool
05d613ea93 [lit][clang] Avoid realpath on Windows due to MAX_PATH limitations
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-08-01 11:00:27 -07:00
Shivam Gupta
64d19542e7 [LIT] Added an option to llvm-lit to emit the necessary test coverage data, 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-26 16:47:17 +05:30
Thomas Köppe
6f1395a1fe [llvm-objcopy] --set-section-flags: allow "large" to add SHF_X86_64_LARGE
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-25 09:47:02 -07:00
Shivam Gupta
db04f018bb Revert "[LIT] Added an option to llvm-lit to emit the necessary test 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 15:59:56 +05:30
Shivam Gupta
d8e26bccb3 [LIT] Added an option to llvm-lit to emit the necessary test coverage data, 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-21 15:23:01 +05:30
pvanhout
b50fe313e8 [TableGen] Deprecate old GI Combiner Emitter
Will be removed in a month or so.

Reviewed By: aemerson

Differential Revision: https://reviews.llvm.org/D154939
2023-07-19 13:17:02 +02:00
Aiden Grossman
3336836dc2 [Docs][llvm-exegesis] Add documentation for memory annotations
Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D151039
2023-07-18 10:23:07 -07:00
Louis Dionne
49b209d5cc [lit] Remove the --no-indirectly-run-check option
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-17 17:59:15 -04:00
Fangrui Song
a4d1259e61 [llvm-objdump] Default to --mcpu=future for PPC32
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-12 18:24:18 -07:00
zhijian
d6d7f7b1d2 [AIX][XCOFF] print out the traceback info
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-07-06 11:47:08 -04:00
Andres Villegas
939c03512d [llvm-libtool-darwin] Switch to OptTableSummary
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-26 14:37:51 -07:00
Ellis Hoag
1117b9a284 [InstrProf] Use BalancedPartitioning to order temporal profiling trace data
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-06 11:59:57 -07:00
Aiden Grossman
8f7496b0b1 [Docs][llvm-mc] Fix location of statement
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-06-04 20:40:37 +00:00
Florian Hahn
e1596d7d9b
[Remarks] Retain all remarks by default, add option to drop without DL.
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-26 11:01:20 +01:00
Aiden Grossman
05cca8a1bc [Docs][llvm-exegesis] Specify platform support for different modes
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-16 03:28:06 +00:00
Aiden Grossman
9fe45fcba7 [Docs][llvm-exegesis] Specify supported platforms and architectures
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-13 09:05:39 +00:00
Kazu Hirata
96ddbd6dd8 [llvm] Fix typos in documentation 2023-05-12 23:47:46 -07:00
Fangrui Song
081cab0d31 [docs] Prefer --target= -masm=intel to -target -mllvm -x86-asm-syntax=intel 2023-05-02 22:08:05 -07:00
4vtomat
fa43608d16 [RISCV][RISCV][clang] Split out SiFive Vector C intrinsics from riscv_vector.td
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-05-02 05:51:51 -07:00
Zain Jaffal
bdb173d0dd [llvm-remarkutil] Add an option to display DebugLoc when collecting counts for remarks.
Reviewed By: paquette

Differential Revision: https://reviews.llvm.org/D148374
2023-04-18 13:48:42 +01:00
Ellis Hoag
4bddef4117 [InstrProf][Temporal] Add weight field to traces
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 10:37:05 -07:00
Jun Zhang
2ecbe7ca76
[Docs] Point to the correct bug tracker
Signed-off-by: Jun Zhang <jun@junz.org>
2023-04-13 21:36:20 +08:00
Aiden Grossman
c19bc611bd [Docs][llvm-exegesis] Add documentation for --use-dummy-perf-counters
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-10 19:09:35 +00:00
Aiden Grossman
b4ba5c7984 [Docs][llvm-remarkutil] Fix dangling reference in documentation
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-08 07:50:06 +00:00
Zain Jaffal
436758f7b0 [llvm-remarkutil] Add missing new line for llvm/docs/CommandGuide/llvm-remarkutil.rst 2023-04-07 23:45:45 +01:00
Zain Jaffal
db01cf7b7c Recommit "Add an option to print out annotation remark count."
Add missing new line for `llvm/docs/CommandGuide/llvm-remarkutil.rst`

This reverts commit 0f7fcb4c670fbef2c25b835fdfdd29598c6c13ae.
2023-04-07 23:42:39 +01:00
Zain Jaffal
0f7fcb4c67 Revert "Add an option to print out annotation remark count."
This reverts commit 7cc80ef5fa359b68ee85033f98b1bef1f37fb21c.
2023-04-07 23:42:24 +01:00
Zain Jaffal
7cc80ef5fa Add an option to print out annotation remark count.
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-07 23:33:29 +01:00
aabhinavg
40847375d8 [Docs][typo] Done the required fix for the #61690
Differential Revision: https://reviews.llvm.org/D146898
2023-04-06 22:22:33 +05:30
wlei
280ece9a69 fix docs warning in llvm-profdata.rst 2023-03-30 11:21:48 -07:00
wlei
339b8a0019 [AutoFDO] Use flattened profiles for profile staleness metrics
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 11:05:10 -07:00
Daniel Thornburgh
9dce77f067 [Docs][llvm-cov] Correct flag name. 2023-03-30 10:41:10 -07:00
Jonas Devlieghere
4d683f7fa7
[dsymutil] Add the ability to generate universal binaries with a fat64 header
Add the ability to generate universal binaries with a fat64 header.

rdar://107223939

Differential revision: https://reviews.llvm.org/D146879
2023-03-27 16:22:16 -07:00
Aiden Grossman
8d3a09daca [Docs][llvm-exegesis] Refactor snippet annotations in documentation
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-27 08:22:25 +00:00
Aiden Grossman
7bda9ffb9c [Docs][llvm-mc] Add documentation on --filetype flag
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-25 17:44:27 +00:00
Daniel Thornburgh
41e4578ae1 [Docs] Fix llvm-cov debuginfod option formatting. 2023-03-17 15:49:21 -07:00
aabhinavg
ae2d8def6b [Docs] Added llvm-reduce docs in CommandGuide
[Docs] Added llvm-reduce docs in CommandGuide

Differential Revision: https://reviews.llvm.org/D146020
2023-03-14 20:55:20 +05:30
aabhinavg
5686364d90 [Docs] Added llvm-mc documentation
Fix #61313

Reviewed By: lattner

Differential Revision: https://reviews.llvm.org/D145844
2023-03-14 08:23:15 +05:30
Daniel Thornburgh
072e07a9d5 [llvm-cov] Optionally fail on missing binary ID
This adds the --check-binary-id flag that makes sure that an object file
is available for every binary ID mentioned in the given profile. This
should help make the tool more robust in CI environments where it's
expected that coverage mappings should be available for every object
contributing to the profile.

Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D144308
2023-03-03 10:24:21 -08:00
Mitch Phillips
a4d39d4b69 [llvm-readobj] Add --memtag
This adds functionality to readelf/readobj to specifically handle
MTE-related bits, like the AARCH64_MEMTAG_* dynamic entries, and a
decoder for the Android-specific ELF note.

Reviewed By: jhenderson, MaskRay

Differential Revision: https://reviews.llvm.org/D143693
2023-03-01 10:59:59 -08:00
Daniel Thornburgh
8007bcc13f [llvm-cov] Create syntax to pass source w/o binary.
Since binary ID lookup makes CLI object arguments optional, it should be
possible to pass a list of source files without a binary. Unfortunately,
the current syntax will always interpret the first source file as a
binary. This change adds a `-sources` option to cause all later
positional arguments to be considered sources.

Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D144207
2023-02-17 13:11:54 -08:00
Jay Foad
1bff89f7dc [Docs] Clarify behavior of llvm-lit -vv
Differential Revision: https://reviews.llvm.org/D143586
2023-02-09 09:36:19 +00:00
Daniel Thornburgh
a3b0dde4ed Reland: [llvm-cov] Look up object files using debuginfod
Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D136702
2023-01-26 12:59:52 -08:00
Douglas Yung
bce910242e Revert "[llvm-cov] Look up object files using debuginfod"
This reverts commit efbc8bb18eda63007216ad0cb5a8de04963eddd5.

This change is causing failures when detecting curl on several build bots:
 - https://lab.llvm.org/buildbot/#/builders/247/builds/884
 - https://lab.llvm.org/buildbot/#/builders/231/builds/7688
 - https://lab.llvm.org/buildbot/#/builders/121/builds/27389
 - https://lab.llvm.org/buildbot/#/builders/230/builds/8464
 - https://lab.llvm.org/buildbot/#/builders/57/builds/24209
 - https://lab.llvm.org/buildbot/#/builders/127/builds/42722
2023-01-25 19:11:08 -08:00
Daniel Thornburgh
efbc8bb18e [llvm-cov] Look up object files using debuginfod
Reviewed By: gulfem

Differential Revision: https://reviews.llvm.org/D136702
2023-01-25 14:00:34 -08:00
Masahiro ARAKAWA
4c443eb885 [docs][NFC] Add document of llvm-opt-report.
Differential Revision: https://reviews.llvm.org/D136138
2023-01-24 11:04:04 +00:00
Roman Lebedev
e0ad2af691
[exegesis] "Skip codegen" dry-run mode
While "skip measurements mode" is super useful for test coverage,
i've come to discover it's trade-offs. It still calls back-end
to actually codegen the target assembly, and that is what is taking
80%+ of the time regardless of whether or not we skip the measurements.

On the other hand, just being able to see that exegesis can come up
with a snippet to measure something, is already very useful,
and takes maybe a second for a all-opcode sweep.

Reviewed By: gchatelet

Differential Revision: https://reviews.llvm.org/D140702
2023-01-05 17:47:17 +03:00