Commit Graph

541698 Commits

Author SHA1 Message Date
Hristo Hristov
945ce1aa3d [libc++] Update the value of __cpp_lib_constrained_equality after P3379R0 (#144553)
https://wg21.link/P3379R0 updated the value of __cpp_lib_constrained_equality,
but we forgot to update it when we implemented the paper.
2025-06-20 12:36:46 -04:00
Shilei Tian
edbaf19c46 [AMDGPU] Fix a potential integer overflow in GCNRegPressure when true16 is enabled (#144968)
Fixes SWDEV-537014.
2025-06-20 12:29:32 -04:00
Muzammil
379a609dad [mlir][arith][transforms] Adds f4E2M1FN support to truncf and extf (#144157)
See work detail: https://github.com/iree-org/iree/issues/20920

Add support for f4E2M1FN in `arith.truncf` and `arith.extf` ops though a software emulation

---------

Signed-off-by: Muzammiluddin Syed <muzasyed@amd.com>
2025-06-20 11:27:35 -05:00
Jameson Nash
940ff110d7 [InstCombine] fix hwasan mistake in "remove dead loads" (#145057)
Detected by CI after #143958.
2025-06-20 12:22:59 -04:00
Michael Buch
877511920d Revert "[lldb][DWARF] Remove object_pointer from ParsedDWARFAttributes" (#145065)
Reverts llvm/llvm-project#144880

Caused `TestObjCIvarsInBlocks.py` to fail on macOS CI.
2025-06-20 17:20:58 +01:00
Justin King
bfef8732be msan: Support free_sized and free_aligned_sized from C23 (#144529)
Adds support to MSan for `free_sized` and `free_aligned_sized` from C23.

Other sanitizers will be handled with their own separate PRs.

For https://github.com/llvm/llvm-project/issues/144435

Signed-off-by: Justin King <jcking@google.com>
2025-06-20 09:16:40 -07:00
Krzysztof Parzyszek
6ba1955ba2 [flang][OpenMP] Fix ignore-target-data.f90 test
Allow the function definition line to match with and without attrbute
set number.

This fixes build break after PR144534:
https://lab.llvm.org/buildbot/#/builders/157/builds/31331

Also move the test to the OpenMP subdirectory where it should have
been from the beginning.
2025-06-20 11:09:07 -05:00
Chenguang Wang
72de0e4584 [TableGen][Docs] Fix empty list syntax in TableGen doc. (#145041)
`[]<list<int>>` actually produces `list<list<int>>`.
2025-06-20 09:07:35 -07:00
Amir Ayupov
770b16cd49 [BOLT][test] Update X86/perf2bolt-spe.test (#145061)
Address NFC mismatches caused by running perf2bolt from under the
wrapper script:
https://lab.llvm.org/buildbot/#/builders/92/builds/20938
> <stdin>:2:64: note: possible intended match here
>
/home/worker/bolt-worker2/bolt-x86_64-ubuntu-nfc/build/bin/llvm-bolt.old:
-spe is available only on AArch64.

Test Plan:
ninja check-bolt
2025-06-20 09:07:08 -07:00
Timm Baeder
32fc625a3f Reapply "Reapply "[clang][bytecode] Allocate IntegralAP and Floating … (#145014)
…types usi… (#144676)"

This reverts commit 68471d29ee.

IntegralAP contains a union:
  union {
    uint64_t *Memory = nullptr;
    uint64_t Val;
  };

On 64bit systems, both Memory and Val have the same size. However, on 32
bit system, Val is 64bit and Memory only 32bit. Which means the default
initializer for Memory will only zero half of Val. We fixed this by
zero-initializing Val explicitly in the IntegralAP(unsigned BitWidth)
constructor.


See also the discussion in
https://github.com/llvm/llvm-project/pull/144246
2025-06-20 18:06:01 +02:00
Simon Pilgrim
151ee0faad [X86] SimplifyDemandedVectorEltsForTargetNode - ensure X86ISD::VPERMILPV node use v2f64/v4f32 types
When reducing v4f64/v8f32 non-lane crossing X86ISD::VPERMV nodes, we use X86ISD::VPERMILPV nodes for 128-bits, but these are only available for fp types.

Fixes #145046
2025-06-20 17:03:30 +01:00
Jonas Devlieghere
749e4a53d2 [lldb] Fix ASCII art in CommandObjectProtocolServer (NFC) 2025-06-20 10:54:00 -05:00
Jay Foad
6e86b7e34b [AMDGPU] Do not replace SALU floating point multiply with VALU-only ldexp (#145048) 2025-06-20 16:52:43 +01:00
LLVM GN Syncbot
78971916da [gn build] Port 9524bfb270 2025-06-20 15:48:30 +00:00
Jonas Devlieghere
9524bfb270 [lldb] Add Model Context Protocol (MCP) support to LLDB (#143628)
This PR adds an MCP (Model Context Protocol ) server to LLDB. For
motivation and background, please refer to the corresponding RFC:
https://discourse.llvm.org/t/rfc-adding-mcp-support-to-lldb/86798

I implemented this as a new kind of plugin. The idea is that we could
support multiple protocol servers (e.g. if we want to support DAP from
within LLDB). This also introduces a corresponding top-level command
(`protocol-server`) with two subcommands to `start` and `stop` the
server.

```
(lldb) protocol-server start MCP tcp://localhost:1234
MCP server started with connection listeners: connection://[::1]:1234, connection://[127.0.0.1]:1234
```

The MCP sever supports one tool (`lldb_command`) which executes a
command, but can easily be extended with more commands.
2025-06-20 10:48:04 -05:00
Kazu Hirata
887222e352 [mlir] Migrate away from ArrayRef(std::nullopt) (NFC) (#144989)
ArrayRef has a constructor that accepts std::nullopt.  This
constructor dates back to the days when we still had llvm::Optional.

Since the use of std::nullopt outside the context of std::optional is
kind of abuse and not intuitive to new comers, I would like to move
away from the constructor and eventually remove it.

This patch takes care of the mlir side of the migration, starting with
straightforward places where I see ArrayRef or ValueRange nearby.
Note that ValueRange has a constructor that forwards arguments to an
ArrayRef constructor.
2025-06-20 08:33:59 -07:00
Joseph Huber
3f1de197b1 [Offload] Rework compiling device code for unit test suites (#144776)
Summary:
I'll probably want to use this as a more generic utility in the future.
This patch reworks it to make it a top level function. I also tried to
decouple this from the OpenMP utilities to make that easier in the
future. Instead, I just use `-march=native` functionality which is the
same thing. Needed a small hack to skip the linker stage for checking if
that works.

This should still create the same output as far as I'm aware.
2025-06-20 10:31:54 -05:00
Simon Pilgrim
c734377544 [DAG] foldMaskedMerge - fix Wparentheses operator precedence warning. NFC. 2025-06-20 16:20:28 +01:00
Jeremy Kun
b533b0ec34 Define a DataFlowSolver helper that loads sensible default analyses (#143415)
Cf. https://discourse.llvm.org/t/mlir-dead-code-analysis/67568/10

Custom analysis passes will not work properly unless both
DeadCodeAnalysis and SparseConstantPropagation are loaded to the
DataFlowSolver. This is intended behavior, but surprising to many users
as shown in the thread. In lieu of a longer-term fix (which I am not
knowledgeable enough to implement myself, yet), this commit adds a
helper function that loads these two analyses, as well as providing
breadcrumbs for an explanation of the problem. The existing places in
the codebase where these two analyses are loaded for the purpose of
running other unrelated analyses are replaced by the use of the helper.

---------

Co-authored-by: Jeremy Kun <j2kun@users.noreply.github.com>
Co-authored-by: Oleksandr "Alex" Zinenko <azinenko@amd.com>
2025-06-20 08:16:52 -07:00
Douglas
71e20c6c86 Fix references to required libraries when building LLVM with ASAN and MultiThreaded[Debug] on Windows (#139657)
After https://github.com/llvm/llvm-project/pull/81677, statically
linking ASAN under Windows is no longer supported. Therefore, when using
Clang built past
53a81d4d26
to build LLVM / Clang with
`-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded[Debug]
-DLLVM_USE_SANITIZER=Address`, a different set of dependent libraries
must be linked. This is mentioned in the description of
https://github.com/llvm/llvm-project/pull/81677 and also in
https://devblogs.microsoft.com/cppblog/msvc-address-sanitizer-one-dll-for-all-runtime-configurations/.
2025-06-20 08:13:48 -07:00
Prajwal Nadig
05b4bfe19e [ExtractAPI] Include +/- symbols for ObjC methods (#145035)
ObjC methods include a +/- prefix to indicate if they are a class or
instance method. This information is valuable, and must be included in
the navigator generated by ExtractAPI.

rdar://150870936
2025-06-20 09:05:16 -06:00
Chao Chen
9dc59cc95b [MLIR] Incorrect track of usedKey in setPropertiesFromParsedAttr (#144789)
co-authored by @chencha3 and @joker-eph
2025-06-20 10:02:09 -05:00
Michael Buch
b017b4ce9a [lldb][DWARF] Remove object_pointer from ParsedDWARFAttributes (#144880)
We can just always use `GetCXXObjectParameter` instead. We've only used
this attribute to set the object parameter name on ClangASTMetadata,
which doesn't seem like good enough justification to keep it around.

Depends on https://github.com/llvm/llvm-project/pull/144879
2025-06-20 16:01:55 +01:00
Simon Pilgrim
95c6c11c74 [X86] combineConcatVectorOps - only always concat logic ops on AVX512 targets (#145036)
We should only concat logic ops if at least one operand will freely
concatenate. We've now addressed the remaining regressions on AVX2
targets, but still have a number on AVX512 targets which can
aggressively use VPTERNLOG in many cases.
2025-06-20 15:51:04 +01:00
Hemang Gadhavi
20d57e77f6 [lldb][AIX] Added base file for AIX Register Context (#144645)
This PR is in reference to porting LLDB on AIX.
Link to discussions on llvm discourse and github:

1. https://discourse.llvm.org/t/port-lldb-to-ibm-aix/80640
2. https://github.com/llvm/llvm-project/issues/101657
The complete changes for porting are present in this draft PR:
https://github.com/llvm/llvm-project/pull/102601

- Added skeleton for Registercontext file for AIX. (Later we will add
implementation respectively)
2025-06-20 20:18:39 +05:30
Luke Lau
a2b8a93ff9 [VPlan] Pass NumUnrolledElems as operand to VPWidenPointerInductionRecipe. NFC (#119859)
Similarly to VPWidenIntOrFpInductionRecipe, if we want to support it in
EVL tail folding we need to increment the induction by EVL steps instead
of VF*UF steps, but currently this is hard-wired in
VPWidenPointerInductionRecipe.

This adds an operand for the number of elements unrolled and plumbs it
through, so that we can swap it out in
VPlanTransforms::tryAddExplicitVectorLength further down the line.
2025-06-20 15:46:52 +01:00
Jameson Nash
96ab74bf17 [InstCombine] remove undef loads, such as memcpy from undef (#143958)
Extend `isAllocSiteRemovable` to be able to check if the ModRef info
indicates the alloca is only Ref or only Mod, and be able to remove it
accordingly. It seemed that there were a surprising number of
benchmarks with this pattern which weren't getting optimized previously
(due to MemorySSA walk limits). There were somewhat more existing tests
than I'd like to have modified which were simply doing exactly this
pattern (and thus relying on undef memory). Claude code contributed the
new tests (and found an important typo that I'd made).

This implements the discussion in
https://github.com/llvm/llvm-project/pull/143782#discussion_r2142720376.
2025-06-20 10:32:31 -04:00
Ross Brunton
f242360e15 [Offload] Add type information to device info nodes (#144535)
Rather than being "stringly typed", store values as a std::variant that
can hold various types. This means that liboffload doesn't have to do
any string parsing for integer/bool device info keys.
2025-06-20 09:05:05 -05:00
Ross Brunton
e0633d59b9 [Offload] Check for initialization (#144370)
All entry points (except olInit) now check that offload has been
initialized. If not, a new `OL_ERRC_UNINITIALIZED` error is returned.
2025-06-20 09:04:50 -05:00
Andres-Salamanca
bd36f7331a [CIR] Add initial support for bitfields in structs (#142041)
This change adds support for bitfields CIR records can now contain bit
fields.

I’ve updated the `CIRGenBitFieldInfo` comment, which originally came
from the incubator and was identical to the one in OGCodeGen, to better
reflect the current implementation.

Support for bitfields in unions big-endian architectures and `get` and
`set` operations remains unimplemented and will be addressed in a future
patch.
2025-06-20 09:03:02 -05:00
Simon Pilgrim
225768d1f9 [X86] combineConcatVectorOps - add tests showing v4i64 shift-by-32 with unnecessary concatenation
On AVX1-only targets, we concat SHL/SRL AVX1 v4i64 by 32-bits as a shuffle. But this is only worth while if the shift source value is free to concatenate.
2025-06-20 14:52:12 +01:00
Graham Hunter
3ff69c8078 [LV] Add early-exit-with-store tests (#140899)
Adds some additional LoopVectorizeLegality tests for early exit loops
with a store that we don't vectorize.

Test precommit split from #137774
2025-06-20 14:49:50 +01:00
Nicolas Vasilache
269cb22ae8 [mlir][transform] extract a minimal DomainAndOperandsAffineMapT… (#145034)
…ransferInterface out of LinalgStructuredInterface and use that for
PadTilingInterface

Along the way, a bug was found on the handling of scalar values, fix it
and add a test.
2025-06-20 15:45:21 +02:00
Rahul Joshi
376b71442d [NFC][TableGen][DecoderEmitter] Use structured binding in range for loop (#144890)
Also assign variable names to different elements of `OpMap` for better
readibility, and eliminate `NumberedEncodingsRef` as `std::vector` will
automatically get converted to an `ArrayRef`.
2025-06-20 06:41:48 -07:00
Paul Walker
c3929fbf0e [NFC][LLVM] Reorder SVE_SME codegen predicate classes.
Also removes unused HasNonStreamingSVE2p1_or_SSVE_AES predicate.
2025-06-20 13:27:30 +00:00
Andrzej Warzyński
8db272ffcf [mlir][SparseTensor] Re-enable tests on AArch64 (#143387)
These tests were disabled in https://reviews.llvm.org/D136273, due to:
* https://github.com/llvm/llvm-project/issues/58465

That issue has now been resolved, so we should be able to re-enable
these tests.
2025-06-20 14:25:36 +01:00
Graham Hunter
152d4b8a01 [AArch64] Use indexed dup for 128b segmented splat (#144688)
Matches a splat of 128b segments into a wider z register expressed as a
concat_vectors sdnode and generate a dup zn.q, zd.q[0] instruction.
2025-06-20 14:23:26 +01:00
Krzysztof Parzyszek
349f8d67d4 [flang][OpenMP] Skip runtime mapping with no offload targets (#144534)
When no offload targets are specified flang will ignore "target"
constructs, but not "target data" constructs. This patch makes the
behavior consistent across all offload-related operations.

While ignoring "target" may produce semantically incorrect code, it may
still be a useful debugging tool.
2025-06-20 08:09:36 -05:00
Ramkumar Ramachandra
c8c4bd1ebc [LV] Stengthen loop-invariance checks in isPredicatedInst (#140744)
Check loop-invariance against SCEV as well.
2025-06-20 14:01:48 +01:00
Ramkumar Ramachandra
b334ffd4f4 [VPlan] Refine return types in VPBuilder (NFC) (#108858) 2025-06-20 14:01:15 +01:00
Artemiy Bulavin
6edf2eb364 [MLIR] Print more user-friendly error message when generating local reproducer and threading is enabled (#144905) 2025-06-20 15:45:17 +03:00
Matthias Springer
6c0ac888c5 [mlir][arith][NFC] Remove redundant trait declaration (#145007)
`Arith_Op` already declares the `ElementwiseMappable` traits, so they
don't have to be declared for `arith.select`.
2025-06-20 14:32:56 +02:00
Florian Hahn
fd97dfbb78 [LV] Don't mark ptrs as safe to speculate if fed by UB/poison op. (#143204)
Add additional checks before marking pointers safe to load
speculatively. If some computations feeding the pointer may trigger UB,
we cannot load the pointer speculatively, because we cannot compute the
address speculatively. The UB triggering instructions will be
predicated, but if the predicated block does not execute the result is
poison.

Similarly, we also cannot load the pointer speculatively if it may be
poison. The patch also checks if any of the operands defined outside the
loop may be poison when entering the loop. We *don't* need to check if
any operation inside the loop may produce poison due to flags, as those
will be dropped if needed.

There are some types of instructions inside the loop that can produce
poison independent of flags. Currently loads are also checked, not sure
if there's a convenient API to check for all such operands.

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

PR: https://github.com/llvm/llvm-project/pull/143204
2025-06-20 13:05:19 +01:00
Tobias Stadler
5835f1e0a3 [AsmPrinter] Fix crash when remarks section is unsupported (#144724)
Emit a warning and bail out instead of segfault-ing when the current
object file format does not have support for emitting a remarks section.
2025-06-20 12:55:11 +01:00
Mehdi Amini
a5b1093f78 [MLIR] Add ReturnLike trait to memref.atomic_yield (#144932)
Without this, the yield isn't considered as the region terminator and
the dataflow framework does not consider it live.
2025-06-20 13:55:03 +02:00
NimishMishra
e970f59e6b [flang][OpenMP] Reintroduce TODO for FIR lowering of linear clause (#144883)
Current design of the linear clause lowering and translation shifts all
responsibility for handling the clause (like privatisation, linear
stepping, finalisation, and emission of synchronisation barriers) to the
IRBuilder. However in certain corner cases (like associated loops in or
before OpenMP version 4.5), variables are are implicitly linear. This
currently causes a problem with the existing linear clause
implementation. Hence, re-introduce TODO on the linear clause until the
linear clause lowering/translation are robust enough to handle such
cases as well.

Fixes https://github.com/llvm/llvm-project/issues/142935
2025-06-20 04:53:00 -07:00
NimishMishra
8650c80138 [flang][OpenMP] Do not skip privatization of linear variable if it is OmpPreDetermined (#144315)
Current implementation of linear clause skips privatisation of all
linear variables during the FIR generation phase, since linear variables
are handled in their entirety by the OpenMP IRBuilder. However,
"implicit" linear variables (like OmpPreDetermined) cannot be skipped,
since FIR generation requires privatized symbols. This patch adds checks
to skip the same.


Fixes https://github.com/llvm/llvm-project/issues/142935
2025-06-20 04:52:40 -07:00
Florian Hahn
e8be733a3c [VPlan] Remove redundant ExtractLastElement from vector-to-scalar VPI.
Recipes that are vector-to-scalar are guaranteed to generate a scalar
value, so the extract is redundant after VPlan unrolling. Remove it.

This removes unneeded ExtractLastElement VPInstruction of reduction
result computations.
2025-06-20 12:45:20 +01:00
Vigneshwar Jayakumar
1b83f10072 [AMDGPU] Fix to prevent sinking of PERMLANE_SWAP instruction (#144423)
Permlane_swap instruction depends on exec mask, added isConvergent flag
to prevent sinking of instruction.

Fixes: SWDEV-537232
2025-06-20 20:44:23 +09:00
Krzysztof Parzyszek
e5559ca45f [flang][OpenMP] Move lowering of ATOMIC to separate file, NFC (#144960) 2025-06-20 06:44:14 -05:00