532960 Commits

Author SHA1 Message Date
Sam Elliott
0cfabd37df
[RISCV] Add Xqci Insn Formats (#132986) 2025-04-01 21:41:30 -07:00
donald chen
d40bab359c
[mlir][liveness] fix bugs in liveness analysis (#133416)
This patch fixes the following bugs:
- In SparseBackwardAnalysis, the setToExitState function should
propagate changes if it modifies the lattice. Previously, this issue was
masked because multi-block scenarios were not tested, and the traversal
order of backward data flow analysis starts from the end of the program.
- The method in liveness analysis for determining whether the
non-forwarded operand in branch/region branch operations is live is
incorrect, which may cause originally live variables to be marked as not
live.
2025-04-02 11:56:13 +08:00
dpalermo
03a791f703
Revert "[cmake] Refactor clang unittest cmake" (#134022)
Reverts llvm/llvm-project#133545

This change is breaking several buildbots as well as developer's builds.
Reverting to allow people to make progress.
2025-04-01 22:19:27 -05:00
Owen Pan
97dcbdef60 Revert "[clang-format] Handle C++ keywords in other languages better (#132941)"
This reverts commit ab7cee8a0ecf29fdb47c64c8d431a694d63390d2 which had
formatting errors.
2025-04-01 18:59:12 -07:00
Matt Arsenault
55ac652745
llvm-reduce: Do not delete convergencectrl in operand-bundles (#133858)
The IR verifier will fail if there are any convergent calls without
a convergencectrl bundle, if there are any convergencectrl bundles.

With the current verifier rules, we would need to drop all the instances
of convergencectrl in the function as a set, and strip all the
convergence
token intrinsics. As such, I think it would be more appropriate to have
a
separate convergence reduction pass.
2025-04-02 08:48:02 +07:00
Longsheng Mou
222297b020
[mlir] Use Region::hasOneBlock (NFC) (#133879) 2025-04-02 09:40:22 +08:00
ZhaoQi
46968310cb
[LoongArch] Move fix-tle-le-sym-type test to test/MC. NFC (#133839) 2025-04-02 09:11:20 +08:00
Valentin Clement (バレンタイン クレメン)
ae8dd63681
[flang][cuda] Add interface and lowering for all_sync (#134001) 2025-04-01 17:59:11 -07:00
YunQiang Su
e25187bc3e
LLVM/Test: Add vectorizing testcases for fminimumnum and fminimumnum (#133843)
Vectorizing of fminimumnum and fminimumnum have not support yet. Let's
add the testcase for it now, and we will update the testcase when we
support it.
2025-04-02 08:46:02 +08:00
Matheus Izvekov
ad1ca5f4a2
[clang] Concepts: support pack expansions for type constraints (#132626)
This reverts an earlier attempt
(adb0d8ddceb143749c519d14b8b31b481071da77 and
50e5411e4247421fd606f0a206682fcdf0303ae3) to support these expansions,
which was limited to type arguments and which subverted the purpose
of SubstTemplateTypeParmType.

This propagates the ArgumentPackSubstitutionIndex along with the
AssociatedConstraint, so that the pack expansion works, without
needing any new transforms or otherwise any changes to the template
instantiation process.

This keeps the tests from the reverted commits, and adds a few more
showing the new solution also works for NTTPs.

Fixes https://github.com/llvm/llvm-project/issues/131798
2025-04-01 21:11:56 -03:00
Matheus Izvekov
2f25345670
[clang] fix missing initialization msan failure
fixes msan failure reported here: https://lab.llvm.org/buildbot/#/builders/94/builds/5821/steps/17/logs/stdio

This was a regression introduced here: https://github.com/llvm/llvm-project/pull/133610
2025-04-01 21:06:38 -03:00
Petr Sumbera
1a4dc189ad
[OpenMP] allow openmp build for sparc (#133239) 2025-04-01 19:57:14 -04:00
Aiden Grossman
d72be15782 Revert "[CI] Fix Monolithic Linux Build in Ubuntu 24.04 (#133628)"
This reverts commit 23fb048ce35f672d8db3f466a2522354bbce66e5.

This broke the new premerge system as it appears the pip installations within
the CI image do not support this option. Buildkite was unaffected.
2025-04-01 23:43:35 +00:00
Mats Jun Larsen
d53555499f
[lldb] Prefer PointerType::get with LLVMContext over Type (NFC) (#133869)
Part of #123569
2025-04-01 23:27:29 +00:00
Alexey Samsonov
07504afc42
[libc] Stop depending on .cpp files in libcxx_shared_headers library. (#133999)
Fix two instances of libcxx_shared_headers depending on .cpp files (in
Bazel build):

* Don't depend on exit syscall in LIBC_ASSERT implementation. This
dependency is not used, since LIBC_ASSERT always uses system <assert.h>
in the overlay mode, which is the only mode supported by Bazel.
* Don't depend on libc_errno in str-to-float and str-to-integer
conversions. We only need the ERANGE value, which can be obtained from
the proxy header instead.
2025-04-01 16:23:19 -07:00
Craig Topper
749535ba28
[RISCV] Use tablegen HasOneUse. NFC (#133974) 2025-04-01 15:51:39 -07:00
Julian Lettner
c8764f0c65
Fix handling of auto_continue for stop hooks (#129622)
Follow-up fix discussed here:
https://github.com/llvm/llvm-project/pull/129578#issuecomment-2695838042

---------

Co-authored-by: Jim Ingham <jingham@apple.com>
2025-04-01 15:36:35 -07:00
Nico Weber
7b2b3faeb1 [gn build] Port 676755561d5a (ParseTests) 2025-04-01 15:34:00 -07:00
Matthias Springer
69f59d59cb
[mlir][IR] Delete match and rewrite functions (#130259)
The `match` and `rewrite` functions have been deprecated in #130031.
This commit deletes them entirely.

Note for LLVM integration: Update your patterns to use `matchAndRewrite`
instead of separate `match` / `rewrite`.
2025-04-01 15:30:13 -07:00
Florian Mayer
e0c8fc793c
Reapply "[sanitizer] intercept getservent_r, getservbyname_r, getservbyport_r" (#133358) (#133528)
This reverts commit 52d7f14a895eb8669d72cd02754e5586de3e61d8.
2025-04-01 15:25:01 -07:00
Finn Plummer
676755561d
Reland "[HLSL][RootSignature] Implement parsing of a DescriptorTable with empty clauses" (#133958)
This pr relands https://github.com/llvm/llvm-project/pull/133302.

It resolves two issues:
- Linking error during build,
[here](https://github.com/llvm/llvm-project/pull/133302#issuecomment-2767259848).
There was a missing dependency for `clangLex` for the
`ParseHLSLRootSignatureTest.cpp` unit testing. This library was added to
the dependencies to resolve the error. It wasn't caught previously as
the library was transitively linked in most build environments
- Warning of unused declaration,
[here](https://github.com/llvm/llvm-project/pull/133302#issuecomment-2767091368).
There was a usability line in `LexHLSLRootSignature.h` of the form
`using TokenKind = enum RootSignatureToken::Kind` which causes this
error. The declaration is removed from the header file to be used
locally in the `.cpp` files that use it.
Notably, the original pr would also exposed `clang::hlsl::TokenKind` to
everywhere it was included, which had a name clash with
`tok::TokenKind`. This is another motivation to change to the proposed
resolution.

---------

Co-authored-by: Finn Plummer <finnplummer@microsoft.com>
2025-04-01 14:58:30 -07:00
Craig Topper
e55164ae10 [RISCV] Use AsmToken::getEndLoc(). NFC 2025-04-01 14:41:33 -07:00
Nico Weber
86e66d2820 [gn] port 7003f7d23aeca 2025-04-01 14:36:50 -07:00
Andre Kuhlenschmidt
b6edd25f17
[flang][intrinsics] NFC: make comment consistent (#133972)
Just makes this named argument comment consistent with all the others in
the file.
2025-04-01 14:30:10 -07:00
Reid Kleckner
5ffd9bdb50
[cmake] Refactor clang unittest cmake (#133545)
Pass all the dependencies into add_clang_unittest. This is consistent
with how it is done for LLDB. I borrowed the same named argument list
structure from add_lldb_unittest. This is a necessary step towards
consolidating unit tests into fewer binaries, but seems like a good
refactoring in its own right.
2025-04-01 14:12:44 -07:00
AdityaK
96d60c00e5
[mlir][spirv] Verify matching of entry block arguments and function signature (#133167)
Fixes: #132894
2025-04-01 14:10:17 -07:00
Steven Perron
16603d838c
[HLSL] Add SPIR-V target type for RWStructuredBuffers (#133468)
This PR adds the target type for main storage for HLSL raw buffer types.
It does not handle the counter variables that are associated with those
buffers.

This is implementing part of
https://github.com/llvm/wg-hlsl/blob/main/proposals/0018-spirv-resource-representation.md.
We do not handle other HLSL raw buffer types.
2025-04-01 16:59:46 -04:00
Valentin Clement (バレンタイン クレメン)
bb179c483a
[flang][rt] Allow ReportFatalUserError to be build on device (#133979) 2025-04-01 13:50:42 -07:00
Florian Hahn
ec59313c04
[EquivalenceClasses] Use range-based for loops (NFC). 2025-04-01 21:45:01 +01:00
Amy Huang
537b6541e8
Fix libc BUILD.bazel after commit 8741412 (#133980)
Recent changes add dependencies to some atan functions. Edit bazel build
file to look more like the CMake file.


See
8741412bdf
2025-04-01 13:32:43 -07:00
Matthias Braun
adba14acea
Stop using __attribute__((retain)) in GCC builds (#133793)
GCC sometimes produces warnings about `__attribute__((retain))` despite
`__has_attribute(retain)` being 1. See:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=99587

The amount of users who benefit from the attribute is probably very
small compared to the amount of `-Werror` enabled builds or the desire
to keep `-Wattributes` enabled in the LLVM build. So for now drop usage
of the `retain` attribute in GCC builds.
2025-04-01 13:20:43 -07:00
Matheus Izvekov
dc17429ae6
[clang] improved preservation of template keyword (#133610) 2025-04-01 17:15:18 -03:00
Alex MacLean
3c7a0e6c82
[NVPTX] Cleanup and refactor atomic lowering (#133781)
Cleanup lowering of atomic instructions and intrninsics. The TableGen
changes are primarily a refactor, though sub variants are now lowered
via operation legalization, potentially allowing for more DAG
optimization.
2025-04-01 13:08:57 -07:00
Andy Kaylor
9f3d8e8fb8
[CIR] Upstream support for while and do..while loops (#133157)
This adds basic support for while and do..while loops. Support for break
and continue are left for a subsequent patch.
2025-04-01 13:03:24 -07:00
Aiden Grossman
ce296f1eba
[CI] Exclude gn changes from running premerge (#133623)
These changes are mostly pushed by the gnsyncbot directly to main and
thus don't go through a PR, but we still test on main to see if main is
broken. Given these touch llvm/, they end up burning a decent amount of
testing time for no real benefit, so I think it makes sense to exclude
them from premerge testing explicitly.
2025-04-01 12:58:16 -07:00
David Peixotto
782e0cef76
[lldb] Fix intel trace plugin tests (#133826)
The tests for the

[intel-pt](3483740289/lldb/docs/use/intel_pt.rst)
trace plugin were failing for multiple reasons.

On machines where tracing is supported many of the tests were crashing
because of a nullptr dereference. It looks like the `core_file`
parameter in `ProcessTrace::CreateInstance` was once ignored, but was
changed to always being dereferenced. This caused the tests to fail even
when tracing was supported.

On machines where tracing is not supported we would still run tests that
attempt to take a trace. These would obviously fail because the required
hardware is not present. Note that some of the tests simply read
serialized json as trace files which does not require any special
hardware.

This PR fixes these two issues by guarding the pointer dereference and
then skipping unsupported tests on machines. With these changes the
trace tests pass on both types of machines.

We also add a new unit test to validate that a process can be created
with a nullptr core_file through the generic process trace plugin path.
2025-04-01 12:55:41 -07:00
Qiongsi Wu
4a73c99329
[clang][Modules] Fix the Size of RecordDecl's BitCodeAbbrevOp (#133500)
https://github.com/llvm/llvm-project/pull/102040/files#diff-125f472e690aa3d973bc42aa3c5d580226c5c47661551aca2889f960681aa64dR2477
added 1 bit to `RecordDecl`'s serialization format, but did not
increment its abbreviation size.

This can lead to rare cases where a record may overflow if the
`RecordDecl`'s `getArgPassingRestrictions()` returns something bigger
than 1 (see
[here](b3f01a6aa4/clang/lib/Serialization/ASTWriterDecl.cpp (L688))).

rdar://143763558
2025-04-01 12:55:17 -07:00
Aiden Grossman
23fb048ce3
[CI] Fix Monolithic Linux Build in Ubuntu 24.04 (#133628)
This patch fixes the monolithic linux build in Ubuntu 24.04. Newer
versions of debian/ubuntu pass a warning when installing packages at the
system level using pip as it interferes with system package manager
installed python packages. We do not use any system package manager
installed python packages, so we just ignore the warning (that is an
error without passing the flag) by passing the --break-system-packages
flag.
2025-04-01 12:55:07 -07:00
Mark Danial
ac0649a75a
[OpenMP] [AIX] Add missing } in openmp/runtime/src/z_Linux_util.cpp (#133973)
Changes from https://github.com/llvm/llvm-project/pull/133034 removed a
`}` presumably accidentally that are causing failures in the AIX flang
bot.
2025-04-01 15:47:19 -04:00
Max191
1407f5bee9
[mlir] Canonicalize extract_slice(unpack) (#133777)
Canonicalizes a chain of `linalg.unpack -> tensor.extract_slice` into a
`linalg.unpack` with reduced dest sizes. This will only happen when the
unpack op's only user is a non rank-reducing slice with zero offset and
unit strides.

---------

Signed-off-by: Max Dawkins <max.dawkins@gmail.com>
Signed-off-by: Max Dawkins <maxdawkins19@gmail.com>
Co-authored-by: Max Dawkins <maxdawkins19@gmail.com>
2025-04-01 14:51:58 -04:00
Alexey Bataev
0e3049c562
[SLP]Support revectorization of the previously vectorized scalars
If the scalar instructions is marked for the vectorization in the tree,
it cannot be vectorized as part of the another node in the same tree, in
general. It may prevent some potentially profitable vectorization
opportunities, since some nodes end up being buildvector/gather nodes,
which add to the total cost.
Patch allows revectorization of the previously vectorized scalars.

Reviewers: hiraditya, RKSimon

Reviewed By: RKSimon, hiraditya

Pull Request: https://github.com/llvm/llvm-project/pull/133091
2025-04-01 14:30:06 -04:00
Arvind Sudarsanam
2b064108ed
Fix a build error (#133957)
This fixes error reported in post-commit testing of
https://github.com/llvm/llvm-project/pull/133797
LOG: https://lab.llvm.org/buildbot/#/builders/140/builds/20266

Thanks

Signed-off-by: Arvind Sudarsanam <arvind.sudarsanam@intel.com>
2025-04-01 18:24:54 +00:00
Virginia Cangelosi
79487757b7
[Clang][LLVM] Implement multi-multi vectors MOP4{A/S} (#129230)
Implement all multi-multi {BF/F/S/U/SU/US}MOP4{A/S} instructions in
clang and llvm following the acle in
https://github.com/ARM-software/acle/pull/381/files
2025-04-01 19:20:27 +01:00
Heejin Ahn
4d1c827423
[WebAssembly] Support parsing .lto_set_conditional (#126546)
In the split-LTO-unit mode in ThinLTO, a compilation module is split
into two and global variables that meet a specific criteria is moved to
the split module.
d21fc58aee/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp (L315-L366)

And if there is an originally local-linkage global value defined in the
original module and referenced in the split module or the vice versa,
that value is _promoted_ by attaching a module ID to their names in
order to prevent name clashes because now they can be referenced from
other modules.
d21fc58aee/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp (L46-L100)

And when that promoted global value is a function, a
`.lto_set_conditional` entry is written to the original module to avoid
breaking references from inline assembly:

d21fc58aee/llvm/lib/Transforms/IPO/ThinLTOBitcodeWriter.cpp (L84-L91)

The syntax of this is, if the original function name is `symbolA` and
the module ID is `123`,
```ll
module asm ".lto_set_conditional symbolA,symbolA.123"
```
These symbols are parsed here:

648981f913/llvm/lib/MC/MCParser/AsmParser.cpp (L6467)

The first function symbol in this `.lto_set_conditional` do not exist as
a function in the bitcode anymore because it was renamed to the second.
So they are not assigned as function symbols but they are not really
data either, so the object writer crashes here:
5b9e6c7993/llvm/lib/MC/WasmObjectWriter.cpp (L1820)

This PR makes the object writer just skip those symbols.

---

This problem was discovered when I was testing with
`-fwhole-program-vtables`. The reason we didn't have this problem before
with ThinLTO was because `-fsplit-lto-unit`, which splits LTO units when
possible, defaults to false, but it defaults to true when
`-fwhole-program-vtables` is used.
2025-04-02 03:15:29 +09:00
Craig Topper
bd7585bea3
[RISCV] Improve error for using x18-x27 in a register list with RVE. (#133936)
matchRegisterNameHelper returns MCRegister() for RVE so the first RVE
check was dead.

For the second check, I've moved the RVE check from the comma parsing to
the identifier parsing so the diagnostic points at the register. Note
we're using matchRegisterName instead of matchRegisterNameHelper to
avoid allowing ABI names so we don't get the RVE check that lives inside
matchRegisterNameHelper.

The errors for RVE in general should probably say something other than
"invalid register", but that's a problem throughout the assembler.
2025-04-01 11:14:25 -07:00
Valentin Clement (バレンタイン クレメン)
afa32d3e0e
[flang][cuda] Fix char argument
This would fail with `error: argument of type "char" is incompatible with parameter of type "const char *"`
2025-04-01 11:00:50 -07:00
Sam Clegg
a30caa6a73
[WebAssembly] Add missing tests from #133289 (#133938) 2025-04-01 10:47:35 -07:00
David Green
7d91c4f3eb [ARM] Use tablegen HasOneUse. NFC 2025-04-01 18:41:21 +01:00
David Green
d8bf0398e5 [AArch64] Use tablegen HasOneUse. NFC 2025-04-01 18:37:10 +01:00
Kazu Hirata
9586117c3a [clang-sycl-linker] Fix a warning
This patch fixes:

  clang/tools/clang-sycl-linker/ClangSYCLLinker.cpp:127:13: error:
  function 'getMainExecutable' is not needed and will not be emitted
  [-Werror,-Wunneeded-internal-declaration]
2025-04-01 10:35:50 -07:00