Commit Graph

556058 Commits

Author SHA1 Message Date
Felipe de Azevedo Piovezan
e91786a849 [gdbremote] Document MultiMemRead packet in protocol extensions (#162675)
This adds a specification for the new packet discussed in the RFC [1].

[1]:
https://discourse.llvm.org/t/rfc-a-new-vectorized-memory-read-packet/88441/12
2025-10-15 08:02:39 -07:00
Prabhu Rajasekaran
cac8bdb56c [NFC][llvm] Update call graph section's name. (#163429)
Call graph section emitted by LLVM was named `.callgraph`. Renaming it
to `.llvm.callgraph`.
2025-10-15 07:52:54 -07:00
Joseph Huber
8d66114a03 [Clang] Only link C device libraries by default for OpenMP (#151239)
Summary:
We link these implicitly for OpenMP because it's the canonical
implementation of those C language features. This was inhereted by HIP
and ended up with these resolving functions. There are some useful
functions in here, but this can be problematic as it could potentially
override functions intended to be provided by the ROCm device libraries.
Additionally the HIP runtime does not currently provide the handling for
the RPC server required to run the host resources so those just
segfault.
2025-10-15 09:41:58 -05:00
Rahul Joshi
b54709e9f6 [NFC][MLIR][TableGen] Adopt NamespaceEmitter more widely (#163289)
Adopt NamespaceEmitter more widely in MLIR TableGen.
2025-10-15 07:39:00 -07:00
acture
4721202f35 [OCaml] Make ocaml_doc installation conditional on LLVM_BUILD_DOCS (#154412)
This makes two changes:
 * Only install ocaml docs if LLVM_BUILD_DOCS=ON.
 * Add ocaml_doc target to ALL if LLVM_BUILD_DOCS=ON.

If LLVM_BUILD_DOCS=ON, this ensures that the docs are actually
built before an installation is attempted. For LLVM_BUILD_DOCS=OFF
(the default) this means that there is no attempt to install the
(non-built) ocaml docs anymore.

Fixes #154411.
Fixes #125437.
Fixes #108742.
2025-10-15 16:38:48 +02:00
Felipe de Azevedo Piovezan
ccf6e0250b [lldb] Parse qSupported MultiMemRead tag in GDB Remote Client (#163249)
This is in preparation for the new MultiMemRead packet discussed in the
RFC [1].

An alternative to using `qSupported` would be having clients send an
empty `MultiMemRead` packet. However, this is problematic because the
already-existing packet `M` is a prefix of `MultiMemRead`; an empty
reply would be ambiguous in this case. It is also risky that the stub
might interpret the `MultiMemRead` as a valid `M` packet.

Another advantage of `qSupported` is that this packet is already
exchanged, so parsing a new field is simpler than having to exchange one
extra packet.

[1]:
https://discourse.llvm.org/t/rfc-a-new-vectorized-memory-read-packet/88441
2025-10-15 07:34:06 -07:00
Tim Creech
aa43577278 [LangRef] Clarify that selects can have !unpredictable (#162753)
Originally `!unpredictable` could only appear on branches and switches,
but now it can also appear on selects. This change updates the LangRef
accordingly.
2025-10-15 10:25:52 -04:00
Michael Buch
be93399e61 [clang][Basic] Add helper APIs to get language version codes from LangOptions (#163348)
Motivated by this discussion:
https://github.com/llvm/llvm-project/pull/163208#discussion_r2426842999

We will soon want to emit language version codes into debug-info.
Instead of replicating the `LangOptions -> version code` mapping we
thought we'd try to share some of the logic with the Clang frontend.

This patch teaches `LangStandard` about language versions (currently just C++ and C).
2025-10-15 15:18:25 +01:00
Jakub Kuderski
c4eaf56122 [ADT] Mark StringSwitch Cases with 6+ arguments as deprecated. NFC. (#163405)
Switch to the `.Cases({S0, S1, ...}, Value)` overload instead.

Update existing uses affected by the deprecation and the surrounding
code (for consistency).

This is a part of a larger cleanup of StringSwitch. The goal is to
eventually deprecate all manually-enumerated overloads of Cases with a
hardcoded number of case values (in favor of passing them via an
initializer list). You can find the full explanation here:
https://github.com/llvm/llvm-project/pull/163117.

Start small (6+ arguments) to keep the number of changes manageable.
2025-10-15 14:10:31 +00:00
Mircea Trofin
e2db9a9036 [mlgo][inliner] Fix incorrect state tracking when deferring to the default policy (#163477)
Identified in https://issues.chromium.org/issues/369637577



The problem was that we were missing edge updates when deferring to
non-cold edges.
2025-10-15 07:07:03 -07:00
Kazu Hirata
251ae559be [ByteCode] Remove a redundant call to std::unique_ptr<T>::get (NFC) (#163512) 2025-10-15 06:54:46 -07:00
Kazu Hirata
334d8854e9 [AsmParser] Remove a redundant call to std::unique_ptr<T>::get (NFC) (#163511) 2025-10-15 06:54:38 -07:00
Kazu Hirata
b82baf0f5b [llvm] Remove redundant control flow statements (NFC) (#163509) 2025-10-15 06:54:30 -07:00
Kazu Hirata
e07cd23612 [llvm] Proofread AMDGPUDwarfExtensionsForHeterogeneousDebugging.rst (#163508) 2025-10-15 06:54:22 -07:00
Kazu Hirata
f2306b6304 [llvm] Replace LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]] (NFC) (#163507)
This patch replaces LLVM_ATTRIBUTE_UNUSED with [[maybe_unused]].  Note
that this patch adjusts the placement of [[maybe_unused]] to comply
with the C++17 language.
2025-10-15 06:54:14 -07:00
Nishant Patel
4ff8f118cc [MLIR][Vector] Extend elementwise pattern to support unrolling from higher rank to lower rank (#162515)
This PR enhances the elementwise unrolling pattern to support higher
rank to lower rank unroll. The approach is to add leading unit dims to
lower rank targetShape to match the rank of original vector (because
ExtractStridedSlice requires same rank to extractSlices), extract slice,
reshape to targetShape's rank and perform the operation.
2025-10-15 06:51:23 -07:00
azwolski
316c076694 [X86] Fix X86 conditional load/store optimization for non-constant operands (#163353)
This PR fixes a bug in combineX86CloadCstore where an optimization was
being applied too broadly, causing incorrect code generation.

Without any assumptions about `X` this transformation is only valid when
`Y` is a non zero power of two/single-bit mask.
```cpp
      // res, flags2 = sub 0, (and (xor X, -1), Y)
      // cload/cstore ..., cond_ne, flag2
      // ->
      // res, flags2 = sub 0, (and X, Y)
      // cload/cstore ..., cond_e, flag2
```

We can restrict the optimization to most important case, so only apply
when `llvm::isOneConstant(Op1.getOperand(1))`. It might be not trivial
to find code that creates a SelectionDag with other values of `Y`.

Basline test: https://github.com/llvm/llvm-project/pull/163354
2025-10-15 14:47:09 +01:00
Nikita Popov
deaf7b914b [LowOverheadLoops] Generate test checks (NFC) 2025-10-15 15:46:01 +02:00
Akash Banerjee
bd2ba04ee6 [Flang][OpenMP] Fix USM close semantics and use_device_ptr (#163258)
- Add CLOSE map flag when USM is required.
- use_device_ptr: prevent implicitly expanding member operands.
- Fixes test offload/test/offloading/fortran/usm_map_close.f90.
2025-10-15 14:33:04 +01:00
Matheus Izvekov
acf4e174b0 [clang] fix parsing of late parsed attributes with delayed template parsing (#163483)
This simply ignores 'delayed template parsing' when functions have late
parsed attributes, since these are not MSVC compatible anyway.

Besides ignoring the attribute, this would also cause a memory leak.
2025-10-15 10:30:03 -03:00
Jakub Kuderski
2ed7baafc3 [ADT] Migrate StringSwitch Cases with 6+ arguments to new overload. NFC. (#163549)
Switch to the `.Cases({S0, S1, ...}, Value)` overload instead, and the
manually-enumerated overloads with 6+ arguments are getting deprecated
in https://github.com/llvm/llvm-project/pull/163405.

This pre-commits API updates ahead of the deprecation to make potential
reverts cleaner. This was already reviewed in #163405.
2025-10-15 09:27:37 -04:00
paperchalice
bfee9db785 [DAGCombiner] Remove NoNaNsFPMath uses (#163504)
Users should use `nnan` flag instead.
2025-10-15 21:22:13 +08:00
Nikita Popov
9b9eefa922 [AA] Generate test checks (NFC) 2025-10-15 14:54:21 +02:00
Nikita Popov
a26f4a4c2c [CostModel] Generate test checks (NFC) 2025-10-15 14:54:21 +02:00
Paschalis Mpeis
2f33a2c1c9 [BOLT][NFC] Rename getNames for PLT, TailDuplication (#119870) 2025-10-15 13:53:43 +01:00
Florian Hahn
7f54fccc0e [VPlan] Add ExtractLastLanePerPart, use in narrowToSingleScalar. (#163056)
When narrowing stores of a single-scalar, we currently use
ExtractLastElement, which extracts the last element across all parts.
This is not correct if the store's address is not uniform across all
parts. If it is only uniform-per-part, the last lane per part must be
extracted. Add a new ExtractLastLanePerPart opcode to handle this
correctly. Most transforms apply to both ExtractLastElement and
ExtractLastLanePerPart, with the only difference being their treatment
during unrolling.

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

PR: https://github.com/llvm/llvm-project/pull/163056
2025-10-15 13:46:09 +01:00
Ed Maste
55bd6fb8db [libc++] Bump the FreeBSD builder to Clang 20 (#162564) 2025-10-15 14:45:56 +02:00
Carlos Galvez
67e6a37620 [clang] Remove HelpHidden from the -resource-dir option (#163131)
Currently the "getter" option `-print-resource-dir` is visible when
typing `--help`, but the corresponding "setter" option `-resource-dir`
is not.

This option is useful when one is using clang on a non-standard
location, or when one is building a libtooling-based tool (e.g. IWYU)
based on a local clang build. In that case, we need to specify the
correct path to the resource directory for things to work.

Existing documentation already makes use of this option, for example
here:


https://clang.llvm.org/docs/StandardCPlusPlusModules.html#possible-issues-failed-to-find-system-headers

There is thus no reason to keep this option hidden from the help and
documentation.

---------

Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
2025-10-15 13:54:59 +02:00
Florian Hahn
861519327a [VPlan] Move getCanonicalIV to VPRegionBlock (NFC). (#163020)
The canonical IV is tied to region blocks; move getCanonicalIV there and
update all users.

PR: https://github.com/llvm/llvm-project/pull/163020
2025-10-15 12:48:35 +01:00
nerix
4b89704504 [LLDB][NativePDB] Consolidate simple types (#163209)
This aligns the simple types created by the native plugin with the ones
from DIA as well as LLVM and the original cvdump.

- A few type names weren't handled when creating the LLDB `Type` name
(e.g. `short`)
- 64-bit integers were created as `(u)int64_t` and are now created as
`(unsigned) long long` (matches DIA)
- 128-bit integers (only supported by clang-cl) weren't created as types
(they have `SimpleTypeKind::(U)Int128Oct`)
- All complex types had the same name - now they have `_Complex
<float-type>`

Some types like `SimpleTypeKind::Float48` can't be tested because they
can't be created in C++.
2025-10-15 11:42:14 +00:00
David Sherwood
f29f23711d [Analysis][AArch64][NFC] Change undef to poison in most tests (#163532)
Whenever someone modifies an existing test that has `undef` in it the
github code formatter will complain so it's not easy to know if it's due
to a new or old use. I figured I may as well just do a simple sed
replace of undef with poison in all the tests to clean them up.
Hopefully it makes the contribution process a bit easier.
2025-10-15 12:39:52 +01:00
KAWASHIMA Takahiro
4ad625b15b [clang][docs] Fix typos in option names (#163482) 2025-10-15 20:15:38 +09:00
azwolski
fcd7b8daa1 [X86] Add baseline test for X86 conditional load/store optimization bug (#163354)
This PR adds a baseline test that exposes a bug in the current
`combineX86CloadCstore` optimization. The generated assembly
demonstrates incorrect behavior when the optimization is applied without
proper constraints.

Without any assumptions about `X` this transformation is only valid when
`Y` is a non zero power of two/single-bit mask.
```cpp
      // res, flags2 = sub 0, (and (xor X, -1), Y)
      // cload/cstore ..., cond_ne, flag2
      // ->
      // res, flags2 = sub 0, (and X, Y)
      // cload/cstore ..., cond_e, flag2
```

In the provided test case, the value in `%al` is unknown at compile
time. If `%al` contains `0`, the optimization cannot be applied, because
`(and (xor X, -1), 0)` is not equal to `(and X, 0)`.

Fix: https://github.com/llvm/llvm-project/pull/163353
2025-10-15 11:11:59 +00:00
Paul Walker
727525629e [NFC] Rename AArch64ISD::SRAD_MERGE_OP1 as ASRD_MERGE_OP1.
This aligns with the specific instruction it represents.
2025-10-15 10:58:59 +00:00
Ebuka Ezike
17e06aa88f [lldb] Only get child if m_storage and m_element_type is valid (#163077)
This causes a crash because lldb-dap will check the first child to see
if it is array like to lazy load the children.
2025-10-15 11:57:03 +01:00
Ebuka Ezike
e249c51010 [lldb-dap][test] create temp source file in test directory. (#163383)
Fixes #163288

---------

Co-authored-by: Jonas Devlieghere <jonas@devlieghere.com>
2025-10-15 11:55:29 +01:00
Andrei Golubev
3141bdefff [mlir][bufferization] Test tensor encoding -> memref layout conversion (#161166)
Support custom types (4/N): test that it is possible to customize memref
layout specification for custom operations and function boundaries.

This is purely a test setup (no API modifications) to ensure users are
able to pass information from tensors to memrefs within bufferization
process. To achieve this, a test pass is required (since bufferization
options have to be set manually). As there is already a
--test-one-shot-module-bufferize pass present, it is extended for the
purpose.
2025-10-15 12:44:17 +02:00
Hari Limaye
bf643165ee [DAG] Fix incorrect doxygen comment for isZeroOrZeroSplat (NFC) (#163527) 2025-10-15 11:43:54 +01:00
Benjamin Maxwell
8b93f27cf7 [AArch64][SME] Fixup ABI routine insertion points to avoid clobbering NZCV (#161353)
This updates the `MachineSMEABIPass` to find insertion points for state
changes (i.e., calls to ABI routines), where the NZCV register (status
flags) are not live.

It works by stepping backwards from where the state change is needed
until we find an instruction where NZCV is not live, a previous state
change, or a call sequence. We conservatively don't move into/over
calls, as they may require a different state before the start of the
call sequence.
2025-10-15 10:57:02 +01:00
Corentin Jabot
bcf9e91714 [Clang] Fix a regression introduced by #161163. (#162612)
Classes with a user provided constructor are still implicit lifetime if
they have an implicit, trivial copy ctr.
2025-10-15 11:54:04 +02:00
Shawn K
8395a36f22 [Clang] VectorExprEvaluator::VisitCallExpr / InterpretBuiltin - allow AVX512 mask broadcast intrinsics to be used in constexpr (#163475)
Fix #161334
2025-10-15 09:52:18 +00:00
Shenghang Tsai
fbd6ac3596 [MLIR][shard] Fix tblgen description of shard.neighbors_linear_indices (#163409)
This PR fixed an issue where inline code blocks in the ODS description of `shard.neighbors_linear_indices` were not properly closed.
2025-10-15 17:48:04 +08:00
Lukacma
4145818aa2 Revert "[AArch64] Add intrinsics for multi-vector FEAT_SVE_BFSCALE instructions" (#163535)
Reverts llvm/llvm-project#163346
2025-10-15 10:30:40 +01:00
Lukacma
8a09111fe4 [AArch64] Add intrinsics for multi-vector FEAT_SVE_BFSCALE instructions (#163346)
This patch add intrinsics support for multi-vector BFMUL and BFSCALE
instruction based on
[this](https://github.com/ARM-software/acle/pull/410) ACLE specification
proposal
2025-10-15 10:29:38 +01:00
shashank1545
140d46579f [X86][ByteCode] Allow PSHUFB intrinsics to be used in constexpr #156612 (#163148)
The PSHUFB instruction shuffles bytes within each 128-bit lane: for each
control byte, if bit 7 is set, the output byte is zeroed; otherwise, the
low 4 bits select a source byte (0–15) from the same lane.

Note: _mm_shuffle_pi8 function had to change as __anyext128 had negative
indices which are invalid in constant expression context.

Fixes #156612
2025-10-15 09:27:49 +00:00
Chuanqi Xu
9734aa8c02 [NFC] [clang] Add comments for a defect
See the patch for details.

I tried to solve the defect left in previous refactorings
but found it was more complex. Add the comment to state
it more clearly.
2025-10-15 17:18:52 +08:00
XiaShark
7f7f24944a [AArch64PostCoalescer] Propagate undef flag after replacing (#163119)
I encountered a compilation crash issue, and after analysis, it was
caused by the AArch64PostCoalescerPass, see https://godbolt.org/z/vPeqeo5Pa.
When replacing the register, if the source register has undef flag, we
should propagate the flag to all uses of the destination register.
2025-10-15 10:15:44 +01:00
Peter Arzt
cd24d108a2 [OpenMP] Fix preprocessor mismatches between include and usages of hwloc (#158349)
Fix https://github.com/llvm/llvm-project/issues/156679

There is a mismatch between the preprocessor guards around the include
of `hwloc.h` and those protecting its usages, leading to build failures
on Darwin: https://github.com/spack/spack-packages/pull/1212

This change introduces `KMP_HWLOC_ENABLED` that reflects
whether hwloc is actually used.
2025-10-15 10:58:41 +02:00
aokblast
c9b07f34d4 [LLDB, FreeBSD, x86] Fix empty register set when trying to get size of register (#162890)
The register set information is stored as a singleton in
GetRegisterInfo_i386. However, other functions later access this
information assuming it is stored in GetSharedRegisterInfoVector. To
resolve this inconsistency, we remove the original construction logic
and instead initialize the singleton using llvm::call_once within the
appropriate function (GetSharedRegisterInfoVector_i386).
2025-10-15 09:55:00 +01:00
Artem Kroviakov
0a71fd1528 [MLIR][Vector] Improve warp distribution robustness (#161647) 2025-10-15 10:52:24 +02:00