553260 Commits

Author SHA1 Message Date
Jordan Rupprecht
dcce216289
[bazel][AArch64] Port #156364: fix tablegen args (#159835)
This was updated in #156364 but `-ignore-non-decodable-operands` was
removed from the wrong tablegen arg list (arm vs aarch64)
2025-09-19 19:17:14 +00:00
Joseph Huber
580860e8b7
[OpenMP][NFC] Clean up a bunch of warnings and clang-tidy messages (#159831)
Summary:
I made the GPU flags accept more of the default LLVM warnings, which
triggered some new cases. Clean those up and fix some other ones while
I'm at it.
2025-09-19 14:09:33 -05:00
Amr Hesham
b28d2ea432
[CIR] Implement Logical AND for VectorType (#158696)
This change adds support for local AND op for VectorType

Issue https://github.com/llvm/llvm-project/issues/136487
2025-09-19 20:52:27 +02:00
David Green
e22985795c [AArch64] Clean up the formatting of some bitconvert patterns. NFC 2025-09-19 19:43:57 +01:00
AZero13
733c1aded1
[ARM] Replace ABS and tABS machine nodes with custom lowering (#156717)
Just do a custom lowering instead.

Also copy paste the cmov-neg fold to prevent regressions in nabs.
2025-09-19 19:43:36 +01:00
Akash Banerjee
8afea0d0ea
[OpenMP][MLIR] Preserve to/from flags in mapper base entry for mappers (#159799)
With declare mapper, the parent base entry was emitted as `TARGET_PARAM`
only. The mapper received a map-type without `to/from`, causing
components to degrade to `alloc`-only (no copies), breaking allocatable
payload mapping. This PR preserves the map-type bits from the parent.

This fixes #156466.
2025-09-19 19:34:09 +01:00
Nico Weber
6e977aabb9 [gn] port a513b701752b1 2025-09-19 14:21:30 -04:00
Wendi
fcf2c4629c
[QualGroup] Update Slides Section, Add AI Transcription Policy, Clean Up (#158842)
This patch makes the following updates to the `QualGroup.rst`
documentation:

 1. Replace slide links with Google Drive URLs

Replaced links to slide PDFs previously hosted in `llvm/docs/qual-wg/`
with publicly accessible links to the same files stored on Google Drive.

 2. Remove duplicated "Current Topics & Backlog" section

Removed an accidental duplication of the "Current Topics & Backlog"
section to improve clarity and structure.

 3. Add "AI Transcription Policy" section

Introduced a dedicated section documenting the group's practices and
expectations regarding AI-based auto-transcription during sync-up
meetings. Includes purpose, consent practices, retention details, and
how participants can opt out or raise concerns.

 4. Remove `qual-wg` subfolder from `docs`

Removed the now-unused `llvm/docs/qual-wg` directory after migrating
slide hosting off-repo. No longer needed for qualification group
documentation.

 5. Revision of the introduction

Updated sentence to reflect the most current and widely relevant safety
standards: adding IEC 61508 and IEC 62304 for broader applicability, and
replacing EN 50128 (older standard in railways) by EN 50716 for
correctness.

---------

Co-authored-by: Wendi Urribarri (Woven by Toyota <wendi.urribarri@woven-planet.global>
2025-09-19 13:16:22 -05:00
Walter Erquinigo
9ba844eb3a
[ELF][LLDB] Add an nvsass triple (#159459)
When handling CUDA ELF files via objdump or LLDB, the ELF parser in LLVM
needs to distinguish if an ELF file is sass or not, which requires a
triple for sass to exist in llvm. This patch includes all the necessary
changes for LLDB and objdump to correctly identify these files with the
correct triple.
2025-09-19 14:14:20 -04:00
Roland McGrath
fc73ef42c9
[clang][Driver] Clean up UEFI linker argument handling (#159639)
This makes the UEFI driver's handling of linking more canonical
in a few ways:
 * Use /option:value syntax with lld-link as in the MSVC driver.
 * Handle -nostdlib, -nodefaultlibs, -r and call common
   subroutines when they aren't set.  This covers sanitizer and
   profile runtimes and their associated switches; compiler-rt
   builds do not yet provide these libraries, but the driver
   behavior is opt-in and supports all the opt-in/out plumbing
   like other targets do.  This lets command lines immediately
   use the opt-out switches even when they are superfluous for
   opt-in features, as build system plumbing often needs to do.

It also updates some TODO comments for how the driver behavior
will look when more runtime support is ready.
2025-09-19 11:14:05 -07:00
Anthony Latsis
16880116c9
[lldb] Fix Linux build when LLDB_ENABLE_PYTHON is OFF (#159825)
Remove 'lldb-python-scripts' from LLVM_DISTRIBUTION_COMPONENTS when
Python scripting is disabled. Otherwise we get

```
Specified distribution component 'lldb-python-scripts' doesn't have an install target
```
2025-09-19 11:13:34 -07:00
Matheus Izvekov
bbf657d5bb
[clang] fix expression classification for dependent binary operators (#159819)
This fixes a regression reported here:
https://github.com/llvm/llvm-project/pull/159463#issuecomment-3312157416

Since this regression was never released, there are no release notes.
2025-09-19 15:12:46 -03:00
Joseph Huber
2d503b924c
[LLVM] Simplify GPU runtimes flag handling (#159802)
Summary:
The AMDGPU hack can be removed, and we no longer need to skip 90% of the
`HandleLLVMOptions` if we work around NVPTX earlier. Simplifies the
interface by removing duplicated logic and keeps the GPU targets from
being weirdly divergent on some flags.
2025-09-19 13:09:52 -05:00
Stanislav Mekhanoshin
8fcb712167
[AMDGPU] gfx1250 runlines for global-atomicrmw-fadd.ll. NFC (#159817) 2025-09-19 10:58:41 -07:00
Jonathan Thackray
0ce6052a0c
[lldb] install lldb-tblgen by default to ease cross-compilation (one-liner) (#159812)
Right now, cross-building `lldb` means either installing a native
`lldb-tblgen` by hand (non-trivial, as CMake is painful) or first
building all of native clang because of how the CMake rules work, which
is not fun.

In keeping with the pattern established by llvm-tblgen and clang-tblgen,
install lldb-tblgen to ease cross-compilation.

Co-authored-by: Ross Burton <ross.burton@arm.com>
2025-09-19 10:56:26 -07:00
lntue
21821f50cf
[libc] Update floating testing infra for MSVC compatibility. (#159810) 2025-09-19 13:44:42 -04:00
zhijian lin
2e34188513
[PowerPC] clean unused PPC target feature FeatureBPERMD (#159782)
clean unused PPC target feature FeatureBPERMD.
2025-09-19 13:38:26 -04:00
Sergei Barannikov
4cace1ff0f
[ARM] Verify that disassembled instruction is correct (#157360)
This change adds basic `MCInst` verification (checks the number of
operands) and fixes detected bugs.

* `RFE*` instructions have only one operand, but `DecodeRFEInstruction`
added two.
* `DecodeMVEModImmInstruction` and `DecodeMVEVCMP` added a `vpred`
operand, but this is what `AddThumbPredicate` normally does. This
resulted in an extra `vpred` operand.
* `DecodeMVEVADCInstruction` added an extra immediate operand.
* `getARMInstruction` added a `pred` operand to instructions that don't
have one (via `DecodePredicateOperand`).
* `AddThumb1SBit` appended an extra register operand to instructions
that don't modify CPSR (such as `tBL`).
* Instructions in `NEONDup` namespace have `pred` operand that the
generated code successfully decodes. The operand was added once again by
`getARMInstruction`/`getThumbInstruction` via `AddThumbPredicate`.

Functional changes extracted from #156540.
2025-09-19 17:37:52 +00:00
Sarah Spall
4c7ebf825e
[HLSL] Add deprecation warnings to compatability overloads (#159208)
Add deprecation warnings to compatability overloads and add tests to
show the warnings.
Closes #133452
2025-09-19 10:35:49 -07:00
Charitha Saumya
2998c74a1e
[mlir][xegpu] Add SIMT distribution support for GEMM transpose B case. (#155517)
This PR adds the features needed for supporting the GEMM with transpose
B case.

Summary of changes.

1). Add distribution logic for `vector.bitcast`, `vector.transpose` and
`memref.extract_aligned_pointer_as_index` cases.
2). Add layout propagation support for `vector.shape_cast`,
`vector.broadcast` and `vector.bitcast`
3). Incorporate slice attribute and `DistributeLayoutAttr` interface
with the core logic in layout prop.
2025-09-19 10:33:27 -07:00
Amr Hesham
bedfee0b8d
[CIR] Upstream TypeInfo attribute (#159426)
This change adds support for TypeInfoAttr which is needed later for RTTI
in exceptions

Issue https://github.com/llvm/llvm-project/issues/154992
2025-09-19 19:31:25 +02:00
Gabriel Baraldi
21f5f32cc6
[PassBuilder] Add callback invoking to PassBuilder string API (#157153)
This is a very rough state of what this can look like, but I didn't want
to spend too much time on what could be a dead end.

Currently the only way to invoke callbacks is by using the default
pipelines, this is an issue if you want to define your own pipeline
using the C string API (we do that in LLVM.jl in julia) so I extended
the api to allow for invoking those callbacks just like one would call a
pass of that kind.

There are some questions about the params that these callbacks take and
also I'm missing some of them (some of them are also invoked by the
backend so we may not want to expose them)

Code written with AI help, bugs are mine. (Not sure what policy for this
is on LLVM)
2025-09-19 10:31:04 -07:00
Craig Topper
90d03a0386
[RISCV] Use MutableArrayRef instead of SmallVectorImpl&. NFC (#159651)
We're only going to modify existing items, not add or remove any
elements to the vector.
2025-09-19 10:21:00 -07:00
Joseph Huber
51e3c3d51b
[Offload] Implement 'olIsValidBinary' in offload and clean up (#159658)
Summary:
This exposes the 'isDeviceCompatible' routine for checking if a binary
*can* be loaded. This is useful if people don't want to consume errors
everywhere when figuring out which image to put to what device.

I don't know if this is a good name, I was thining like `olIsCompatible`
or whatever. Let me know what you think.

Long term I'd like to be able to do something similar to what OpenMP
does where we can conditionally only initialize devices if we need them.
That's going to be support needed if we want this to be more
generic.
2025-09-19 12:15:57 -05:00
Sergei Barannikov
bf835169a5
[AArch64] Remove post-decoding instruction mutations (#156364)
Add `bits<0>` fields to instructions using the ZTR/MPR/MPR8 register
classes. These register classes contain only one register, and it is
not encoded in the instruction. This way, the generated decoder can 
completely decode instructions without having to perform a post-decoding
pass to insert missing operands.

Some immediate operands are also not encoded and have only one possible
value "zero". Use this trick for them, too.

Finally, remove `-ignore-non-decodable-operands` option from
`llvm-tblgen` invocation to ensure that non-decodable operands do not
appear in the future.
2025-09-19 17:15:38 +00:00
Sam Clegg
cac54a8ad0
[WebAssembly] Require tags for Wasm EH and Wasm SJLJ to be defined externally (#159143)
Rather then defining these tags in each object file that requires them
we can can declare them as undefined and require that they defined
externally in, for example, compiler-rt or libcxxabi.
2025-09-19 10:11:15 -07:00
Mehdi Amini
e151e84ec0 [MLIR] Apply clang-tidy fixes for bugprone-argument-comment in LinalgTransformOps.cpp (NFC) 2025-09-19 10:07:49 -07:00
Cameron McInally
8009a5bafd
[MC] Add support for -mcpu=native. (#159414)
Support -mcpu=native by querying the Host CPU Name and Feature flags.

---------

Co-authored-by: Cameron McInally <cmcinally@nvidia.com>
2025-09-19 12:43:06 -04:00
Akash Dutta
c256966fe2
[AMDGPU]: Unpack packed instructions overlapped by MFMAs post-RA scheduling (#157968)
This is a cleaned up version of PR #151704. These optimizations are now
performed post-RA scheduling.
2025-09-19 09:41:02 -07:00
Utkarsh Saxena
250a92fca5
[LifetimeSafety] Avoid adding already present items in sets/maps (#159582)
Optimize lifetime safety analysis performance

- Added early return optimization in `join` function for ImmutableSet
when sets are identical
- Improved ImmutableMap join logic to avoid unnecessary operations when
values are equal

I was under the impression that ImmutableSets/Maps would not modify the
underlying if already existing elements are added to the container (and
was hoping for structural equality in this aspect). It looks like the
current implementation of `ImmutableSet` would perform addition
nevertheless thereby creating (presumably `O(log(N))` tree nodes.

This change considerably brings down compile times for some edge cases
which happened to be present in the LLVM codebase. Now it is actually
possible to compile LLVM in under 20 min with the lifetime analysis.
The compile time hit is still significant but not as bad as before this
change where it was not possible to compile LLVM without severely
limiting analysis' scope (giving up on CFG with > 3000 blocks).

Fixes https://github.com/llvm/llvm-project/issues/157420

<details>
<summary>Report (Before)</summary>
</details>

<details>
<summary>Report (After)</summary>

# Lifetime Analysis Performance Report
> Generated on: 2025-09-18 14:28:00 

---

## Test Case: Pointer Cycle in Loop

**Timing Results:**

| N (Input Size) | Total Time | Analysis Time (%) | Fact Generator (%) |
Loan Propagation (%) | Expired Loans (%) |

|:---------------|-----------:|------------------:|-------------------:|---------------------:|------------------:|
| 25 | 53.76 ms | 85.58% | 0.00% | 85.46% | 0.00% |
| 50 | 605.35 ms | 98.39% | 0.00% | 98.37% | 0.00% |
| 75 | 2.89 s | 99.62% | 0.00% | 99.61% | 0.00% |
| 100 | 8.62 s | 99.80% | 0.00% | 99.80% | 0.00% |

**Complexity Analysis:**

| Analysis Phase    | Complexity O(n<sup>k</sup>) | 
|:------------------|:--------------------------|
| Total Analysis    | O(n<sup>3.82</sup> &pm; 0.01) |
| FactGenerator     | (Negligible)              |
| LoanPropagation   | O(n<sup>3.82</sup> &pm; 0.01) |
| ExpiredLoans      | (Negligible)              |

---

## Test Case: CFG Merges

**Timing Results:**

| N (Input Size) | Total Time | Analysis Time (%) | Fact Generator (%) |
Loan Propagation (%) | Expired Loans (%) |

|:---------------|-----------:|------------------:|-------------------:|---------------------:|------------------:|
| 400 | 66.02 ms | 58.61% | 1.04% | 56.53% | 1.02% |
| 1000 | 319.24 ms | 81.31% | 0.63% | 80.04% | 0.64% |
| 2000 | 1.43 s | 92.00% | 0.40% | 91.32% | 0.28% |
| 5000 | 9.35 s | 97.01% | 0.25% | 96.63% | 0.12% |

**Complexity Analysis:**

| Analysis Phase    | Complexity O(n<sup>k</sup>) | 
|:------------------|:--------------------------|
| Total Analysis    | O(n<sup>2.12</sup> &pm; 0.02) |
| FactGenerator     | O(n<sup>1.54</sup> &pm; 0.02) |
| LoanPropagation   | O(n<sup>2.12</sup> &pm; 0.03) |
| ExpiredLoans      | O(n<sup>1.13</sup> &pm; 0.03) |

---

## Test Case: Deeply Nested Loops

**Timing Results:**

| N (Input Size) | Total Time | Analysis Time (%) | Fact Generator (%) |
Loan Propagation (%) | Expired Loans (%) |

|:---------------|-----------:|------------------:|-------------------:|---------------------:|------------------:|
| 50 | 137.30 ms | 90.72% | 0.00% | 90.42% | 0.00% |
| 100 | 1.09 s | 98.13% | 0.00% | 98.02% | 0.09% |
| 150 | 4.06 s | 99.24% | 0.00% | 99.18% | 0.05% |
| 200 | 10.44 s | 99.66% | 0.00% | 99.63% | 0.03% |

**Complexity Analysis:**

| Analysis Phase    | Complexity O(n<sup>k</sup>) | 
|:------------------|:--------------------------|
| Total Analysis    | O(n<sup>3.29</sup> &pm; 0.01) |
| FactGenerator     | (Negligible)              |
| LoanPropagation   | O(n<sup>3.29</sup> &pm; 0.01) |
| ExpiredLoans      | O(n<sup>1.42</sup> &pm; 0.19) |

---

</details>
2025-09-19 18:40:05 +02:00
Congcong Cai
a513b70175
[clang-tidy][custom-check][NFC] fix test when CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS disable (#159809) 2025-09-19 16:31:45 +00:00
Mehdi Amini
5f86d0b644 [MLIR] Apply clang-tidy fixes for llvm-qualified-auto in TosaValidation.cpp (NFC) 2025-09-19 09:30:42 -07:00
Fangrui Song
cbb60a32d7
[ELF] Add --print-gc-sections=<file> (#159706)
Add `--print-gc-sections=<file>` to redirect garbage collection section
listing to a file, avoiding contamination of stdout with other linker
output. mold has recently added the option.
GNU ld feature request:
https://sourceware.org/bugzilla/show_bug.cgi?id=33331
2025-09-19 16:22:37 +00:00
Craig Topper
6119d1f115
[RISCV] Re-work how VWADD_W_VL and similar _W_VL nodes are handled in combineOp_VLToVWOp_VL. (#159205)
These instructions have one already narrow operand. Previously, we
pretended like this operand was a supported extension.

This could cause problems when we called getOrCreateExtendedOp on this
narrow operand when creating the the VWADD_VL. If the narrow operand
happened to be an extend of the opposite type, we would peek through it
and then rebuild it with the wrong extension type. So (vwadd_w_vl (i32
(sext X)), (i16 (zext Y))) would become (vwadd_vl (i16 (sext X)), (i16
(sext Y))).

To prevent this, we ignore the operand instead and pass std::nullopt for
SupportsExt to getOrCreateExtendedOp so it won't peek through any
extends on the narrow source.

Fixes #159152.
2025-09-19 09:19:57 -07:00
Krzysztof Parzyszek
24b03d3217
[flang][OpenMP] Move helper functions further up the file, NFC (#159803)
Move them to before any potential users.
2025-09-19 11:13:57 -05:00
Michael Liao
ffb70b00f9 [RISCV] Fix build after e747223c03e16d02cd0dc6f8eedb5c825a7366c1 2025-09-19 12:11:16 -04:00
Jonas Devlieghere
15223548ad
[lldb] Add a static_assert that g_core_definitions matches the Core enum (#159452)
This PR uses the same trick as 7ced9fff95473 to ensure the
`g_core_definitions` table is correctly indexed by the Core enum. It's
easy to make a mistake. Case in point: this caught two entries that
appeared in the wrong order.
2025-09-19 09:06:07 -07:00
Brandon Wu
7f2dcaab39
[NFC][RISCV] Move Zvfbf* relative stuffs to RISCVInstrInfoZvfbf.td (#159619) 2025-09-19 23:57:59 +08:00
Krzysztof Parzyszek
8c189327e5
[flang][OpenMP] Use OmpDirectiveSpecification in SECTIONS (#159580) 2025-09-19 10:50:23 -05:00
Victor Chernyakin
74a0d91343
[clang-tidy] Fix bugprone-sizeof-expression crash on arrays of dependent type (#159701)
Fixes #158422.
2025-09-19 09:43:02 -06:00
Wael Yehia
74bea4c1ad
[IR] enable attaching metadata on ifuncs (#158732)
Teach the IR parser and writer to support metadata on ifuncs, and update
documentation.

In PR #153049, we have a use case of attaching the `!associated`
metadata to an ifunc.
Since an ifunc is similar to a function declaration, it seems natural to
allow metadata on ifuncs.
Currently, the metadata API allows adding Metadata to
llvm::GlobalObject, so the in-memory IR allows for metadata on ifuncs,
but the IR reader/writer is not aware of that.

---------

Co-authored-by: Wael Yehia <wyehia@ca.ibm.com>
2025-09-19 11:41:57 -04:00
Nick Sarnie
69465ebb22
[llvm-readobj][NFC] Format ElfMachineType array definition (#159793)
Planning to add to the list in
https://github.com/llvm/llvm-project/pull/159791, so format it.

Signed-off-by: Sarnie, Nick <nick.sarnie@intel.com>
2025-09-19 15:35:20 +00:00
Aiden Grossman
75dba8ea9e
[lit] Add readfile substitution
This patch adds a new %{readfile:<file name>} substitution to lit. This
is needed for porting a couple of tests to lit's internal shell. These
tests are all using subshells to pass some option to a command are not
feasible to run within the internal shell without this functionality.

Reviewers: petrhosek, jh7370, ilovepi, cmtice

Reviewed By: jh7370, cmtice

Pull Request: https://github.com/llvm/llvm-project/pull/158441
2025-09-19 08:24:05 -07:00
David Spickett
19bc0d6543
Revert "RISCV unwinding enable" (#159790)
Reverts llvm/llvm-project#158161

Due to reported failures on remote Linux and Swift buildbots.
2025-09-19 16:19:46 +01:00
Rahul Joshi
8109c3a27f
[LLVM] Exclude specialized lit test suites from check-all (#159781) 2025-09-19 08:10:58 -07:00
Peter Klausler
80fa3bddd0
[flang] Implement FNUM() (#159433)
The GNU Fortran library function FNUM(u) returns the UNIX file
descriptor that corresponds to an open Fortran unit number, if any;
otherwise -1.

This implementation is a library extension only, not an intrinsic.
2025-09-19 08:09:39 -07:00
David Spickett
b21dd44dbc
[lldb][test] Enable non-address bit WritePointerToMemory test on Linux (#157435)
First added in #153585 for Darwin only. All Linux AArch64 systems also
have Top Byte Ignore enabled in userspace so the test "just works"
there.

FreeBSD has very recently gained Top Byte Ignore support:
4c6c27d3fb

However it's so recent, I don't want to assume it'll be available on any
random FreeBSD system out there.

There isn't really a good place to put this test, so I put it in the top
level of API, next to the other non-address bit test that didn't have a
good home either.
2025-09-19 16:00:33 +01:00
Konrad Kleine
50ef746a12
Fix perf-helper.py (#159745)
When build with assertions, there will be an output like the following
that needs to be filtered out, similar to the other ones.

`'Build config: +assertions'`
2025-09-19 16:56:29 +02:00
Louis Dionne
815b1641a6
[libc++] Disable atomic_wait benchmarks outside of dry-run mode (#158631)
The atomic_wait benchmarks are great, but they tend to overload the
system they're running on. For that reason, we can't run them on our CI
infrastructure on a regular basis.

Instead of removing them, make them unsupported outside of dry-running,
which allows keeping the benchmarks around and ensuring they don't rot,
but doesn't run them along with the other benchmarks. If we need to
investigate atomic_wait performance, it's trivial to mark the benchmark
as supported and run it for local investigations.

This is an alternative to https://github.com/llvm/llvm-project/pull/158289.
2025-09-19 10:54:18 -04:00
Louis Dionne
00333ed377 [libc++] Add a utility to visualize historical benchmark data locally
This should eventually be done using `lnt` instead, but for the time
being this makes it easy to visualize historical data without having
an instance of `lnt` running.
2025-09-19 10:47:09 -04:00