Commit Graph

555576 Commits

Author SHA1 Message Date
Peter Klausler
8b930895c4 [flang] Don't misinterpret valid component value for ancestor type (#161910)
As a common language extension, this compiler accepts a structure
constructor whose first value has no keyword and whose type matches an
ancestral type as if the constructor had had a keyword whose name was
the ancestral type. For example, given
  TYPE PARENT; REAL X; END TYPE
  TYPE, EXTENDS(PARENT) :: CHILD; END TYPE
we accept the nonconforming constructor "child(parent(1.))" as if it had
been the conforming "child(1.)" or "child(parent=parent(1.))".

The detection of this case needs to be constrained a bit to avoid a
false positive misinterpretation of conforming code in the case where
the actual first component of the derived type is a POINTER or
ALLOCATABLE whose type and rank would allow it to correspond with the
keywordless first value in the component value list.

Fixes https://github.com/llvm/llvm-project/issues/161887.
2025-10-10 10:08:39 -07:00
James Newling
ea291d0e8c [MLIR][Vector] Remove vector.splat (#162167)
vector.splat has been deprecated (user: please use the very similar vector.broadcast instead) 
with the last PR landing about 6 weeks ago.

The discourse discussion is at
https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/1
The last PR was #152230

This PR completely removes vector.splat. In addition to removing vector.splat from VectorOps.td, it

- Updates the few remaining places where vector::SplatOp is created (now vector::BroadcastOp is created)
- Removes temporary patterns where vector.splat is replaced by vector.broadcast

The only place 'vector.splat' appears is now the files

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/test/corpus/op.txt
 and

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/dialect/vector.js

---------

Signed-off-by: James Newling <james.newling@gmail.com>
2025-10-10 09:58:18 -07:00
Alexandre Perez
6ed18d8525 [lldb][mcp] Get the running MCP server connection information (#162752)
Currently AFAICT we don't have a way to get the MCP server socket after
it started. So this change introduces a new `protocol-server` subcommand
that allows us to query the location of a running server:

```
(lldb) protocol-server start MCP listen://localhost:0
MCP server started with connection listeners: connection://[::1]:36051, connection://[127.0.0.1]:36051
(lldb) protocol-server get MCP
MCP server connection listeners: connection://[::1]:36051, connection://[127.0.0.1]:36051
(lldb) protocol-server stop MCP
(lldb) protocol-server get MCP
error: MCP server is not running
```
2025-10-10 09:55:09 -07:00
小钟
10021c737a Fix typo in comment: 'unit64_t' to 'uint64_t' (#162869)
Corrects a typo in comments within XCOFFObjectFile.cpp, changing
'unit64_t' to the correct type 'uint64_t' for clarity.
2025-10-10 17:50:33 +01:00
Yingwei Zheng
f071cacc6b [ConstantFPRange] Add getWithout[NaN|Inf] (#162696)
This patch adds getWithoutNaN/getWithoutInf. We will apply nnan/ninf
flags to the range of operands/results for a more precise range.
2025-10-10 16:46:17 +00:00
Simon Pilgrim
30ccb60d8a [X86] Add test coverage for #162812 (#162878) 2025-10-10 16:43:55 +00:00
Mircea Trofin
8aa49974df [NFC][InstCombine] Make use of unknown profile info clear in the API name (#162766)
Making the choice more clear from the API name, otherwise it'd be very easy for one to just "not bother" with the `MDFrom`​, especially since it is optional and follows the optional `Name`​ - but this time we'd have a harder time detecting it's effectivelly dropped metadata.
2025-10-10 09:33:45 -07:00
Charitha Saumya
bd6da1feaa [mlir][xegpu] Add more tests in XeGPU subgroup distribution. (#162543)
This PR adds some tests for covering some useful corner cases.

1. more tests for `vector.shape_cast` distribution.
2. testing for `MoveFuncBodyToWarpOp` pattern that was not possible
before.
2025-10-10 09:27:36 -07:00
Louis Dionne
a47cb9b652 [libc++] Fix number of characters in skip reason on BuildKite 2025-10-10 12:26:07 -04:00
Victor Chernyakin
b0b3320821 [clang-tidy][NFC] Remove stale comment in test (#162857)
Commit cb18647 removed the `| count 0` in this file but left behind this
stale comment.
2025-10-10 09:22:13 -07:00
Sang Ik Lee
5d1636d89a [MLIR][XeVM] XeVM to LLVM: Add conversion patterns for id ops (#162536)
XeVM to LLVM pass: Add conversion patterns for XeVM id ops.

Target OpenCL functions described here:

https://registry.khronos.org/OpenCL/sdk/3.0/docs/man/html/get_group_id.html
2025-10-10 09:20:44 -07:00
Craig Topper
c265d7aebf [SelectionDAG] Add SDTCisInt<1> to SDTVecReduce and SDTCisEltOfVec to SDTFPVecReduce. NFC (#162761) 2025-10-10 09:02:08 -07:00
Craig Topper
672672bed3 [SelectionDAG] Add SDTCisSameNumEltsAs to more operations. NFC (#162759) 2025-10-10 09:00:36 -07:00
Amr Hesham
c25a2c7284 [CIR] Upstream Exception with empty try block (#162737)
Upstream, the basic support for the C++ try catch statement with an
empty try block

Issue https://github.com/llvm/llvm-project/issues/154992
2025-10-10 17:57:47 +02:00
Akash Dutta
04d3965125 [AMDGPU]: Packed instructions unpacking to co-issue post-RA scheduling - fix flag handling (#160195)
This is a follow up to https://github.com/llvm/llvm-project/pull/157968.
This fixes flag handling in inserted instructions.
2025-10-10 08:56:38 -07:00
Shilei Tian
24a5d8a9ca Revert "[LifetimeSafety] Reorganize code into modular components (#162474)"
This reverts commit 2eb8c47b88 since it completely breaks dylib build.
2025-10-10 11:51:41 -04:00
Chinmay Deshpande
de67a78c30 [AMDGPU][GlobalISel] Add RegBankLegalize support for G_ASSERT_{S|Z}EXT ops (#162728) 2025-10-10 08:48:06 -07:00
Jordan Rupprecht
5391c6849f [AMDGPU][NFC] Fix clang frontend<->sema layering issue (#162865)
#140210 added `#include "clang/Frontend/FrontendDiagnostic.h"` to
clang/lib/Sema/SemaAMDGPU.cpp, but Frontend itself has a dependency on
Sema. This creates a layering issue as described in
https://llvm.org/docs/CodingStandards.html#library-layering.

Fortunately, d076608d58 made this easy to
fix, as clang/Frontend/FrontendDiagnostic.h just forwards to
clang/Basic/DiagnosticFrontend.h, so it's trivial to make this depend on
basic instead of frontend.
2025-10-10 15:44:51 +00:00
Jordan Rupprecht
85dd8f4bff [bazel][uArch][XeGPU] Port #153706: add uArch package (#162872) 2025-10-10 15:44:10 +00:00
Aaron Ballman
f6caec67fa Speculatively fix build bots
https://github.com/llvm/llvm-project/pull/162843 landed a test that is
broken on darwin:

https://lab.llvm.org/buildbot/#/builders/190/builds/28819

This is an attempted quick fix.
2025-10-10 11:42:16 -04:00
Yi-Chi Lee
a9c8e94b43 [DAGCombiner] Extend FP-to-Int cast without requiring nsz (#161093)
This patch updates the FP-to-Int conversion handling:
- For signed integers: use `ftrunc` followed by clamping to the target
integer range.
- For unsigned integers: apply `fabs` + `ftrunc`, then clamp.

This removes the previous dependence on `nsz` and ensures correct
lowering for both signed and unsigned cases.

I've tested the code generation of -mtriple=amdgcn. It seems that the
assembly code is expected, but I'm not sure how to write a general
testcase for every target.

Fixes #160623.
2025-10-11 00:34:33 +09:00
Martin Storsjö
93d3260389 [lldb] [cmake] Fix delayloading liblldb.dll in mingw builds (#162831)
ec28b95b74 made liblldb delayloaded, but
the supplied command line parameter is only valid for MSVC style builds.

For mingw builds using LLD, we can easily pass a similar option. For
mingw builds with ld.bfd, we can't quite as easily delayload it - for
these cases, just keep linking it like we usually do, and warn if the
user tried to set LLDB_PYTHON_DLL_RELATIVE_PATH in a build where it
won't have any effect.

Also change the setting for MSVC style builds, to use the simpler
`$<TARGET_FILE_NAME:liblldb>` instead of
`$<TARGET_FILE_BASE_NAME:liblldb>.dll`. The former pattern is what we
use for mingw targets, and it makes the code clearer to use that for
both, as that same expression should do the right thing for both.
2025-10-10 18:18:14 +03:00
Martin Storsjö
13784f7a4d [cmake] Unconditionally use -Wno-pass-failed with Clang (#162835)
Since 4feae05c6a, most of the handling of
warning options was rewritten to add such options based on hardcoded
knowledge about what compilers support which options, and since which
versions. This avoids a number of configure time checks, speeding up the
cmake configuration.

This avoids erroneously adding this option with GCC, which doesn't
really support it.

If testing for a warning option like -Wno-<foo> with GCC, GCC won't
print any diagnostic at all, leading to the options being accepted
incorrectly. However later, if compiling a file that actually prints
another warning, GCC will also print warnings about these -Wno-<foo>
options being unrecognized.

This avoids extra warning spam like this, for every source file that
does produce warnings with GCC:

    At global scope:
    cc1plus: note: unrecognized command-line option ‘-Wno-pass-failed’ may have been intended to silence earlier diagnostics
2025-10-10 18:17:31 +03:00
Martin Storsjö
31d260211a [lldb] Add a missing <atomic> include. NFC. (#162809)
This fixes building LLDB for mingw with libstdc++, after
8ae30a3fac.

Previously, building errored out with errors like these:

    In file included from llvm-project/lldb/include/lldb/Protocol/MCP/Transport.h:12,
                     from llvm-project/lldb/include/lldb/Protocol/MCP/Server.h:16,
                     from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:15,
                     from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.cpp:9:
    llvm-project/lldb/include/lldb/Host/JSONTransport.h:608:23: error: field ‘replied’ has incomplete type ‘std::atomic<bool>’
      608 |     std::atomic<bool> replied = {false};
          |                       ^~~~~~~
    In file included from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/shared_ptr_atomic.h:33,
                     from gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/memory:78,
                     from llvm-project/lldb/include/lldb/Host/Socket.h:12,
                     from llvm-project/lldb/include/lldb/Core/ProtocolServer.h:13,
                     from llvm-project/lldb/source/Plugins/Protocol/MCP/ProtocolServerMCP.h:12:
    gcc-mingw/x86_64-w64-mingw32/include/c++/12.1.0/bits/atomic_base.h:162:12: note: declaration of ‘struct std::atomic<bool>’
      162 |     struct atomic;
          |            ^~~~~~
2025-10-10 18:12:57 +03:00
David Spickett
fca40b3b6f [lldb][docs] State that the extension packets doc should be alphabetised
I did this when I converted it but never stated so. Adding a comment
stating so. We'll probably forget at some point but might as well.

Also moved the x packet to the last place, after wasm which was
added to the end recently.
2025-10-10 15:03:54 +00:00
Connector Switch
21b2bdd91c [libcxx][NFC] Added libunwind to LLVM_ENABLE_RUNTIMES for Windows… (#162682)
… builds using MinGW.

I tried running the original command, but the error told me I had to
include libunwind.
2025-10-10 22:58:41 +08:00
Hongyu Chen
3340b245af [DFAJumpThreading] Precompute value => successor mapping (#162824)
Address some previous comments. Note that the value => successor mapping
is invalid during DFA transformation unless we update it correctly.
2025-10-10 22:57:42 +08:00
Matt Arsenault
424fa83335 CodeGen: Remove unused IntrinsicLowering includes (#162844) 2025-10-10 14:34:16 +00:00
Aaron Ballman
2992d3dfef [C2y] Claim support for WG14 N3623 (#162843)
This requires invalid signatures of main to be diagnosed while still
allowing for common extensions. Clang has always supported this.
2025-10-10 10:28:10 -04:00
Md Abdullah Shahneous Bari
83d3a2efe4 [uArch][XeGPU] Add XeGPU uArch definition. (#153706)
The uArch infrastructure provides:
- A set data structures to represent, uArch and it's necessary
components (e.g., instructions, register-files, caches).
- A set of utility interfaces that are common to a family of ops (e.g.,
mma ops, 2DBlockIO ops). The implementation of these interfaces are
provided by the specific instructions. Each family of ops provides these
5 common APIs. However, some family of ops may have more utility APIs.
The common 5 APIs are:
	- getSupportedShapes
	- getSupportedTypes
	- checkSupportedShapesAndTypes
	- checkSupportedTypes
	- validate

Add support for PVC and BMG architectures.
Add support for DPAS instruction.
2025-10-10 09:21:27 -05:00
Tom Tromey
311d1138e7 Do not emit right shift by 0 in DWARF expressions (#162738)
DW_OP_LLVM_extract_bits_zext and DW_OP_LLVM_extract_bits_sext can end up
emitting "DW_OP_constu 0; DW_OP_shr" when given certain arguments.
However, a shift by zero is not useful, and so it can be omitted.
2025-10-10 15:15:17 +01:00
Matt Arsenault
9922d8dd79 AMDGPU: Stop using aligned VGPR classes for addRegisterClass (#158278)
This is unnecessary. At use emission time, InstrEmitter will
use the common subclass of the value type's register class and
the use instruction register classes. This removes one of the
obstacles to treating special case instructions that do not have
the alignment requirement overly conservatively.
2025-10-10 22:59:35 +09:00
Michael Buch
e18461a14e [lldb][test] Skip TestCppFloatingTypesSpecialization.py on older compilers
Fails with:
```
08:19:28  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/clang_1501_build/bin/clang++  -std=c++11 -g -O0 -isysroot "/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.2.sdk" -arch arm64  -I/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/make/../../../../..//include -I/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/lldb-build/tools/lldb/include -I/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/floating-types-specialization -I/Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/make -include /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/packages/Python/lldbsuite/test/make/test_common.h  -fno-limit-debug-info    -nostdlib++ -nostdinc++ -cxx-isystem /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/clang_1501_build/include/c++/v1/  --driver-mode=g++ -MT main.o -MD -MP -MF main.d -c -o main.o /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/floating-types-specialization/main.cpp
08:19:28  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/floating-types-specialization/main.cpp:3:24: error: __bf16 is not supported on this target
08:19:28  template <> struct Foo<__bf16> {};
08:19:28                         ^
08:19:28  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/floating-types-specialization/main.cpp:5:40: error: __bf16 is not supported on this target
08:19:28  template <> struct Foo<_Float16> : Foo<__bf16> {};
08:19:28                                         ^
08:19:28  /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-matrix/llvm-project/lldb/test/API/lang/cpp/floating-types-specialization/main.cpp:8:7: error: __bf16 is not supported on this target
08:19:28    Foo<__bf16> f0;
08:19:28        ^
08:19:28  3 errors generated.
08:19:28  make: *** [main.o] Error 1
```

On our Clang-15.0 CI.
2025-10-10 14:54:24 +01:00
aokblast
394e7ded8b [LLDB, x86, FreeBSD] Fix Architecture parsing by reading the ELF header. (#162811)
Currently, LLDB in FreeBSD host sets the Process Architecture used by
lldbserver as Default one. Which cause problem when trying to debug a
32bit binary on amd64 platform since the lldb itself will found mismatch
architecture with lldbserver's return.

Notice that this patch is only a partial fix for the debugging problem.
We are still unable to debug x86 on x86_64 so that we don't provide
testcase in this patch.

See: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=289945
2025-10-10 14:51:20 +01:00
Ryotaro Kasuga
1e84cb5127 [DA] Address followup comments on #128782 (#162645)
This is a follow-up PR for post-commit comments in #128782 .

- Fix variable name to camel case.
- Change the output format to make it easier to handle with FileCheck.
- Regenerate assertions of regression tests.
2025-10-10 22:19:19 +09:00
Simon Pilgrim
027b647896 [X86] Add additional test coverage for #160111 (#162838) 2025-10-10 13:15:47 +00:00
flovent
1d3ad74667 [clang-tidy] Fix insertion location for certain function pointers in cppcoreguidelines-init-variables (#162218)
This patch starts to find terminator from `VarDecl`'s end location
rather than it's `getLocation()` to ignore terminator(`,`) in function
paramaters list.

Kind of follow up to #112091 

Closes #161978 .
2025-10-10 21:13:49 +08:00
Nico Weber
a833d902ae [gn build] Port 2eb8c47b88 2025-10-10 09:10:46 -04:00
Nikita Popov
f04ae1f4b1 [InstCombine] Perform common cast transforms for ptrtoaddr 2025-10-10 15:08:21 +02:00
Arseniy Zaostrovnykh
e297184ba1 [clang][analyzer] Remove boolean per-entry-point metrics (#162817)
The complexity of maintaining an extra kind of metrics have not
justified itself, as it is not used upstream, and we have only a single
use of boolean stats per entrypoint downstream.

As I will do downstream, you can use an unsigned statistic type with
values 0 and 1 to model a boolean flag.

--

CPP-7097
2025-10-10 14:53:16 +02:00
Syadus Sefat
167c00e4a4 [AMDGPU][GlobalISel] Add register bank legalization for G_SMIN/G_SMAX/G_UMIN/G_UMAX (#159821)
[AMDGPU][GlobalISel] Add register bank legalization for
G_SMIN/G_SMAX/G_UMIN/G_UMAX

This patch adds register bank legalization support for min/max
operations in the AMDGPU GlobalISel pipeline.

- Add support S16, S32, and V2S16 types
- For V2S16 uniform operations implements UnpackMinMax lowering
2025-10-10 14:34:15 +02:00
Rahul Joshi
97031a6e09 [NFC][LLVM] Code cleanup in MisExpect.cpp (#162695)
- Make instruction arguments to the `misexpect` functions const and drop
const for `ArrayRef` arguments.
- Remove namespace llvm/misexpect surrounding all the code in .cpp file
and instead use `using namespace`.
- Change static helper functions to also use const references or
pointers when possible.
2025-10-10 05:24:42 -07:00
Rahul Joshi
ea5648b1a8 [NFC][LLVM] Code cleanup in LowerInvoke.cpp (#162691)
Fix indentation for `LowerInvokeLegacyPass` and use namespace qualifiers
for defining variables and functions in `llvm` namespace.
2025-10-10 05:24:11 -07:00
Rahul Joshi
bea786d128 [NFC][LLVM] Use namespace qualifier to define DenseMapInfo specializations (#162683)
Use `llvm::DenseMapInfo` to define `DenseMapInfo` specializations
instead of surrounding it with `namespace llvm {}`.
2025-10-10 05:23:44 -07:00
Aaron Ballman
0a21b06e0b Remove WG14 N3544
This paper had only non-normative changes about the classification list
of storage class specifiers. There is nothing here to test for
conformance.
2025-10-10 08:18:54 -04:00
Ryan Cowan
b298421e0c [AArch64][GlobalISel] Add G_FPEXT(G_FCONSTANT) folding (#162829) 2025-10-10 12:17:06 +00:00
Aaron Ballman
3fdef23873 Remove WG14 N3563
This paper had only non-normative changes and was already covered by
existing nullptr_t test coverage.
2025-10-10 08:16:00 -04:00
Valery Pykhtin
5eef98ba31 [AMDGPU] Use correct SlotIndex to calculate live-out register set. (#161720)
Using SlotIndexes::getMBBEndIdx() isn't the correct choice here because
it returns the starting index of the next basic block, causing live-ins
of the next block to be calculated instead of the intended live-outs of
the current block.

Add SlotIndexes::getMBBLastIdx() method to return the last valid
SlotIndex within a basic block, enabling correct live-out calculations.
2025-10-10 14:03:27 +02:00
Utkarsh Saxena
2eb8c47b88 [LifetimeSafety] Reorganize code into modular components (#162474)
Restructure the C++ Lifetime Safety Analysis into modular components
with clear separation of concerns.

This PR reorganizes the C++ Lifetime Safety Analysis code by:

1. Breaking up the monolithic `LifetimeSafety.cpp` (1500+ lines) into
multiple smaller, focused files
2. Creating a dedicated `LifetimeSafety` directory with a clean
component structure
3. Introducing header files for each component with proper documentation
4. Moving existing code into the appropriate component files:
    - `Checker.h/cpp`: Core lifetime checking logic
    - `Dataflow.h`: Generic dataflow analysis framework
    - `Facts.h`: Lifetime-relevant events and fact management
    - `FactsGenerator.h/cpp`: AST traversal for fact generation
- `LiveOrigins.h/cpp`: Backward dataflow analysis for origin liveness
- `LoanPropagation.h/cpp`: Forward dataflow analysis for loan tracking
    - `Loans.h`: Loan and access path definitions
    - `Origins.h`: Origin management
    - `Reporter.h`: Interface for reporting lifetime violations
    - `Utils.h`: Common utilities for the analysis

The code functionality remains the same, but is now better organized
with clearer interfaces between components.
2025-10-10 13:43:39 +02:00
Paul Walker
1c5bba1e47 [LLVM][CodeGen][SVE] ASRD cannot represent sdiv-by-one. (#162708)
We lower signed divides by a power-of-two to ASRD. However, ASRD's
immediate is log2(shift_amount) in the range 1 to elt-bitwidth, which
means it cannot represent sdiv-by-one.

Fixes https://github.com/llvm/llvm-project/issues/162616
2025-10-10 12:37:43 +01:00