Commit Graph

555607 Commits

Author SHA1 Message Date
Arjun Ramesh
7e7c923b58 [WebAssembly] Support for new target wasm32-linux-muslwali (#162581)
Add toolchain support for the
[WALI](https://doc.rust-lang.org/rustc/platform-support/wasm32-wali-linux.html)
target as per its corresponding
[RFC](https://discourse.llvm.org/t/rfc-new-wasm-linux-target-support/88203)
2025-10-10 14:54:25 -07:00
Rahul Joshi
a4a0a4b9b1 [NFC][LLVM] Code cleanup in InstructionNamer.cpp (#162689)
Make file local function static and use explicit type for Arg.
2025-10-10 14:42:05 -07:00
Cyndy Ishida
44c5dabea3 [clang-installapi] Add test for -Xproject -fvisibility=* (#162908) 2025-10-10 14:39:44 -07:00
Erich Keane
8d9aecce06 Revert "[OpenACC] Sema changes for +*&|^ reduction combiner recipes (… (#162920)
…#162740)"

This reverts commit 6010df0402.

This apparently fails some sanitizer test as reported here:
https://github.com/llvm/llvm-project/pull/162740

It isn't really clear where this happens, but reverting as it is a
friday, and I have no idea if I'll be able to repro this anytime soon,
  let alone fix it.
2025-10-10 21:26:34 +00:00
Mikhail Gudim
004270d247 [RISCV][SLP][NFC]Add a test for satd-8x4 from x264 benchmark. (#162542)
Precommit a test.
2025-10-10 21:25:37 +00:00
Ian Li
fabd1c418a [MLIR][Math][XeVM] Add MathToXeVM (math-to-xevm) pass (#159878)
This PR introduces a `MathToXeVM` pass, which implements support for the
`afn` fastmath flag for SPIRV/XeVM targets - It takes supported `Math`
Ops with the `afn` flag, and converts them to function calls to OpenCL
`native_` intrinsics.

These intrinsic functions are supported by the SPIRV backend, and are
automatically converted to `OpExtInst` calls to `native_` ops from the
OpenCL SPIRV ext. inst. set when outputting to SPIRV/XeVM.

Note:
- This pass also supports converting `arith.divf` to native equivalents.
There is an option provided in the pass to turn this behavior off.
- This pass preserves fastmath flags, but these flags are currently
ignored by the SPIRV backend. Thus, in order to generate SPIRV that
truly preserves fastmath flags, support needs to be added to the SPIRV
backend.
2025-10-10 16:03:58 -05:00
Mikhail Gudim
d78c93077b [SLPVectorizer] Move size checks (NFC). (#161867)
Add the `analyzeRtStrideCandidate` function. In the future commits we're
going to add the capability to widen strided loads to it. So, in this
commit, we move the size / type checks into it, since it can possibly
change size / type of load.
2025-10-10 20:52:17 +00:00
Jason Molenda
190886ddc9 [lldb][NFC] enable unwind logging in TestCortexMExceptionUnwind
Still seeing a failure on a CI bot with this test that
I cannot reproduce locally, but luckily this one CI bot is giving
me trace output from the tests.  Turn on the unwind log when tracing
is enabled, migth get a better hint what's up with this test fail.
2025-10-10 13:50:45 -07:00
Erick Velez
3af43e303c [clang-doc] simplify filename selection for namespaces (#162885)
determineFileName was confusing regarding namespaces. The comment and
conditional were both misleading. Now, we just check against a static
global namespace USR to make a file use "index", or just use the name.
2025-10-10 13:34:11 -07:00
Tom Stellard
9f0f6e8dda workflows/release-binaries: Run tests on the same runner as the build (#162421)
Also, ignore the test results since they almost always fail. This allows
us to simplify the build process and skip uploading and downloading the
build and source directories which are huge.
2025-10-10 12:58:24 -07:00
Nico Weber
2084655d1e Revert "[gn build] Port 2eb8c47b88e8"
This reverts commit a833d902ae.
2eb8c47b88 was reverted in 24a5d8a9ca
2025-10-10 15:45:34 -04:00
Farzon Lotfi
28c5a2c46d [Clang][HLSL][GVN] Prevent phi codgen of isTokenLike types (#162363)
fixes #161754

When the GVN pass calls `PerformLoadPRE` or `processNonLocalLoad` it can
invoke the `SSAUpdater` which adds a phi node for our tokenLike type. If
we check for if the load is on a token like type at the `processLoad` we
can cover both cases. This is because if we don't GVN will use the
SSAUpdater to insert a phi node to reduce duplicate resource.getpointer
calls.

Because in an earlier commit:
01c0a8409a
we made the verifier error with `PHI nodes cannot have token type!`

This test case will fail today if we try to perform this load
optimization
https://godbolt.org/z/xM69fY8zM

This will impact clang aswell because `isTokenLikeTy` also checks for
`isTokenTy` Clang is likely also failing validation with token types but
just doesn't have a test case because the validator would error if it
were in a phi node.
2025-10-10 15:38:24 -04:00
James Y Knight
bd3ddcf7e1 Bazel: fix after [mlir][amdgpu] Add Inliner interface (#162873) 2025-10-10 15:24:57 -04:00
Erich Keane
6010df0402 [OpenACC] Sema changes for +*&|^ reduction combiner recipes (#162740)
As a followup to the previous AST changes, the next step is to generate
the proper expressions in Sema. This patch does so for +,*,&,|,^ by
modeling them as compound operators.

This also causes the legality of some expressions to change, as these
have to be legal operations, but were previously unchecked, so there are
some test changes.

This does not yet generate any CIR, that will happen in the next patch.
2025-10-10 19:22:55 +00:00
Prabhu Rajasekaran
6fb87b231f [llvm][AsmPrinter] Call graph section format. (#159866)
Make .callgraph section's layout efficient in space. Document the layout
of the section.
2025-10-10 12:20:11 -07:00
Andy Kaylor
b3f2d93766 [CIR] Add lowering support for dynamic cast (#162715)
This adds support for lowering cir.dyn_cast operations to a form that
can be lowered to LLVM IR.
2025-10-10 12:09:29 -07:00
Michael Buch
312f1fa8f2 [llvm][DebugInfo][test] DwarfTest: parameterize LanguageDescription tests (#162863)
Better test coverage.

The round-tripping test makes sure that if we ever change
`llvm::dwarf::toDW_Lang` or `llvm::dwarf::toDW_LName`, we don't break
the `LanguageDescription` API.

The round-tripping test found an incorrect version check in
`llvm::dwarf::toDW_Lang`, which I corrected as part of this PR (see the
table at the bottom of https://dwarfstd.org/languages-v6.html for
reference).
2025-10-10 20:07:21 +01:00
Michael Buch
24feeb2013 [llvm][test] Don't specify target for tests in Generic directory
Fixes buildbot failures where no arm64 target was available.
2025-10-10 19:53:02 +01:00
Erich Keane
41f5f3be30 [OpenACC] Fix uses of getBaseOriginalType when we really want elt type. (#162880)
Lately, I've been using 'getBaseOriginalType' in ArraySectionExpr
incorrectly: it gets the base-ist of element type, when in reality, I
want a single type of indirection. This patch corrects the handful of
uses that I had for it.
2025-10-10 18:41:41 +00:00
Ivan Butygin
6ad662d322 [mlir][amdgpu] Add Inliner interface (#162873)
All the `amdgpu` dialect ops can be inlined.

---------

Signed-off-by: Ivan Butygin <ivan.butygin@gmail.com>
2025-10-10 21:34:00 +03:00
Michael Buch
e3620fe068 [lldb][Expression] Emit a 'Note' diagnostic that indicates the language used for expression evaluation (#161688)
Depends on:
* https://github.com/llvm/llvm-project/pull/162050

Since it's a 'Note' diagnostic it would only show up when expression
evaluation actually failed. This helps with expression evaluation
failure reports in mixed language environments where it's not quite
clear what language the expression ran as. It may also reduce confusion
around why the expression evaluator ran an expression in a language it
wasn't asked to run (a softer alternative to what I attempted in
https://github.com/llvm/llvm-project/pull/156648).

Here are some example outputs:
```
# Without target
(lldb) expr blah
note: Falling back to default language. Ran expression as 'Objective C++'.

# Stopped in target
(lldb) expr blah
note: Ran expression as 'C++14'.

(lldb) expr -l objc -- blah
note: Expression evaluation in pure Objective-C not supported. Ran expression as 'Objective C++'.

(lldb) expr -l c -- blah
note: Expression evaluation in pure C not supported. Ran expression as 'ISO C++'.

(lldb) expr -l c++14 -- blah
note: Ran expression as 'C++14'

(lldb) expr -l c++20 -- blah
note: Ran expression as 'C++20'

(lldb) expr -l objective-c++ -- blah
note: Ran expression as 'Objective C++'

(lldb) expr -l D -- blah
note: Expression evaluation in D not supported. Falling back to default language. Ran expression as 'Objective C++'.
```

I didn't put the diagnostic on the same line as the inline diagnostic
for now because of implementation convenience, but if reviewers deem
that a blocker I can take a stab at that again.

Also, other language plugins (namely Swift), won't immediately benefit
from this and will have to emit their own diagnistc. I played around
with having a virtual API on `UserExpression` or `ExpressionParser` that
will be called consistently, but by the time we're about to parse the
expression we are already several frames deep into the plugin. Before
(and at the beginning of) the generic `UserExpression::Parse` call we
don't have enough information to notify which language we're going to
parse in (at least for the C++ plugin).

rdar://160297649
rdar://159669244
2025-10-10 19:23:02 +01:00
Michael Buch
4188e18a5b [lldb][test] Don't run libc++ API tests without a locally built libc++ (#162657)
API tests in the `libc++` category will try their best to build against
a locally built libc++. If none exists, the `Makefile.rules` currently
fall back to using the system libc++.

The issue with falling back to the system libc++ is that we are now
potentially not testing what we intended to. But we also can't rely on
certain libc++ features being available that the tests are trying to
use. On Apple platforms this is a configuration error (because libc++ is
the only stdlib supported), but we can't make it an error on Linux
because a user might want to run the API tests with libstdc++.

The Ubunutu 22.04 bots on the Apple fork are failing to run following
tests are failing:
* `TestLibcxxInternalsRecognizer.py`
* `TestDataFormatterStdRangesRefView.py` because the system stdlib
doesn't have `std::ranges` support yet. And the tests just fail to
build. Building libc++ on those bots is also not possible because the
system compiler is too old (and the Apple fork builds all the
subprojects standalone, so it requires the system compiler).

This patch marks tests in the `libc++` category as `UNSUPPORTED` if no
local libc++ is available.

The downside is that we will inevitably lose coverage on bots that were
running these tests without a local libc++. Arguably those weren't
really testing the right thing. But for vendors with LLDB forks it might
have been useful to at least know that the tests on the fork don't fail
against the system libc++.

Confirmed that the libc++ pre-merge CI still runs these tests (since it
uses the explicit `--category libc++` dotest flag). Also confirmed that
LLDB pre-merge CI runs the tests (because it builds `libcxx` locally).

**Workaround**

If you do need want to run libc++ tests against the system stdlib, you
can invoke `lldb-dotest` with the `--category libc++` flag:
```
./path/to/build/lldb-dotest --category libc++

OR

./path/to/build/bin/llvm-lit -sv --param dotest-args='--category libc++' "/path/to/monorepo/lldb/test/API
```

rdar://136231390
2025-10-10 19:13:08 +01:00
LU-JOHN
c17eca0410 [AMDGPU][NFC] Pre-commit test for redundant s_cmp_lg_* sX, 0 removal (#162351)
Pre-commit test for redundant s_cmp_lg_* sX, 0 removal.

---------

Signed-off-by: John Lu <John.Lu@amd.com>
2025-10-10 13:07:35 -05:00
Aaron Ballman
8e60adcaaf [C2y] Implement WG14 N3622 static used in an inline (#162877)
This paper removes the constraint that a static variable or function
cannot be used within an extern inline function. The diagnostic is still
being produced in earlier language modes for conformance reasons but has
always been accepted as an extension.
2025-10-10 14:02:17 -04:00
Michael Buch
7dbf115a92 [llvm][DebugInfo] Add support for emitting DW_AT_language_name (#162621)
Depends on:
* https://github.com/llvm/llvm-project/pull/162445
* https://github.com/llvm/llvm-project/pull/162449

Emit `DW_AT_language_name` (new in DWARFv6) if `DICompileUnit` has a
`sourceLanguageName` field. Emit a `DW_AT_language` otherwise.
2025-10-10 18:58:18 +01:00
Mircea Trofin
0f73e75bf7 [profcheck] exclude CodeGen/AMDGPU/amdgpu-attributor-min-agpr-alloc.ll (#162898) 2025-10-10 10:48:32 -07:00
Mircea Trofin
01e19e850f [InstCombine] Mark as unknown the branch weights of packed integer selecting shifts (#162726)
Follow up from PR #162147. We do not have existing !prof metadata to synthesize one for the new `select`​ .

Fixes https://lab.llvm.org/staging/#/builders/221/builds/3091

Issue #147390
2025-10-10 10:30:30 -07:00
James Newling
01c7ef6556 [MLIR][Vector] Fix test following vector.splat removal (#162892)
This is a fix for the failing integration test (see
https://lab.llvm.org/buildbot/#/builders/177/builds/22398) reported in
https://github.com/llvm/llvm-project/pull/162167.
2025-10-10 10:23:27 -07:00
Peter Klausler
05a3f76dca [flang] Process legacy DATA-style /initializers/ sooner (#162722)
The compiler can't defer the conversion of legacy DATA-style
/initializers/ in component declarations to their init() expressions to
the general DATA statement conversion pass, since default component
values must be present during structure constructor analysis. So move
their conversions into name resolution and handle them at the same times
as standard '=' initializers are processed. Avoid any potential problems
with type parameters being used as repetition counts or values by
disallowing legacy DATA-style initializers in PDTs.

Fixes https://github.com/llvm/llvm-project/issues/161989.
2025-10-10 10:09:56 -07:00
Peter Klausler
471ed9ad62 [flang] Rework component KIND= values in PDT instantiations (#162367)
When processing the KIND= values of type specifications in parameterized
derived type component declarations, it turns out to be necessary to
analyze their expressions' parse trees rather than to just fold their
typed expression representations. The types of the subexpressions may
depend on the values of KIND parameters.

Further, when checking the values of KIND= actual arguments to type
conversion intrinsic functions (e.g., INT(..., KIND=)) that appear in
KIND specifiers for PDT component declarations, don't emit an error for
the derived type definition, but instead emit them for derived type
instantiations.

Fixes https://github.com/llvm/llvm-project/issues/161961.
2025-10-10 10:09:33 -07:00
Peter Klausler
e2ee91ed34 [flang] Clean up some optional<bool> usage (#161925)
Audit the use of std::optional<bool> as a tri-state logical value in
flang, correct a couple cases that need ".value_or()", add some explicit
".has_value()" calls, and document the possible pitfalls.
2025-10-10 10:09:02 -07:00
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