11478 Commits

Author SHA1 Message Date
David Sherwood
3bc2dade36
[LoopVectorize] Enable vectorisation of early exit loops with live-outs (#120567)
This work feeds part of PR
https://github.com/llvm/llvm-project/pull/88385, and adds support for
vectorising
loops with uncountable early exits and outside users of loop-defined
variables. When calculating the final value from an uncountable early
exit we need to calculate the vector lane that triggered the exit,
and hence determine the value at the point we exited.

All code for calculating the last value when exiting the loop early
now lives in a new vector.early.exit block, which sits between the
middle.split block and the original exit block. Doing this required
two fixes:

1. The vplan verifier incorrectly assumed that the block containing
a definition always dominates the block of the user. That's not true
if you can arrive at the use block from multiple incoming blocks.
This is possible for early exit loops where both the early exit and
the latch jump to the same block.
2. We were adding the new vector.early.exit to the wrong parent loop.
It needs to have the same parent as the actual early exit block from
the original loop.

I've added a new ExtractFirstActive VPInstruction that extracts the
first active lane of a vector, i.e. the lane of the vector predicate
that triggered the exit.

NOTE: The IR generated for dealing with live-outs from early exit
loops is unoptimised, as opposed to normal loops. This inevitably
leads to poor quality code, but this can be fixed up later.
2025-01-30 10:37:00 +00:00
Carl Ritson
1f38d38d54 [AMDGPU] Fix documentation table formatting from #118750 (NFC) 2025-01-30 14:27:25 +09:00
Carl Ritson
a3a3e6997b
[AMDGPU] Rewrite GFX12 SGPR hazard handling to dedicated pass (#118750)
- Algorithm operates over whole IR to attempt to minimize waits.
- Add support for VALU->VALU SGPR hazards via VA_SDST/VA_VCC.
2025-01-30 11:21:11 +09:00
Joel E. Denny
18f8106f31
[KernelInfo] Implement new LLVM IR pass for GPU code analysis (#102944)
This patch implements an LLVM IR pass, named kernel-info, that reports
various statistics for codes compiled for GPUs. The ultimate goal of
these statistics to help identify bad code patterns and ways to mitigate
them. The pass operates at the LLVM IR level so that it can, in theory,
support any LLVM-based compiler for programming languages supporting
GPUs. It has been tested so far with LLVM IR generated by Clang for
OpenMP offload codes targeting NVIDIA GPUs and AMD GPUs.

By default, the pass runs at the end of LTO, and options like
``-Rpass=kernel-info`` enable its remarks. Example `opt` and `clang`
command lines appear in `llvm/docs/KernelInfo.rst`. Remarks include
summary statistics (e.g., total size of static allocas) and individual
occurrences (e.g., source location of each alloca). Examples of its
output appear in tests in `llvm/test/Analysis/KernelInfo`.
2025-01-29 12:40:19 -05:00
Nikita Popov
29441e4f5f
[IR] Convert from nocapture to captures(none) (#123181)
This PR removes the old `nocapture` attribute, replacing it with the new
`captures` attribute introduced in #116990. This change is
intended to be essentially NFC, replacing existing uses of `nocapture`
with `captures(none)` without adding any new analysis capabilities.
Making use of non-`none` values is left for a followup.

Some notes:
* `nocapture` will be upgraded to `captures(none)` by the bitcode
   reader.
* `nocapture` will also be upgraded by the textual IR reader. This is to
   make it easier to use old IR files and somewhat reduce the test churn in
   this PR.
* Helper APIs like `doesNotCapture()` will check for `captures(none)`.
* MLIR import will convert `captures(none)` into an `llvm.nocapture`
   attribute. The representation in the LLVM IR dialect should be updated
   separately.
2025-01-29 16:56:47 +01:00
David Spickett
9ea64dd878
[lldb] Make Python >= 3.8 required for LLDB 21 (#124735)
As decided on
https://discourse.llvm.org/t/rfc-lets-document-and-enforce-a-minimum-python-version-for-lldb/82731.

LLDB 20 recommended `>= 3.8` but did not remove support for anything
earlier. Now we are in what will become LLDB 21, so I'm removing that
support and making
`>= 3.8` required.

See https://docs.python.org/3/c-api/apiabiversion.html#c.PY_VERSION_HEX
for the format of PY_VERSION_HEX.
2025-01-29 09:56:41 +00:00
Tom Stellard
3bd3e06f3f
Bump version to 21.0.0git (#124870)
Also clear the release notes.
2025-01-28 19:48:43 -08:00
Veera
98d6dd3988
[LLVM][LangRef][noalias] Remove Redundant Line and Improve Wording (#124685)
Removes a redundant line and improves punctuation and wording in the
paragraph describing the `noalias` attribute.
2025-01-28 20:21:22 -05:00
gulfemsavrun
38902153fe
[PassBuilder] Add RelLookupTableConverterPass to LTO (#124053)
[PassBuilder] Add RelLookupTableConverterPass to LTO

This patch adds RelLookupTableConverterPass into the LTO
post-link optimization pass pipeline. This optimization
converts lookup tables to relative lookup tables to make
them PIC-friendly, which is already included in the non-LTO
pass pipeline. This patch adds this optimization to the
post-link optimization pipeline to discover more
opportunities in the LTO context.
2025-01-28 15:08:03 -08:00
David Spickett
8353aa2a53 [llvm][Docs] Add LLDB AArch64 GCS Release note
https://github.com/llvm/llvm-project/pull/124295 just
went in and that's the last piece of functionality.
2025-01-28 12:09:05 +00:00
Jeremy Morse
65f81df473
[Docs][DebugInfo] Summarise what people need to do for RemoveDIs now (#124725)
Replace the "what I need to do" section of the RemoveDIs docs with a
paragraph about preserving start-of-block iterators. Hopefully this is
concise enough to remain in peoples heads going forwards!
2025-01-28 11:31:15 +00:00
David Spickett
b29bf3de05 [llvm][Docs] Re-order the LLDB release notes
To put generic changes first, moving into target specific changes
at the end.
2025-01-28 10:33:44 +00:00
Djordje Todorovic
0cb7636a46
[RISCV] Add MIPS extensions (#121394)
Adding two extensions for MIPS p8700 CPU:
  1. cmove (conditional move)
  2. lsp (load/store pair)

The official product page here:
https://mips.com/products/hardware/p8700
2025-01-28 08:04:09 +01:00
Petr Hosek
b593110d89
[compiler-rt] Deprecate LLVM_ENABLE_PROJECTS in favor of LLVM_ENABLE_RUNTIMES (#124016)
We plan to make this a hard error in the LLVM 21 release.

Link #124012
2025-01-27 22:32:38 -08:00
quic_hchandel
2d0688797c
[RISCV] Renaming muladdi to muliadd as per v0.5 spec. (#124237)
muliadd is more relevant to the operation performed, i.e. multiply by
immediate.

The latest spec can be found at:
https://github.com/quic/riscv-unified-db/releases/latest
2025-01-27 20:40:45 -08:00
Vasileios Porpodas
485b1ac8a2 [SandboxIR][Docs] C++ highlighting for code block 2025-01-25 08:25:15 -08:00
Jeffrey Byrnes
db1ee18eda NFC: Typo fix
Change-Id: I08470bc617490558250136ea35a4964003fa9981
2025-01-24 15:59:13 -08:00
Sam Elliott
d910fbcbd1 [RISCV][NFC] cR Constraint Release Note 2025-01-24 14:46:01 -08:00
Jun Wang
77c23fd0aa
[AMDGPU] Update AMDGPUUsage.rst to document two intrinsics (#123816)
The AMDGPUUsage.rst file is updated to document two intrinsics:
llvm.amdgcn.mov.dpp and llvm.amdgcn.update.dpp.
2025-01-24 14:12:18 -08:00
David Spickett
4b6fc49346
[llvm][Docs] Clarify the process for requesting a merge on your behalf (#124154)
This makes it more clear what you the author must do, and what reviewers
can expect you to do, before an approved PR can be merged. Spliting out
the email bit into a section also means we can link directly to it in
discussions.

This relies on one of those parties actually reading this, but I plan to
tackle the case where they don't with some new automation.
2025-01-24 09:34:37 +00:00
David Spickett
97df7411fd
[llvm][Docs] Make it clear where lit test files live (#124121)
As someone on Discord was understandably confused because the build
directory does contain folder structures that look remarkably like the
source directory.

I used this page to explain it but realised that this must be from when
llvm was a separate repository. So `<user home>/llvm` probably was a
common path.

Now it's in llvm-project. So make that obvious in the instructions.
2025-01-24 08:29:44 +00:00
Pradeep Kumar
435609b70c
[LLVM][NVPTX] Add support for griddepcontrol instruction (#123511)
This commit adds support for griddepcontrol PTX instruction with tests
under griddepcontrol.ll
2025-01-24 09:33:16 +05:30
Igor Kudrin
10772807ab Reapply "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"
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-23 15:22:04 -08:00
Igor Kudrin
621e5cd820 Revert "[llvm-objcopy][ELF] Add an option to remove notes (#118739)"
This reverts commit 9324e6a7a5c5adc5b5c38c3e3cbecd7e1e98876a.
2025-01-23 14:57:29 -08:00
Igor Kudrin
9324e6a7a5
[llvm-objcopy][ELF] Add an option to remove notes (#118739)
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-23 14:27:40 -08:00
David Spickett
1f0964f81e [llvm][Docs] Clarify finding maintainers
By noting where the files are to be found, and adding some
whitespace to break up large blocks.

(the merge on behalf bit needs a refresh but this will go
into review later after this)
2025-01-23 14:51:18 +00:00
Pavel Labath
0236cb6895
[lldb] Enable "frame diagnose" on linux (#123217)
.. by changing the signal stop reason format 🤦

The reason this did not work is because the code in
`StopInfo::GetCrashingDereference` was looking for the string "address="
to extract the address of the crash. Macos stop reason strings have the
form
```
  EXC_BAD_ACCESS (code=1, address=0xdead)
```
while on linux they look like:
```
  signal SIGSEGV: address not mapped to object (fault address: 0xdead)
```

Extracting the address from a string sounds like a bad idea, but I
suppose there's some value in using a consistent format across
platforms, so this patch changes the signal format to use the equals
sign as well. All of the diagnose tests pass except one, which appears
to fail due to something similar #115453 (disassembler reports
unrelocated call targets).

I've left the tests disabled on windows, as the stop reason reporting
code works very differently there, and I suspect it won't work out of
the box. If I'm wrong -- the XFAIL will let us know.
2025-01-23 13:04:36 +01:00
Abhilash Majumder
fa7f0e582b
[NVPTX] Add Bulk Copy Prefetch Intrinsics (#123226)
This patch adds NVVM intrinsics and NVPTX codegen for:

- cp.async.bulk.prefetch.L2.* variants 
- These intrinsics optionally support cache_hints as indicated by the
   boolean flag argument.
- Lit tests are added for all combinations of these intrinsics in
   cp-async-bulk.ll.
- The generated PTX is verified with a 12.3 ptxas executable.
- Added docs for these intrinsics in NVPTXUsage.rst file.

PTX Spec reference:
https://docs.nvidia.com/cuda/parallel-thread-execution/#data-movement-and-conversion-instructions-cp-async-bulk-prefetch


Co-authored-by: abmajumder <abmajumder@nvidia.com>
2025-01-23 16:49:44 +05:30
quic_hchandel
163935a48d
[RISCV] Add Qualcomm uC Xqcilo (Large Offset Load Store) extension (#123881)
This extension adds eight 48 bit load store instructions.

The current spec can be found at:
https://github.com/quic/riscv-unified-db/releases/latest

This patch adds assembler only support.

---------

Co-authored-by: Harsh Chandel <hchandel@qti.qualcomm.com>
2025-01-23 10:14:25 +05:30
Weining Lu
d80b814c01 [LoongArch] Summary llvm20 release notes 2025-01-23 12:38:04 +08:00
vporpo
e0ae889046
[SandboxIR][Doc] Add Quick start notes (#123992) 2025-01-22 14:43:22 -08:00
Marc Auberer
5136c6d9d2
[Tools][Docker] Update Dockerfiles and Docker guide (#123841)
Fixes #123669

- Update Dockerfiles to work with the LLVM trunk
- Adapt Documentation accordingly
- Fix duplicate `-c` flag
2025-01-22 13:53:23 +01:00
Alexey Merzlyakov
ef37c3dd03
[llvm][Docs] Release note for LLDB optionally disabled regsets for RV64 (#123363)
This PR adds the release note point for LLDB 20, discussed in
https://github.com/llvm/llvm-project/pull/104547#issuecomment-2587479877
for the same ticket

---------

Co-authored-by: David Spickett <david.spickett@linaro.org>
2025-01-22 09:30:13 +00:00
dlav-sc
0d24130008
[llvm][Docs] Add lldb user expressions related release notes (#123772) 2025-01-22 12:25:44 +03:00
Calvin Beck
ca65055e79
Remove mention of conditional branches in undefined values section. (#122980)
This statement is somewhat confusing when paired with the later
statement that says "Branching on an undefined value is undefined
behavior". Furthermore, this example does not show any conditional
branches, so this comment seems to be outdated.

See issue #122532 for more details.
2025-01-22 09:07:19 +01:00
Chris B
c59ede638f
Update Developer Policy for copyright notices (#123463)
This updates the developer policy to align with established community
norms for copyright notices in source code contributed to LLVM.

The updates clearly state that we do not accept code contianing explicit
copyright notices in source except where such code is a pre-existing
part of an external dependency that is being vendored into LLVM.

Explicit copyright notices in source add no value to the project since
copyright ownership is well tracked through git. Our policy already
requires that contributions made not by the original author have
appropriate attribution in git commit messsages or metadata.

Further, explicit copyright notices in code can easily get out of date
as the code is refactored, updated by additional authors or otherwise
changed over time. This leads to misleading out-of-date copyright
notices which do more harm than good.

This change should be viewed as a clarification and statement of
existing established policy, not a change in policy since it represents
the way the project has been operating.
2025-01-21 15:48:27 -06:00
Michal Paszkowski
cda81b1ec9
[SPIR-V] Add SPIRV to LLVM_ALL_TARGETS (reapply) (#123733)
This commit promotes the SPIR-V backend from experimental to official
status. As a result, SPIR-V will be built by default, simplifying
integration and increasing accessibility for downstream projects.

Discussion and RFC on Discourse:
https://discourse.llvm.org/t/rfc-promoting-spir-v-to-an-official-target/83614

The PR reapplies the original patch
https://github.com/llvm/llvm-project/pull/119653 and consecutive
https://github.com/llvm/llvm-project/pull/123654, reverted due to
buildbot failures.
2025-01-21 12:39:03 +01:00
Michal Paszkowski
3f0ac4653b
Revert "[SPIR-V] Add SPIRV to LLVM_ALL_TARGETS (reapply)" (#123674)
Reverts llvm/llvm-project#123654 due to buildbot issue
2025-01-20 15:16:43 -08:00
Michal Paszkowski
f427fef092
[SPIR-V] Add SPIRV to LLVM_ALL_TARGETS (reapply) (#123654)
This commit promotes the SPIR-V backend from experimental to official
status. As a result, SPIR-V will be built by default, simplifying
integration and increasing accessibility for downstream projects.

Discussion and RFC on Discourse:
https://discourse.llvm.org/t/rfc-promoting-spir-v-to-an-official-target/83614

The PR reapplies the original patch
https://github.com/llvm/llvm-project/pull/119653, reverted due to
buildbot failures.
2025-01-20 14:57:41 -08:00
Michal Paszkowski
5af7905302
Revert "[SPIR-V] Add SPIRV to LLVM_ALL_TARGETS" (#123532)
Reverts llvm/llvm-project#119653
2025-01-20 00:33:14 +01:00
Michal Paszkowski
c46df85380
[SPIR-V] Add SPIRV to LLVM_ALL_TARGETS (#119653)
This commit promotes the SPIR-V backend from experimental to official
status. As a result, SPIR-V will be built by default, simplifying
integration and increasing accessibility for downstream projects.

Discussion and RFC on Discourse:
https://discourse.llvm.org/t/rfc-promoting-spir-v-to-an-official-target/83614
2025-01-20 00:02:46 +01:00
DeNiCoN
293dbea8b0
Fix some typos (#123506)
Fixes some typos in the documentation
2025-01-19 16:53:39 +01:00
Pavel Labath
f711aa9e5d
[llvm][Docs] Add release note about LLDB core file improvements (#123062) 2025-01-16 08:29:40 +01:00
Min Hsu
72225ca27f Revert "Reland: "[Exegesis] Add the ability to dry-run the measurement phase (#121991)" (#122775)"
This reverts commit a39aaf35d3858a5542f532e399482c2bb0259dac and
63d3bd6d0caf8185aba49540fe2f67512fdf3a98.

Due to test failures on MacOSX.
2025-01-14 14:18:58 -08:00
Pavel Labath
7900769985
[llvm][Docs] Add a release note about the lldb DWARF indexing speedup (#122870)
The figure includes works that's already committed. In does not include
the WIP/RFC proposal in
https://discourse.llvm.org/t/rfc-speeding-up-dwarf-indexing-again/83979.
2025-01-14 15:54:19 +01:00
David Spickett
cfd7e024c6 [llvm][Docs] Add release note for lldb-server port mapping changes 2025-01-14 10:01:08 +00:00
David Spickett
04733fac10 [llvm][Docs] Formatting changes to LLDB release notes 2025-01-14 10:01:07 +00:00
Jacob Lalonde
df1a84d2ed
[llvm][Docs] Add Minidump related LLDB release notes (#122759)
Add some release notes for the Minidump work I did over the last few
months.
2025-01-14 09:35:41 +00:00
jimingham
386dec2be9
Update ReleaseNotes.md
Mentioned native command definitions and support for breaking on inlined call-sites.
2025-01-13 14:43:19 -08:00
Min-Yih Hsu
a39aaf35d3
Reland: "[Exegesis] Add the ability to dry-run the measurement phase (#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-13 13:42:59 -08:00