Commit Graph

542664 Commits

Author SHA1 Message Date
Craig Topper
8a6519677c [RISCV] Move CascadeSelect test into float/half/double-select-fcmp.ll. NFC
We only had a test for the F extension before. This increases
coverage to D, Zfh, Zfhmin, Finx, Dinx, Zhinx.
2025-06-26 09:46:14 -07:00
Ebuka Ezike
d83457eb83 [NFC][lldb-dap] Add missing header guard for DAPError and ProgressEvent. (#145915)
Delete the copy, move constructor and assignment for ProgressEventReporter.
2025-06-26 17:42:33 +01:00
Joseph Huber
48e893792a [Clang] Determine offloading architectures at Toolchain creation (#145799)
Summary:
Previously we had this weird disconnect where we would get some
offloading architectures beforehand and some later. This patch changes
it to where we just generate this information at Toolchain creation.
There's a few edge cases that will need to be cleaned up. Namely, we
don't handle the strange SPIR-V handling that mixes two separate
toolchains and we needed a pre-check to reject errors when inferring the
toolchain from `--offload-arch` in OpenMP.

Possible we could also use this information for some host defines if
needed.
2025-06-26 11:41:42 -05:00
Tomer Shafir
928a7e6cb9 [AArch64] Use 0-cycle reg2reg MOVs for FPR32, FPR16, FPR8 (#144152)
This change emits optimized copy instructions for FPR32, FPR16, FPR8
register classes on targets that support it. The implementation is
similar to what has been done for GPR32. It adds 2 regression tests for
FPR32 and FPR16.

Depends on: https://github.com/llvm/llvm-project/pull/143680 to resolve
the test structure.
2025-06-26 19:40:20 +03:00
Min-Yih Hsu
f0c1a9a85d [DAG] Add SDPatternMatch::m_Result to match a specific SDValue result (#145775)
`m_Result<N>` matches a SDValue that is the N-th result of the defining
SDNode. This is useful for creating a more fine-grained matching on
SDNode with multiple results.

-----
Inspired by #145481
2025-06-26 22:08:22 +05:30
Amr Hesham
720d7e09b3 [CIR][NFC] Fix an unused variable warning (#145922)
This fixes a warning where a variable assigned in 'if' statement wasn't
referenced again.
2025-06-26 18:32:38 +02:00
Erich Keane
69bbf2135e [OpenACC][CIR] Implement 'modifier-list' lowering (#145770)
Some of the 'data' clauses can have a 'modifier-list' which specifies
one of a few keywords from a list. This patch adds support for lowering
them following #144806.

We have to keep a separate enum from MLIR, since we have to keep
'always' around for semantic reasons, whereas the dialect doesn't
differentiate these.

This patch ensures we get these right for the only applicable clause so
far, which is 'copy'.
2025-06-26 09:25:59 -07:00
Finn Plummer
2e3995981c [HLSL][RootSignature] Use "stringified" version for diagnostic output of punctuator tokens (#145827)
This pr will corrects the output with a stringified version of a
puncuator (eg `')'`) instead of its ascii value.

- Update `LexHLSLRootSignature` to fix the `DiagnosticBuilder`
`operator<<` overload to correclty format the puncuator
- Add testcase demonstrating the stringified version is output

Resolves https://github.com/llvm/llvm-project/issues/145814.
2025-06-26 09:19:10 -07:00
Michael Buch
aeea062dd4 [lldb][DataFormatter] Unwrap reference type when formatting std::unordered_map (#145872)
Desugar any potential references/typedefs before checking
`isStdTemplate`. Previously, the typename might've been:
```
const std::unordered_map<...> &
```
for references. This patch gets the pointee type before grabbing the
canonical type. `GetNonReferenceType` will unwrap typedefs too, so we
should always end up with a non-reference before we get to
`GetCanonicalType`.

https://github.com/llvm/llvm-project/issues/145847
2025-06-26 17:10:12 +01:00
Momchil Velikov
e0b83ca8a4 [MLIR][ArmNeon] Add a couple of negative tests for BFMMLA with scalable dimensions (#145882) 2025-06-26 17:09:59 +01:00
Amr Hesham
9d91b07e1e [CIR] Implement EqualOp for ComplexType (#145769)
This change adds support for equal operation for ComplexType


https://github.com/llvm/llvm-project/issues/141365
2025-06-26 18:06:22 +02:00
Mészáros Gergely
07e3c859b0 [FileCheck][NFC] Pre-commit test for printing escaped variables (#145906)
For #145865
2025-06-26 18:00:36 +02:00
jjasmine
5a996c6ed7 Add triple target to buildtype.ll in X86 (#145764)
Fixes issue #145416.
2025-06-26 16:57:40 +01:00
Kai Nacke
33872f1218 [GOFF] Add writing of section symbols (#133799)
Unlike other formats, the GOFF object file format uses a 2 dimensional structure
to define the location of data. For example, the equivalent of the ELF .text
section is made up of a Section Definition (SD) and a class (Element Definition;
ED). The name of the SD symbol depends on the application, while the class has
the predefined name C_CODE/C_CODE64 in AMODE31 and AMODE64 respectively.

Data can be placed into this structure in 2 ways. First, the data (in a text
record) can be associated with an ED symbol. To refer to data, a Label
Definition (LD) is used to give an offset into the data a name. When binding,
the whole data is pulled into the resulting executable, and the addresses
given by the LD symbols are resolved.

The alternative is to use a Part Definition (PR). In this case, the data (in
a text record) is associated with the part. When binding, only the data of
referenced PRs is pulled into the resulting binary.

Both approaches are used. SD, ED, and PR elements are modeled by nested
MCSectionGOFF instances, while LD elements are associated with MCSymbolGOFF
instances.

At the binary level, a record called "External Symbol Definition" (ESD) is used. The
ESD has a type (SD, ED, PR, LD), and depending on the type a different subset of
the fields is used.
2025-06-26 11:52:14 -04:00
Eli Friedman
6bdfecaea8 [clang] Revise relnote for int->enum conversion. (#145755)
Include more specifics from recent discussion on #143034.
2025-06-26 08:45:50 -07:00
Qinkun Bao
04b60d29ba Disable HWSan for thread_creae_failure.pass.
See https://github.com/llvm/llvm-project/pull/130145
2025-06-26 15:41:31 +00:00
Kazu Hirata
abc2c3a538 [mlir] Use llvm::is_contained instead of llvm::all_of (NFC) (#145845)
llvm::is_contained is shorter than llvm::all_of plus a lambda.
2025-06-26 08:41:26 -07:00
Kazu Hirata
3d5903c4d8 [llvm] Use llvm::is_contained (NFC) (#145844)
llvm::is_contained is shorter than llvm::all_of plus a lambda.
2025-06-26 08:41:18 -07:00
Kazu Hirata
31122446c9 [clang] Use llvm::is_contained instead of llvm::all_of (NFC) (#145843)
llvm::is_contained is shorter than llvm::all_of plus a lambda.
2025-06-26 08:41:10 -07:00
Kazu Hirata
70dce3d987 [mlir] Migrate away from std::nullopt (NFC) (#145842)
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 replaces {} with std::nullopt.
2025-06-26 08:41:02 -07:00
Kazu Hirata
87729bcbb8 [clangd] Migrate away from std::nullopt (NFC) (#145841)
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 replaces std::nullopt with {}.
2025-06-26 08:40:55 -07:00
Kazu Hirata
a13cf846e0 [ASTMatchers] Migrate away from ArrayRef(std::nullopt) (NFC) (#145840)
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 migrates away from std::nullopt in favor of ArrayRef<T>().
Note that {} would be ambiguous for perfect forwarding to work here.
2025-06-26 08:40:47 -07:00
Kazu Hirata
620dbf1fec [llvm] Use llvm::interleaved (NFC) (#145839)
Note that llvm::interleaved constructs a string with the elements from
a given range with a given separator.
2025-06-26 08:40:40 -07:00
Jonas Devlieghere
7eec132f9c [lldb] Fix source/Host/common/Editline.cpp formatting (NFC) 2025-06-26 08:36:57 -07:00
Robert Imschweiler
775a69b237 [OpenMP] Fix comma -> semicolon (#145900)
Fix small typo.
2025-06-26 17:27:20 +02:00
Steven Perron
08964d69b0 [HLSL][SPIRV] Handle uint type for spec constant (#145577)
The testing only tried `unsigned int` and not `uint`. We want to
correctly handle these surgared types as specialization constants.
2025-06-26 11:19:02 -04:00
Abid Qadeer
4233ca1e4e [OMPIRBuilder] Fix use of uninitialized variable. (#145883)
The code in `OpenMPIRBuilder::getTargetEntryUniqueInfo` calls
`ID.getDevice()` even when `getUniqueID` has failed and ID is
un-initialized. This caused a sanitizer fail for me in
https://github.com/llvm/llvm-project/pull/145026. Fix it by giving a
default value to `ID`. The value chosen is the same as used in
`OpenMPToLLVMIRTranslation.cpp`.
2025-06-26 16:10:58 +01:00
Akira Hatanaka
5bbe1536df Cap IntRange::Width to MaxWidth (#145356)
This commit addresses a fallout introduced by #126846.

Previously, TryGetExprRange would return an IntRange that has an active
range exceeding the maximum representable range for the expression's
underlying type. This led to clang erroneously issuing warnings about
implicit conversions losing integer precision.

This commit fixes the bug by capping IntRange::Width to MaxWidth.

rdar://149444029
2025-06-26 08:03:32 -07:00
Simon Pilgrim
0f87c78f64 [GitHub] Add PR filters for VectorCombine patches (#145896)
Distinguish VectorCombine from the vectorizers without just treating it as part of the InstCombine group

Fixes #145286
2025-06-26 16:01:08 +01:00
Momchil Velikov
d13e223a89 [MLIR][AArch64] Add integration test for lowering of vector.contract to Neon FEAT_I8MM (#144699) 2025-06-26 16:01:00 +01:00
Simon Pilgrim
1a60c74c13 [CostModel][X86] SK_InsertSubvector inserted into the lowest subvector should be treated as SK_Select blend (#145892)
X86 uses implicit widening and BLEND/MOV shuffles in these cases - otherwise we still treat it as a SK_PermuteTwoSrc
2025-06-26 16:00:51 +01:00
Qinkun Bao
06a4394b50 Disable HWSan for thread_creae_failure.pass.
See https://github.com/llvm/llvm-project/pull/130145
2025-06-26 14:49:12 +00:00
Frank Schlimbach
2bece2194a [mlir][mesh] resubmitting #144079 (#145897)
#144079 introduced a test with an uninitialized access
Buildbot failure:
https://lab.llvm.org/buildbot/#/builders/164/builds/11140
and got reverted #145531

This PR is an exact copy of #144079 plus a trivial fix
(96c8525c82c5474d8522a973553e85a2033bee5b).
2025-06-26 16:36:17 +02:00
Nicolas Vasilache
5bf43634c4 [mlir][affine] NFC Rename SimplifyAffineMinMax -> SimplifyAffineMinMa… (#145905)
…xPass

This is more consistent re. auto-generated names like `createSimplifyAffineMinMaxPass`.
2025-06-26 16:34:47 +02:00
Rainer Orth
90c9cc2c98 [clang][python][test] Move python binding tests to lit framework (#145855)
As discussed in PR #142353, the current testsuite of the `clang` Python
bindings has several issues:

- If `libclang.so` cannot be loaded into `python` to run the testsuite,
the whole `ninja check-all` aborts.
- The result of running the testsuite isn't report like the `lit`-based
tests, rendering them almost invisible.
- The testsuite is disabled in a non-obvious way (`RUN_PYTHON_TESTS`) in
`tests/CMakeLists.txt`, which again doesn't show up in the test results.

All these issues can be avoided by integrating the Python bindings tests
with `lit`, which is what this patch does:

- The actual test lives in `clang/test/bindings/python/bindings.sh` and
is run by `lit`.
- The current `clang/bindings/python/tests` directory (minus the
now-superfluous `CMakeLists.txt`) is moved into the same directory.
- The check if `libclang` is loadable (originally from PR #142353) is
now handled via a new `lit` feature, `libclang-loadable`.
- The various ways to disable the tests have been turned into `XFAIL`s
as appropriate.
- AArch64 doesn't `FAIL` any longer, so no `XFAIL` is necessary.
- It keeps the `check-clang-python` target for use by the Clang Python
CI.

Tested on `sparc-sun-solaris2.11`, `sparcv9-sun-solaris2.11`,
`i386-pc-solaris2.11`, `amd64-pc-solaris2.11`, `i686-pc-linux-gnu`, and
`x86_64-pc-linux-gnu`.
2025-06-26 16:34:10 +02:00
Hans Wennborg
58b7d200aa [libc] Fix the risc-v half precison float feature check (#145894)
This is a follow-up to #145169, which would break compiles when
__riscv_zfhmin is not defined.
2025-06-26 16:32:21 +02:00
Sameer Sahasrabuddhe
67302b2e6f [AMDGPU][NFC] rename some constants for readability (#145870) 2025-06-26 20:00:26 +05:30
Narayan
d05634d5cd [VectorCombine] Fold bitwise operations of bitcasts into bitcast of bitwise operation (#137322)
Currently, LLVM fails to convert certain pblendvb intrinsics into select
instructions when the blend mask is derived from complex boolean logic
operations. This occurs even when the mask is ultimately based on
sign-extended comparison results, preventing further optimization
opportunities.

Fixes #66513

---------

Co-authored-by: Simon Pilgrim <llvm-dev@redking.me.uk>
2025-06-26 14:57:22 +01:00
Muhammad Omair Javaid
cfdc4c4a5b Revert "[flang][OpenMP] Move lowering of ATOMIC to separate file, NFC (#144960)"
PR#144960 broke check-flang tests on Windows (x64/ARM64).

This reverts commit e5559ca45f.
2025-06-26 18:33:21 +05:00
Muhammad Omair Javaid
597ffb1187 Revert "[flang][OpenMP] Fix namespace nesting after PR144960"
PR#144960 broke check-flang tests on Windows (x64/ARM64).

This reverts commit 925dbc7988.
2025-06-26 18:33:10 +05:00
Nicolas Vasilache
a1d5b9d1cd [mlir][affine] Wrap SimplifyAffineMinMax in a pass (#145741)
This revision adds a pass working on FunctionOpInterface to connect recently introduced AffineMin/Max simplification patterns.

Additionally fixes some minor issues that have surfaced upon larger scale testing.
2025-06-26 15:32:51 +02:00
Ilya Biryukov
90f3147424 [Sema] Cut the deep_recursion.c test in half to fix tests in asan mode
The original test was added with a big overkill. Cutting in half allows
to still catch original issue and not break with asan.

Follow-up to 78b7f6a03d (#145734)
2025-06-26 15:29:02 +02:00
Florian Hahn
5b76cdba5a [VPlan] Handle AnyOf when unrolling. (#145340)
Currently AnyOf is not handled correctly during unrolling. This is
currently causing mis-compiles when vectorizing early-exit loops with
interleaving forced (even though selectInterleaveCount will currently
only pick IC = 1, unless forced by the user).

This patch updates handling of AnyOf to be analogous to computing final
reduction results: during unrolling, the created copies for its original
operand are added as additional operands, and AnyOf will always produce
the reduced value across all unrolled iterations.

Note that the generated code is still incorrect, as we also need to
handle FirstActiveLane and ExtractElement with FirstActiveLane operands.
I will share patches for those soon as well.

PR: https://github.com/llvm/llvm-project/pull/145340
2025-06-26 14:19:38 +01:00
Simon Pilgrim
fe4b4033ed [X86] lowerShuffleAsVTRUNC - use combineConcatVectorOps to catch more "cheap" concats (#145876) 2025-06-26 14:12:18 +01:00
Tom Eccles
cc1eae6ea2 [flang][OpenMP] Remove experimental warning (#144915)
RFC:
https://discourse.llvm.org/t/rfc-removing-the-openmp-experimental-warning-for-llvm-21/86455

Fixes: #110008
2025-06-26 14:09:21 +01:00
Benjamin Kramer
6a5469bb81 [bazel] Fixes for e5a8c51c9d 2025-06-26 15:06:18 +02:00
Nikolas Klauser
afc6c2bb9b [Clang] Allow the use of [[gnu::visibility]] with #pragma clang attribute (#145653)
I don't see any reason this shouldn't be allowed. AFAICT this is only
disabled due to the heuristics used to determine whether it makes sense
to allow the use of an attribute with `#pragma clang attribute`.

This allows libc++ to drop `_LIBCPP_HIDE_FROM_ABI` in a lot of places,
making the library significantly easier to read.
2025-06-26 14:54:15 +02:00
David Spickett
d59e0ba80b [lldb][docs] Document qWatchpointSupportInfo (#145709) 2025-06-26 13:41:33 +01:00
Nicolas Vasilache
e5a8c51c9d [mlir][tensor] Make tensor::PadOp a ReifyRankedShapedTypeOpInterface (#145867)
Co-authored-by: Fabian Mora <fmora.dev@gmail.com>
2025-06-26 14:40:57 +02:00
Benjamin Maxwell
af7166a3f1 [AArch64] Ensure the LR is preserved if we must call __arm_get_current_vg (#145760)
Fixes #145635
2025-06-26 13:26:33 +01:00