554315 Commits

Author SHA1 Message Date
Vladimir Vuksanovic
63e45504ab
[clang-reorder-fields] Check for flexible array member (#160262)
A flexible array member must remain the last field in the struct.
2025-09-29 15:05:28 -07:00
Alex Voicu
d481e5f9b7
[AMDGPU][SPIRV] Use SPIR-V syncscopes for some AMDGCN BIs (#154867)
AMDGCN flavoured SPIR-V allows AMDGCN specific builtins, including those
for scoped fences and some specific RMWs. However, at present we don't
map syncscopes to their SPIR-V equivalents, but rather use the AMDGCN
ones. This ends up pessimising the resulting code as system scope is
used instead of device (agent) or subgroup (wavefront), so we correct
the behaviour, to ensure that we do the right thing during reverse
translation.
2025-09-29 22:50:15 +01:00
Maksim Levental
af5c1a696c
[CIR] fix enumeration value 'OMPFuseDirectiveClass' not handled in switch (#161278) 2025-09-29 21:40:56 +00:00
Jan Svoboda
cbfe89f0ec
[llvm][clang] Use the VFS in GCOVProfilerPass (#161260)
This PR starts using the correct VFS in `GCOVProfilerPass` instead of
using the real FS directly. This matches compiler's behavior for other
input files.
2025-09-29 21:37:18 +00:00
Akira Hatanaka
12a5854a51
[compiler-rt] Disable tests for unavailable builtins (#161275)
The builtins `__fixunstfdi` and `__multc3` may be removed by the
preprocessor depending on configuration flags. When this happens, the
corresponding tests fail at link time due to missing definitions.

Disable these tests when the builtins are not available.

Also remove the XFAILs for aarch64 windows. As this test now became a
no-op on platforms that lack CRT_HAS_128BIT or CRT_HAS_F128 (aarch64
windows lacks the latter), it no longer fails.

This reapplies e9e166e54354330c474457711a8e7a7ca2efd731 and
656707086e5f6fccd2eb57f5aaf987c328c0f4f1 after fixing declarations of
the builtins in the tests in b54250940c2cd70f911386b02239b50c165e5354.

rdar://159705803
rdar://159705705

---------

Co-authored-by: Martin Storsjö <martin@martin.st>
2025-09-29 14:22:49 -07:00
David Salinas
07f8f088b4
Add --offoading option to llvm-readobj (#143342)
Utilize new extensions to LLVM Offloading API to
handle offloading fatbin Bundles.

The tool will output a list of available offload bundles
using URI syntax.

---------

Co-authored-by: dsalinas_amdeng <david.salinas@amd.com>
2025-09-29 17:16:29 -04:00
Alan Zhao
045e09f22b
[InstCombine] Set !prof metadata on Selects identified by add.ll test (#158743)
These select instructions are created from non-branching instructions,
so their branch weights are unknown.

Tracking issue: #147390
2025-09-29 20:37:06 +00:00
Steven Wu
9df1099ba7
[CAS] Fix a build failure on 32 bit system from #114100 (#161268)
Fix a build failure on 32 bit system that caused by a warning of
narrowing `uint64_t` to `size_t`.
2025-09-29 20:29:29 +00:00
Joseph Huber
0fcce4fb7b
[OpenMP] Mark problematic tests as XFAIL / UNSUPPORTED (#161267)
Summary:
Several of these tests have been failing for literal years. Ideally we
make efforts to fix this, but keeping these broken has had serious
consequences on our testing infrastructure where failures are the norm
so almost all test failures are disregarded. I made a tracking issue for
the ones that have been disabled.

https://github.com/llvm/llvm-project/issues/161265
2025-09-29 15:17:55 -05:00
Morris Hafner
b629981a6d
[CIR] Add virtual base support to getAddressOfBaseClass (#159162)
This patch enables calling virtual functions of virtual base classes of
a derived class.
2025-09-29 13:17:52 -07:00
Michael Buch
eef7a7663d
[lldb][DWARFASTParserClang] Simplify obsolete error condition for malformed array member type offsets (#160132)
First time check was introduced in
`fa3ab4599d717feedbb83e08e7f654913942520b` to work around a debug-info
generation bug in Clang. This bug was fixed in Clang-4. The check has
since been adjusted (first in
`808ff186f6a6ba1fd38cc7e00697cd82f4afe540`, and then most recently in
`370db9c62910195e664e82dde6f0adb3e255a4fd`).

This check is getting quite convoluted, and all it does is turn an
`array[1]` into an `array[0]` type when it is deemed correct. At this
point the workaround probably never fires, apart from actually valid
codegen. This patch removes the special conditions and emits the error
specifically in those cases where we know the DWARF is malformed.

Added some shell tests for the error case.
2025-09-29 21:05:37 +01:00
Steven Wu
2936a2c882
[CAS] Add OnDiskTrieRawHashMap (#114100)
Add OnDiskTrieRawHashMap. This is a on-disk persistent hash map that
uses a Trie data structure that is similar to TrieRawHashMap.
OnDiskTrieRawHashMap is thread safe and process safe. It is mostly lock
free, except it internally coordinates cross process creation and
closing using file lock.
2025-09-29 12:47:52 -07:00
Schrodinger ZHU Yifan
38a4c9c639
[libc][msvc] fix mathlib build on WoA (#161258)
Fix build errors encountered when building math library on WoA.

1. Skip FEnv equality check for MSVC
2. Provide a placeholder type for vector types.
2025-09-29 15:40:21 -04:00
Joseph Huber
786358a3d7 [Offload] Fix incorrect size used in llvm-offload-device-info tool
Summary:
This was not using the size previously queried and would fail when the
implementation actually verified it.
2025-09-29 14:37:11 -05:00
Corentin Jabot
7e4678270f
[Clang] Instantiate variables referenced in decltype with an undeduced type. (#161231)
Fixes #160497
Fixes #56652
Fixes #116319
Fixes #161196
2025-09-29 21:30:07 +02:00
Akira Hatanaka
b54250940c
[compiler-rt] Fix declarations of builtins in test files (#161222)
Replace `long double` and `long double _Complex` with `fp_t` and
`Qcomplex` in the test files.

This prepares for reapplying 656707086e5f6fccd2eb57f5aaf987c328c0f4f1
and running tests on targets where `fp_t` is not `long double`.
2025-09-29 12:07:32 -07:00
Amr Hesham
62e7e8d66d
[CIR] Upstream UnaryExtension for Scalar Expr (#160997)
Upstream UnaryExtension for Scalar Expr
2025-09-29 21:03:41 +02:00
Amr Hesham
74aa2b7ad5
[CIR] Implement UO real on result from imag with type promotion (#160996)
Implement UO real on the result from imag with type promotion

Issue: https://github.com/llvm/llvm-project/issues/141365
2025-09-29 21:03:02 +02:00
Abhinav Gaba
7de73c4e9d
[OpenMP][Offload] Support PRIVATE | ATTACH maps for corresponding-pointer-initialization. (#160760)
`PRIVATE | ATTACH` maps can be used to represent firstprivate pointers
that should be initialized by doing doing the pointee's device address,
if its lookup succeeds, or retain the original host pointee's address
otherwise.

With this, for a test like the following:

  ```f90
  integer, pointer :: p(:)
  !$omp target map(p(1))
  ... print*, p(1)
  !$omp end target
  ```

The codegen can look like:
  ```llvm
   ; maps for p:
   ; &p(1),       &p(1), sizeof(p(1)),       TO|FROM              //(1)
   ; &ref_ptr(p), &p(1), sizeof(ref_ptr(p)), ATTACH               //(2)
   ; &ref_ptr(p), &p(1), sizeof(ref_ptr(p)), PRIVATE|ATTACH|PARAM //(3)
   call... @__omp_outlined...(ptr %ref_ptr_of_p)
  ```

* `(1)` maps the pointee `p(1)`.
* `(2)` attaches it to the (previously) mapped `ref_ptr(p)`, if present.
  It can be controlled via OpenMP 6.1's `attach(auto/always/never)`
  map-type modifiers.
* `(3)` privatizes and initializes the local `ref_ptr(p)`, which gets
passed
  in as the kernel argument `%ref_ptr_of_p`. Can be skipped if p is not
  referenced directly within the region.

While similar mapping can be used for C/C++, it's more important/useful
for Fortran as we can avoid creating another argument for passing the
descriptor, and use that to initialize the private copy in the body of
the kernel.
2025-09-29 11:47:21 -07:00
Victor Chernyakin
5da28bd331
[clang-tidy][NFC] Make a few std::strings into StringRefs (#160961)
Following up 12cb540. Also, that commit left behind a few cases where a
temporary `StringRef` was being constructed from those variables just to
use its `.split()` function, so this PR cleans those up too.
2025-09-29 11:28:20 -07:00
Jorge Gorbe Moya
0f70b44016
[DWARFVerifier] Fix test verify_stmt_seq.yaml to write output files to temp directory. (#161247) 2025-09-29 18:21:21 +00:00
Paul Kirth
2522a95354
[llvm][mustache] Precommit test for Set Delimiter (#159186)
Adds a new unit test for the Mustache Set Delimiter feature.

This test is written with inverted logic (`EXPECT_NE`) so that it
passes with the current implementation, which does not support
the feature. Once the feature is implemented, this test will fail,
signaling that the test logic should be flipped to `EXPECT_EQ`.
2025-09-29 18:19:47 +00:00
Florian Hahn
8dde784135
[LV] Add test for more precise no-free checks w/o nosync attribute.
Also filter out uninteresting parts from check lines.
2025-09-29 19:17:48 +01:00
Sam Elliott
df77a86f9b
[RISCV][NFC] Rename getOppositeBranchCondition (#160972) 2025-09-29 19:15:41 +01:00
Alexey Bataev
1f82553e38 [SLP]Fix mixing xor instructions in the same opcode analysis
Xor with 0 operand should not be compatible with multiplications-based
instructions, only with or/xor/add/sub.

Fixes #161140
2025-09-29 11:14:06 -07:00
Paul Kirth
7b96dfbb7d
[llvm][mustache] Align standalone partial indentation with spec (#159185)
The current implementaion did not correctly handle indentation for
standalone partial tags. It was only applied to lines following a
newline, instead of the first line of a partial's content. This was
fixed by updating the AddIndentation implementaion to prepend the
indentation to the first line of the partial.
2025-09-29 11:00:04 -07:00
Joseph Bak
68c3b5363d
[mlir][doc] Fix typo in Ch6 tutorial: 'toy.cpp' → 'toyc.cpp' (NFC) (#161245)
This patch fixes a documentation typo in the MLIR Toy tutorial (Ch6).
The tutorial currently refers to `examples/toy/Ch6/toy.cpp`, but the
correct
file name is `examples/toy/Ch6/toyc.cpp`.
2025-09-29 19:48:17 +02:00
Simon Pilgrim
8d48d69911
[X86] canCreateUndefOrPoisonForTargetNode/isGuaranteedNotToBeUndefOrPoisonForTargetNode - add X86ISD::INSERTPS handling (#161234)
X86ISD::INSERTPS shuffles can't create undef/poison itself, allowing us to fold freeze(insertps(x,y,i)) -> insertps(freeze(x),freeze(y),i)
2025-09-29 17:43:05 +00:00
Mircea Trofin
f7352505ca
[profcheck] Exclude LoopVectorize, temporarily (#161243)
LV is under active development, new tests are added. Bulk-excluding it
from `profcheck`​, for the moment.



Issue #161235 (see also its parent)
2025-09-29 10:38:16 -07:00
Alexey Bataev
0457644dfb [SLP][NFC]Add a test with the incorrect combination of Xor/Mul vector instructions, NFC 2025-09-29 10:37:39 -07:00
Craig Topper
301259a6b1
[RISCV] Teach getIntImmCostInst about (X & -(1 << C1) & 0xffffffff) == C2 << C1 (#160163)
We can rewrite this to (srai(w)/srli X, C1) == C2 so the AND immediate
is free. This transform is done by performSETCCCombine in
RISCVISelLowering.cpp.

This fixes the opaque constant case mentioned in #157416.
2025-09-29 10:36:27 -07:00
Marcos Maronas
87bd782590
[LLVM][NFC] Fix Rule of Three/Five issues. (#160851)
Fix Rule of Three/Five issues reported by static analysis tool.
2025-09-29 18:32:18 +01:00
Andy Kaylor
38953f4d66
[CIR] Add initial support for operator delete (#160574)
This adds basic operator delete handling in CIR. This does not yet
handle destroying delete or array delete, which will be added later. It
also does not insert non-null checks when not optimizing for size.
2025-09-29 10:29:41 -07:00
Andy Kaylor
782ab835dc
[CIR] Set the module name to the input filename (#160934)
This sets the MLIR module name to the main filename (according to the
SourceManager), if one is available. The module name gets used when
creating global init functions, so we will need it to be set.
2025-09-29 10:27:34 -07:00
jiang1997
0251fd9a72
[clang][x86][bytecode] Refactor BMI intrinsic wrappers to use interp__builtin_elementwise_int_binop (#160362)
Fixes #160281
2025-09-29 17:27:16 +00:00
SunilKuravinakop
e5d925faa9
[clang][OpenMP] Support for reduction clause with array elements as modifier (#160846)
Changes to support for array elements in reduction clause e.g.
"reduction (+:a[1])"

---------

Co-authored-by: Sunil Kuravinakop <kuravina@pe31.hpc.amslabs.hpecorp.net>
2025-09-29 12:05:30 -05:00
Jan Svoboda
0fc972d242
[llvm] Use the underlying VFS when constructing RedirectingFileSystem (#160942)
When the root node of the `RedirectingFileSystem` is to be resolved to
the current working directory, we previously consulted the real FS
instead of the provided underlying VFS. This PR fixes that issue.
2025-09-29 10:01:10 -07:00
Chaitanya Koparkar
47b8bc4698
[Headers][X86] Allow AVX1 fixed extraction intrinsics to be used in constexpr (#161218)
Fixes #161204.
2025-09-29 17:59:58 +01:00
Joseph Huber
44f392e999 [OpenMP] Fix 'libc' configuration when building OpenMP
Summary:
Forgot to port this option's old handling from offload. It's not way
easier since they're built in the same CMake project. Also delete the
leftover directory that's not used anymore, don't know how that was
still there.
2025-09-29 11:59:17 -05:00
Florian Hahn
b51b967671
[LV] Add test for more precise no-free checks. 2025-09-29 17:46:22 +01:00
Kazu Hirata
3e54505b43
[ADT] Fix a bug in EquivalenceClasses::erase (#161121)
This patch fixes a bug in EquivalenceClasses::erase, where we lose a
leader bit in a certain scenario.

Here is some background.  In EquivalenceClasses, each equivalence
class is maintained as a singly linked list over its members.  When we
join two classes, we concatenate the two singly linked lists.  To
support path compression, each member points to the leader (through
lazy updates).  This is implemented with the two members:

  class ECValue {
    mutable const ECValue *Leader, *Next;
    :
  };

Each member stores its leader in Leader and its sibling in Next.  Now,
the leader uses the Leader field to to point the last element of the
singly linked list to accommodate the list concatenation.  We use the
LSB of the Next field to indicate whether a given member is a leader
or not.

Now, imagine we have an equivalence class:

  Elem 1 -> Elem 2 -> nullptr
  Leader

and wish to remove Elem 2.  We would like to end up with:

  Elem 1 -> nullptr
  Leader

but we mistakenly drop the leader bit when we update the Next field of
Elem 1 with:

  Pre->Next = nullptr;

This makes Elem 1 the end of the singly linked list, as intended, but
mistakenly clears its leader bit stored in the LSB of Next, so we end
up with an equivalence class with no leader.

This patch fixes the problem by preserving the leader bit:

  Pre->Next = reinterpret_cast<const ECValue *>(
      static_cast<intptr_t>(Pre->isLeader()));

The unit test closely follows the scenario above.
2025-09-29 09:43:52 -07:00
Jan Svoboda
2dd7431876
[clang] Use the VFS in ModuleDependencyCollector (#160944)
This PR starts using the correct VFS in `ModuleDependencyCollector`
instead of using the real FS directly. This matches compiler's behavior
for other input files.
2025-09-29 09:38:49 -07:00
Ryan Mansfield
30b0215519
[llvm-size] Add --exclude-pagezero option for Mach-O to exclude __PAGEZERO size. (#159574)
Do not include the ``__PAGEZERO`` segment when calculating size information
for Mach-O files when `--exclude-pagezero` is used. The ``__PAGEZERO``
segment is a virtual memory region used for memory protection that does not
contribute to actual size, and excluding can provide a better representation of
actual size.

Fixes #86644
2025-09-29 09:32:28 -07:00
Fangrui Song
3b299af923
ELF: Store EhInputSection relocations to simplify code. NFC
Store relocations directly as `SmallVector<Relocation, 0>` within
EhInputSection to avoid processing different relocation formats
(REL/RELA/CREL) throughout the codebase.

Next: Refactor RelocationScanner to utilize EhInputSection::rels

Pull Request: https://github.com/llvm/llvm-project/pull/161041
2025-09-29 09:15:25 -07:00
Billy Zhu
a615249d02
[MLIR][Python] Fix PDLResultList bindings (#161102)
Adds argument names to the method stubs for PDLResultList (from
https://github.com/llvm/llvm-project/pull/159926).
2025-09-29 09:11:47 -07:00
Jan Svoboda
f9dbf738d8
[llvm] Use the VFS to get the real path in FileCollector (#160943)
This PR starts using the correct VFS for getting file's real path in
`FileCollector` instead of using the real FS directly. This matches
compiler's behavior for other input files.
2025-09-29 09:00:37 -07:00
Alina Sbirlea
dd3507b6c0
Extend LVI to cache ranges per BB predecessor. (#159432)
Currently LVI does the union of value ranges from block predecessors.
When storing the ranges per predecessor, the resulting ranges may be
more restricted and enable additional optimizations.
However this is costly (memory + compile time), so place this under a
flag disabled by default.

See: https://github.com/llvm/llvm-project/issues/158139.
2025-09-29 08:58:46 -07:00
Marcos Maronas
1ef1175b30
[SPIRV] Fix code quality issues. (#160752)
Address issues reported by a static analysis tool.
2025-09-29 15:57:52 +00:00
michaelselehov
617854f819
[AMDGPU] LRO: allow same-BB non-lookthrough users for PHI (#160909)
Loop headers frequently consume the loop-carried value in the header
block via non-lookthrough ops (e.g. byte-wise vector binops).
LiveRegOptimizer’s same-BB filter currently prunes these users, so the
loop-carried PHI is not coerced to i32 and the intended packed form is
lost.

Relax the filter: when the def is a PHI, allow same-BB non-lookthrough
users. Also fix the check to look at the user (CII) rather than the def
(II) so the walk does not terminate prematurely.
2025-09-30 00:57:07 +09:00
David Green
2e3f2523e6 [AArch64] Add global isel coverage for fp16 tests and strict-fp. NFC 2025-09-29 16:54:49 +01:00