568067 Commits

Author SHA1 Message Date
Alexey Bataev
6377c86d71 Revert "[SLP]Remove LoadCombine workaround after handling of the copyables"
This reverts commit 8dbb9f66e8b14a8a06f1873a2c1b7dce366ed2d6 to fix
buildbot issues https://lab.llvm.org/buildbot/#/builders/224/builds/2795
2026-02-05 09:57:00 -08:00
David Green
8f484ff2a0
[AArch64] Add FeatureUseFixedOverScalableIfEqualCost to Neoverse-V3 and Neoverse-V3ae (#179903)
This was missing from neoverse-v3 and neoverse-v3ae, but should be
present like neoverse-v2.
2026-02-05 17:55:49 +00:00
Justin Fargnoli
ca93dd399e
Reland "[NVPTX] Validate user-specified PTX version against SM version" (#179304)
Previous commit message: 

> Original commit message:
>
>>When users explicitly specify a PTX version via -mattr=+ptxNN that's
insufficient for their target SM, we now emit a fatal error. Previously,
we silently upgraded the PTX version to the minimum required for the
target SM.
>>
>>When no SM or PTX version is specified, we now use PTX 3.2 (the
minimum for the default SM 3.0) instead of PTX 6.0.
>
>The following commits should fix the failures that arose when I
previously tried to land this commit:
>

>9fc5fd0ad6
should address the llvm-nvptx*-nvidia-* build failures:
https://github.com/llvm/llvm-project/pull/174834#issuecomment-3742242651
>

>600514a637
should address the MLIR failures

---

The previous commit was reverted with
d23cb79ba497281de050ef609cb91b91058bf323 because the
[mlir-nvidia](https://lab.llvm.org/buildbot/#/builders/138/builds/24797)
and
[mlir-nvidia-gcc7](https://lab.llvm.org/buildbot/#/builders/116/builds/23929)
Buildbots were failing.

Those tests failed because MLIR's default SM was 5.0, which caused NVPTX
to target PTX ISA v4.0, which did not support the intrinsics used in the
failing tests.

243f011577193c99358ccc4142b296d4fa80ea11 should address this by bumping
MLIR's default SM to 7.5. Now, using MLIR's new default SM, NVPTX
targets the PTX ISA v6.3, which supports the intrinsics used in the
failing tests.
2026-02-05 17:42:41 +00:00
Simon Pilgrim
c662f11c7d
[X86] mayFoldIntoVector - ensure we check for custom lowering to logic/add/sub ops (#179988)
As noted on #174761 - we need to ensure custom lowering to logic/add/sub
ops might actually occur before assuming the node will have been on the
vector unit
2026-02-05 17:42:26 +00:00
Jinsong Ji
00ba2ef1e3
[NFC] Fix darwin failures due to missing headers (#179989)
Handle the include similar to ProgramTest, to fix the build failures in
darwin
```

/Users/buildbot/buildbot-root/aarch64-darwin/llvm-project/llvm/unittests/CAS/OnDiskCASLoggerTest.cpp:38:15: error: use of undeclared identifier '_NSGetEnviron'
      return *_NSGetEnviron();
              ^
1 error generated.

```
2026-02-05 17:40:20 +00:00
Alexander Weinrauch
3b16468814
[AMDGPU] Global and Buffer loads to LDS should not increase lgkmcnt (#179305)
`global_load_lds` and `buffer_load to lds` do only increment `vmcnt` and
not touch `lgkmcnt`. This causes invalid `waitcnts` for some Triton
kernels, similar to the added lit tests.

Note that the change for buffer ops is not necesssary, i.e. the lit test
passes even before this PR, because it seems like `SIInsertWaitcnts`
does not use `LGKM_CNT` for buffer ops. But this change might prevent a
bug in the future.
2026-02-05 09:36:00 -08:00
Jay Foad
77034cd325
[CodeGen] Make use of TargetRegisterInfo::findCommonRegClass. NFC. (#179981) 2026-02-05 17:22:46 +00:00
Marcell Leleszi
d31dbb9555
[libc][wctype] Move classification lookup tables to a cpp file (#174993)
#170525

Previously, lookup tables were defined in a header so that they can be
constexpr, but this lead to each translation unit having it's own copy,
bloating the library size. Looking at current usages of wctype
functions, they are always used at runtime, so there's no benefit of
having them constexpr, so I'm moving them to a cpp file, so that there's
only a single copy in the library.
2026-02-05 17:58:50 +01:00
Aiden Grossman
a76f63870e
Fix Bazel build for 823e3e0 (#179980)
Co-authored-by: Pranav Kant <prka@google.com>
2026-02-05 08:53:52 -08:00
Jinsong Ji
94b39b524d
[NFC][CAS][Unittests] Pass env for MultiProcess tests (#179949)
Set up the test similar to ProgramTest to avoid missing necessary env.

eg: In our downstream build, the process would rely on a shared libs,
the test would fail to find the dependent lib if we don't pass the env
down to multiprocess test.
2026-02-05 11:49:18 -05:00
SiliconA-Z
37aba1b5d4
[ARM] Set operation action for UMULO and SMULO as Custom if not Thumb1 (#154253)
We should specify a custom lowering for SMULO and UMULO like we do for
AArch64, but only if not Thumb 1 obviously.
2026-02-05 08:47:56 -08:00
Michael Platings
18ecdbfe6c
[mlir][vector-to-gpu]: Lower transposed strided transfer_read
Add support for lowering vector.transfer_read to
gpu.subgroup_mma_load_matrix with transpose permutation_map
with non-minor dimensions e.g. (d0, d1, d2) -> (d2, d0)
2026-02-05 16:40:59 +00:00
Balázs Benics
e59e9fcd38
[clang][ssaf] Add FormatInfo sub-registry and tests [2/2] (#179517)
Add `FormatInfoEntry` template to support per-analysis-type
serialization within a `SerializationFormat`.
This allows to implement different formats for the different analyses in
a decoupled way.

For testing, this patch also implements the MockSerializationFormat
demonstrating the FormatInfo sub-registry pattern.

Assisted-by: claude
Depends on #179516
rdar://169192127
2026-02-05 16:37:21 +00:00
anjenner
903a5ab93d
[AMDGPU] [GlobalISel] Add register bank legalize rules for G_FEXP2 (#179954)
Also G_INTRINSIC_TRUNC, G_INTRINSIC_ROUNDEVEN, G_FFLOOR, G_FCEIL, and
G_FLOG2.
2026-02-05 16:35:31 +00:00
Balázs Benics
77740f5577
[clang][ssaf] Add SerializationFormatRegistry [1/2] (#179516)
Add a registry infrastructure for SerializationFormat implementations,
enabling registration and instantiation of different serialization
formats.

For example:
```c++
  static SerializationFormatRegistry::Add<MyFormat>
    RegisterFormat("MyFormat", "Description");
```

Formats can then be instantiated by name using `makeFormat()`.

The patch also updates the SerializationFormat base class to accept
FileSystem for virtualising reading inputs eg. by using file overlays in
the future.

Assisted-by: claude
rdar://169192127
2026-02-05 16:34:54 +00:00
Nick Sarnie
3a08424124
[SPIRV] Do not emit @llvm.used (#179498)
Extending the work from https://github.com/llvm/llvm-project/pull/162678
which skips `llvm.compiler.used`, we also need to skip processing of
`llvm.used`.

The OpenMP frontend puts an `addrspace(2)` variable in `llvm_used`, but
the `llvm.used` array type uses the generic AS `addrspace(4)` so there's
a `addrspacecast` from `2` to `4` inside the initalizer for `llvm.used`
which is illegal and errors in the backend.

There is
[discussion](https://github.com/llvm/llvm-project/pull/162678#issuecomment-3396735124)
in the above linked PR that the handing should be the same for
`llvm.used` and `llvm.compiler.used`, but `llvm.used` was not added to
minimize the scope of the PR.

This is required to use the OpenMP Device RTL with SPIR-V.

Signed-off-by: Nick Sarnie <nick.sarnie@intel.com>
2026-02-05 16:28:23 +00:00
Nikita Popov
722c2f0221
[ExpandIRInsts] Support int bw < float bw in itofp expansion (#179963)
Handle this case by extending the integer to a wider type. This can
probably be handled more optimally, but this is conservatively correct.

Proof: https://alive2.llvm.org/ce/z/0RwDO1
2026-02-05 17:26:12 +01:00
John Harrison
35ada11f1b
[lldb-dap] Improving stability of TestDAP_launch_commands. (#179783)
Improving stability of the TestDAP_launch_commands test.

When collecting output for verifying 'stopCommands' we were not waiting
for the output to finish, which could cause issues if the test is
running very fast.
2026-02-05 08:19:14 -08:00
Vigneshwar Jayakumar
2dcd75eb44
[AMDGPU] Fix missing waitcnt after buffer_wbl2 (#178316)
On GFX9, BUFFER_WBL2 is used to write back dirty cache lines and
requires an s_waitcnt vmcnt(0) afterwards to ensure completion.

This patch fixes by incrementing vmcnt for buffer_wbl2 instruction

---------

Co-authored-by: Jay Foad <jay.foad@gmail.com>
2026-02-05 10:13:51 -06:00
Luke Lau
63918f51aa
[RISCV] Fold vmerge into op with undef passthru by using vmerge's vl (#179862)
Currently we only fold an op into vmerge if we know the smaller of the
two vls, because we can't increase the vl.

However if the op's passthru is undef, then we can just use vmerge's vl
because the lanes past op's vl were undef anyway. We need to make sure
that the op doesn't access memory though. Other instructions where the
result depends on the VL should already be handled by the
RISCVII::elementsDependOnVL check below.

This is probably always profitable because even though we increase vl,
we remove a vmerge which needs to process vl elements anyway.

This removes some regressions in #179622.
2026-02-06 00:13:14 +08:00
Luke Lau
9ed7ba87c4
[RISCV] Remove redundant vand.vi with fpto*i to i1 (#179876)
If the source of an fpto*i doesn't fit in the destination type, the
result is poison. For i1 destinations, this means the result needs to be
0 or 1/-1, so we can just compare the result to 0 directly instead of
truncating.

The VP lowering for fpto*i already does this.
2026-02-06 00:06:32 +08:00
Matt Arsenault
a9adf7d1e3
GlobalISel: Remove unused argument from CSEInfo (#179962)
Nothing uses this force recomputation.
2026-02-05 16:03:08 +00:00
Muhammad Bassiouni
e92fdcda76
[libc][math] Fix build failures from last refactor. (#179966) 2026-02-05 18:02:41 +02:00
Aiden Grossman
f513f44bc6
[Inline] Remove redundant run lines in tests (#179959)
625038d5d5f406385f44983ac2a442b20ad7b241 added NewPM CGSCC coverage to
all of the inliner tests. Now that the NewPM is the default for the
middle end, both check lines cover the same thing (with -passes="inline"
expanding to -passes="cgscc(inline)"). Given that, remove them to get
rid of the redundancy and make the tests run slightly faster (not
measured).
2026-02-05 07:54:37 -08:00
Henry Linjamäki
0c8b435c57
[Clang][retry 2] Lift HIPSPV onto the new offload driver (#179902)
Update HIPSPV toolchain to support `--offload-new-driver`. Additionally,
tailor llvm-spirv invocation for
[chipStar](github.com/CHIP-SPV/chipStar) via `spirv64-*-chipstar`
offload triple.

AFAICT, all the relevant test failures in the previous PR (#178664) came
from tests involving `-Xoffload-compiler ‘-###’` in their RUN
directives. I have reworked those tests in this PR.
2026-02-05 09:52:04 -06:00
Yury Plyakhin
4d27530c69
[Offloading] Offload Binary Format V2: Support Multiple Entries (#169425)
This PR updates the OffloadBinary format from version 1 to version 2,
enabling support for multiple offloading entries in a single binary.
This allows combining multiple device images into a single binary with
common global metadata while maintaining backwards compatibility with
version 1 binaries.

# Key Changes
## Binary Format Enhancements
  **Version 2 Format Changes:**
  - Changed from single-entry to multi-entry design
  - Updated `Header` structure:
    - Renamed `EntryOffset` → `EntriesOffset` (offset to entries array)
    - Renamed `EntrySize` → `EntriesCount` (number of entries)
- Added `StringEntry::ValueSize` field to support explicit string value
sizes (enables non-null-terminated strings)
- Introduced `OffloadEntryFlags` enum with `OIF_Metadata` flag for
metadata-only entries (entries without binary images)

  **API Changes:**
- `OffloadBinary::create()` now returns
`Expected<SmallVector<std::unique_ptr<OffloadBinary>>>` instead of
single binary
- Added optional `Index` parameter to extract specific entry:
`create(Buffer, std::optional<uint64_t> Index)`
- `OffloadBinary::write()` now accepts `ArrayRef<OffloadingImage>`
instead of single image
  - Added `OffloadBinary::extractHeader()` for header extraction

  **Memory Management:**
- Implemented `SharedMemoryBuffer` class to enable memory sharing across
multiple `OffloadBinary` instances from the same file
- Multiple entries from a single serialized binary share the underlying
buffer

## Testing
  **Unit Tests (`unittests/Object/OffloadingTest.cpp`):**
- `checkMultiEntryBinaryExtraction`: Tests extracting all entries from a
multi-entry binary
- `checkIndexBasedExtraction`: Tests extracting specific entries by
index, including out-of-bounds validation
  - `checkEdgeCases`: Tests edge cases including:
    - Empty string metadata
    - Empty image data
    - Large string values (4KB)

  **Other Tests:**
- Updated `test/ObjectYAML/Offload/multiple_members.yaml` to include
metadata-only entry

---------

Co-authored-by: Joseph Huber <huberjn@outlook.com>
2026-02-05 07:46:57 -08:00
Zorojuro
10910771e8
[libc][math] Refactor f16fmaf128 to Header Only (#177850)
Closes #175318 

In preparation for:
https://discourse.llvm.org/t/rfc-make-clang-builtin-math-functions-constexpr-with-llvm-libc-to-support-c-23-constexpr-math-functions/86450
2026-02-05 17:44:53 +02:00
Alexey Bataev
8dbb9f66e8
[SLP]Remove LoadCombine workaround after handling of the copyables
LoadCombine pattern handling was added as a workaround for the cases,
where the SLP vectorizer could not vectorize the code effectively. With
the copyables support, it can handle it directly.

Also, patch adds support for scalar loads[ + bswap] pattern for byte
sized loads (+ reverse bytes for bswap)

Reviewers: RKSimon, hiraditya

Pull Request: https://github.com/llvm/llvm-project/pull/174205
2026-02-05 10:42:08 -05:00
Aiden Grossman
f5175208cc [ProfCheck] Add ExpandIRInsts test to xfail list
We have not finished fixing all the ExpandIRInsts tests for the
profcheck configuration (PRs are in flight), so disable for now until
those land so it is easier to catch more regressions.
2026-02-05 15:40:41 +00:00
Yanzuo Liu
ddda8d7d25
[clang][bytecode] Fix reading union template parameter object (#179899)
Before this patch, reading union template parameter object will trigger
diagnostics saying it's not initialized. This patch fixes this issue.

Reading union template parameter with no active fields, class type
fields, or bit-fields is handled as a drive-by.

AI usage: The implementation was generated by AI and modified by me
afterwards.

Assisted-by: GPT-5.2

---------

Co-authored-by: Timm Baeder <tbaeder@redhat.com>
2026-02-05 16:37:58 +01:00
Nikita Popov
d3fb3c5d36
[GISel][CallLowering] Keep IR types longer (#179946)
GISel CallLowering currently does a Type -> EVT -> Type roundtrip early
on when populating ArgInfo in splitToValueType(). This is a bit odd as
this structure operates at the IR Type level. Keep the original type
there and only convert to EVT when performing assignments.
2026-02-05 16:37:08 +01:00
Eugene Epshteyn
25b4609b55
[flang][NFC] Converted five tests from old lowering to new lowering (part 14) (#179852)
Tests converted from test/Lower: dummy-procedure-character.f90,
dummy-procedure-in-entry.f90, dummy-procedure.f90, equivalence-1.f90,
equivalence-2.f90
2026-02-05 10:32:47 -05:00
Nikita Popov
d737229efd
[ExpandIRInsts] Allow int bw == float bw in itofp (#179943)
I don't think anything here requires the integer bit width to be
strictly larger. It's fine if it's the same (in which case some zexts
just go away).

Add tests on half + i32 that can be verified by alive2. Note that half
is handled via float, so the minimum supported type is i32 rather than
i16.

Proof (uitofp): https://alive2.llvm.org/ce/z/CsMfkU
Proof (sitofp): https://alive2.llvm.org/ce/z/jzuxyt
2026-02-05 16:21:19 +01:00
vangthao95
e0c2cc7ed0
[AMDGPU][GlobalISel] Add buffer store byte/short RegBankLegalize rules (#179367) 2026-02-05 07:18:39 -08:00
LLVM GN Syncbot
8283972837 [gn build] Port 427bb1cc1b09 2026-02-05 15:11:00 +00:00
Minsoo Choo
427bb1cc1b
[lldb] Remove mips64 support for FreeBSD (#179582)
The last FreeBSD version supporting mips64 is FreeBSD 13 which will be
EOLed on April 30th. LLVM 23.1.0 release is expected to be August 25th
according to the LLVM calendar. The usage of mips64 is less noticeable
so it's hard to know if it is properly working, and even if it works, it
is hard to test new features on FreeBSD mips64.

Thus, remove support for mips64 on FreeBSD.

---------

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
2026-02-05 15:07:27 +00:00
Tom Stellard
549172139c
workflows/release-asset-audit: Split workflow into two jobs (#179833)
This way we can assign an environment to the job that uses the
ISSUE_SUBSCRIBER_TOKEN secret.
2026-02-05 07:06:16 -08:00
Donát Nagy
41de4b1c6f
[NFC][analyzer] Cleanup dead code around NodeBuilder (#179711)
As I was trying to understand the class `NodeBuilder` and its
subclasses, I wasted a few hours on studying dead or needlessly
complicated code. I'm creating this patch to ensure that others in the
future won't need to bother with this cruft.

This commit eliminates three deficiencies:
- (Small change:) In a constructor of `StmtNodeBuilder` I switched to
using the `takeNodes()` overload which accepts an `ExplodedNodeSet`
(instead of manually iterating).
- The `Finalized` attribute of NodeBuilder was completely irrelevant (it
was always initialized to `true`).
- The "main" feature of `NodeBuilderWithSinks` was that it gathered the
generated sink nodes into a set, but this was never actually used. As
the only other feature (storing a `ProgramPoint` in a data member) was
very trivial, I replaced this class with a plain `NodeBuilder` in the
only location that used it.
2026-02-05 16:04:46 +01:00
Craig Topper
bfbbed1327
[RISCV] Call updateCZceFeatureImplications from RISCVAsmParser::setFeatureBits. (#179870) 2026-02-05 07:03:26 -08:00
LLVM GN Syncbot
03190b06bb [gn build] Port 4f3ba73896e4 2026-02-05 14:51:58 +00:00
Minsoo Choo
f384602c1c
[lldb] [Process/Utility] Update code url for FreeBSD in comments (#178556)
FreeBSD has moved from svn to git. Use https://cgit.freebsd.org/src
instead as it is the source of truth. i386 and mips64 were no longer
supported as of FreeBSD 15 and 14, respectively, so link stable branch
instead of main branch. See [FreeBSD platforms
page](https://www.freebsd.org/platforms/).

---------

Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
2026-02-05 14:51:46 +00:00
Minsoo Choo
3767803660
[lldb][docs] Add FreeBSD kernel debugging information (#179597)
Signed-off-by: Minsoo Choo <minsoochoo0122@proton.me>
2026-02-05 14:45:59 +00:00
Soumik Kumar Basu
50e3d0cee5
[flang][driver] Improve diagnostic for assembly inputs
When an assembly file is passed to the Flang driver, it currently fails
with a confusing internal error mentioning the unsupported `-cc1as`
tool.

This update detects assembly inputs early in the driver and emits a
clear, user-facing diagnostic explaining that Flang does not support
assembly files as input. The logic is implemented in a small helper
function and is intentionally temporary, so it can be removed once Flang
gains support for assembling inputs.

Fixes: #173528
2026-02-05 07:43:42 -07:00
Alexander Kornienko
7165353506
Revert "[LoopVectorize] Support vectorization of overflow intrinsics" (#179819)
Reverts llvm/llvm-project#174835, which causes clang crashes.

See
https://github.com/llvm/llvm-project/pull/174835#issuecomment-3844233831
and https://github.com/llvm/llvm-project/issues/179671 for details.
2026-02-05 15:41:49 +01:00
Ebuka Ezike
e6560a3c57
[lldb-dap] Allow evaluate requests without a frame context (#179667)
EvaluateRequests handler now uses the target's context if no valid
frameId is provided, enabling evaluation of
global variables without requiring a valid stack frame.

In repl mode it now uses the last `successful` variable or command
expression, if the provided user's expression is empty.
Try to evaluate the expression if the evaluation context is `Unknown`
2026-02-05 14:26:28 +00:00
Utkarsh Saxena
4f3ba73896
[LifetimeSafety] Revisit tracking moved objects (#178670)
Improve lifetime safety analysis by tracking moved objects and providing
more precise warnings for potentially false positive cases.

- Added support for detecting moves in function calls with rvalue
reference parameters
- Added a new `MovedOriginFact` to track when objects are moved
- Modified the lifetime checker to detect when a loan's storage has been
moved
- Added new diagnostic messages that indicate when a warning might be a
false positive due to moved storage
- Added notes in diagnostics to show where objects were potentially
moved
2026-02-05 14:22:18 +00:00
Florian Hahn
05a2b146fb
[LV] Optimize FindLast recurrences to FindIV (NFCI). (#177870)
This patch restructures Find(First|Last)IV handling. Instead of
differentiating between FindLast, FindFirstIV and FindLastIV up front,
this patch simplifies the logic in IVDescriptor to just identify the
FindLast pattern up-front.

It then adds a new VPlan transformation to optimize FindLast reductions
to FindIV reductions if there is a suitable sentinel value.
Find(Last|First)IV recurrence kinds to a single FindIV kind.

This is simpler and more accurate, given selecting the first/last
induction of the final IV reduction is directly controlled by the
corresponding recurrence kind of the ComputeReductionResult.

The new structure also allows further optimizations, like vectorizing
FindLastIV with another boolean reduction that tracks if the condition
in the loop was ever true, if there is no suitable sentinel value.

PR: https://github.com/llvm/llvm-project/pull/177870
2026-02-05 13:57:20 +00:00
Matthew Devereau
3ee7a2f62b
Add clmul zext AArch64 lowering tests (#179641) 2026-02-05 13:48:36 +00:00
Matt Arsenault
80569fefba
ADT: Mark DenormalMode comparison operators as constexpr (#179939)
Try to fix buildbot error with gcc.
2026-02-05 14:43:40 +01:00
Sirui Mu
b9f3710c0e
[CIR] Add TargetLowering pass (#179245)
This patch adds a new TargetLowering pass to the CIR pipeline. The new
pass is run immediately before CXXABILowering. This new pass does not
perform any heavy transformations yet -- for now it only converts sync
scopes attached to load and store operations according to the target
info, which was done in the LLVM lowering pass.

Related to #175968 .
2026-02-05 21:40:50 +08:00