531001 Commits

Author SHA1 Message Date
Paul Kirth
0460418420
[clang][driver][NFC] Remove else after return (#131182) 2025-03-17 10:33:19 -07:00
LLVM GN Syncbot
681b24132c [gn build] Port fbb8929c9d15 2025-03-17 17:14:11 +00:00
John Harrison
fbb8929c9d
[lldb-dap] Updating RequestHandler to encode/decode arguments and response. (#130090)
This is a work in progress refactor to add explicit types instead of
generic 'llvm::json::Value' types to the DAP protocol.

This updates RequestHandler to have take the type of the arguments and
response body for serialization for requests.

The 'source' and 'disconnect' request is updated to show how the new
flow
works and includes serialization handling for optional arguments and
'void'
responses.

This is built on top of #130026

---------

Co-authored-by: Adrian Vogelsgesang <adrian.vogelsgesang@tum.de>
2025-03-17 10:13:11 -07:00
Prashanth
47f7daab06
[libc][docs] Add glob implementation status doc and include in CMakeLists (#126923)
These changes tracks `glob.h` for the implementation status of functions
and macros, with respect to the issue ( #122006 ) .

cc @nickdesaulniers
2025-03-17 13:05:50 -04:00
Helena Kotas
b3c5031b07
[HLSL] Remove HLSLResource attribute (#130342)
Fixes #104862
2025-03-17 10:00:07 -07:00
Simon Pilgrim
9a92fe0f8d [X86] Add additional test coverage for #109272 2025-03-17 16:58:43 +00:00
Simon Pilgrim
561f1d0b7c [X86] add test coverage for concatenation to 512-bit VPERMILPD nodes 2025-03-17 16:58:43 +00:00
Christian Ulmann
800593a014
[MLIR][LLVM] Avoid duplicated module flags in the export (#131627)
This commit resolves an issue in the LLVMIR export that caused the
duplication of the "Debug Info Version" module flag, when it was already
in MLIR.
2025-03-17 17:43:15 +01:00
Luke Lau
67f1c033b8
[VPlan] Remove createReduction. NFCI (#131336)
This is split off from #131300.

A VPReductionRecipe will never have a AnyOf or FindLastIV recurrence, so
when it calls createReduction it always calls createSimpleReduction.

If we replace the call then it leaves createReduction with one user in
VPInstruction::ComputeReductionResult, which we can inline and then
remove.
2025-03-18 00:18:15 +08:00
Vineet Kumar
54cb4059da
[X86][ISel][FMA] Get a handle on operand nodes when negating FMA (#130176)
When negating an FMA opcode, a new node created for a negated FMA
operand may be deleted while recursively negating another FMA operand.
This causes the following assertion to fail:
```
llc: /root/llvm-project/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:7686: llvm::SDValue llvm::SelectionDAG::getNode(unsigned int, const llvm::SDLoc&, llvm::EVT, llvm::SDValue, llvm::SDValue, llvm::SDValue, llvm::SDNodeFlags): Assertion `N1.getOpcode() != ISD::DELETED_NODE && N2.getOpcode() != ISD::DELETED_NODE && N3.getOpcode() != ISD::DELETED_NODE && "Operand is DELETED_NODE!"' failed.
```
This patch adds a temporary handle on the new negated nodes to prevent
them from being deleted.
For eg. see https://godbolt.org/z/Tq4PvnKM4 .

Co-authored-by: Vineet Kumar <vineetk@hpe.com>
2025-03-17 16:07:33 +00:00
Craig Topper
b00ad36632
[RISCV] Use hasFeature instead of checkFeature in llvm-exegesis. NFC (#131401)
Until recently checkFeature was quite slow. #130936

I was curious where we use checkFeature and noticed these. I thought we
could use hasFeature instead of going through strings.
2025-03-17 09:05:09 -07:00
Luke Lau
eef5ea0c42
[VPlan] Account for dead FOR splice simplification in cost model (#131486)
Fixes #131359

After #129645, a first-order recurrence will no longer have it's splice
costed if the VPInstruction::FirstOrderRecurrenceSplice has no users and
is dead.

The legacy cost model didn't account for this, so this accounts for it
in planContainsAdditionalSimplifications to avoid the "VPlan cost model
and legacy cost model disagreed" assertion.
2025-03-18 00:00:54 +08:00
Shilei Tian
e2c43ba981
[NFC][AMDGPU] Auto generate check lines for llvm/test/CodeGen/AMDGPU/packed-fp32.ll (#131629) 2025-03-17 11:42:03 -04:00
Aiden Grossman
7054655c52
[llvm-exegesis] Add myself as an llvm-exegesis maintainer (#131580)
More people have been interested in exegesis recently, so having a point
of contact would probably be good. Exegesis also never had proper code
owners in the previous system, so adding them now is a decent step
forward.

I'm nominating myself as I'm interested in pushing the project further,
and have a decent amount of experience with the code base. Two of the
original authors, Clement and Guillaume, now have different priorities
at work and are thus not as invested into maintaining exegesis anymore.
2025-03-17 08:30:55 -07:00
Daniel Chen
a4510aa7cb
[flang-rt] replace the triple dir to 'aix' for flang-rt to be consistent with clang on AIX. (#130875)
This change is to put `libflang_rt.runtime.a` into
`build/lib/clang/21/lib/aix/libflang_rt.runtime.a`, which is consistent
with clang on AIX.
2025-03-17 11:30:35 -04:00
Shilei Tian
3959bbc134 [NFC] Remove trailing white spaces from llvm/docs/LangRef.rst 2025-03-17 11:19:09 -04:00
Pradeep Kumar
52e7ca9279
[LLVM][NVPTX] Add support for ldmatrix extensions introduced in PTX 8.6 (#124899)
This commit adds support for the following ldmatrix extensions
introduced in PTX 8.6
- Support for m16n16 with b8 type with mandatory transpose
- Support for m16n16 with m8n16 with source and desitination formats

The above extensions are only supported on sm_100a, sm_101a, sm_120a

Please refer the PTX ISA for more information:
https://docs.nvidia.com/cuda/parallel-thread-execution/#warp-level-matrix-instructions-ldmatrix
2025-03-17 20:44:52 +05:30
Simon Pilgrim
269c40fafc [X86] Add tests for concatenation of VPERMV nodes 2025-03-17 15:10:42 +00:00
Simon Pilgrim
37c3fbfa5a [X86] Add test showing failure to merge concatenatable VPERMV3 nodes 2025-03-17 15:10:41 +00:00
Pavel Labath
1b237198dc
Reapply "[lldb] Implement basic support for reverse-continue (#125242)" (again) (#128156)
This reverts commit
87b7f63a11,
reapplying

7e66cf74fb
with a small (and probably temporary)
change to generate more debug info to help with diagnosing buildbot
issues.
2025-03-17 16:06:25 +01:00
Timm Baeder
83356f3b62
[clang][bytecode] Compile functions lazily (#131596)
Create the Function* handles for all functions we see, but delay the
actual compilation until we really call the function. This speeds up
compile times with the new interpreter a bit.
2025-03-17 15:58:35 +01:00
Kazu Hirata
9455df969e
[Transforms] Avoid repeated hash lookups (NFC) (#131556) 2025-03-17 07:43:12 -07:00
Kazu Hirata
e71686ed15
[TargetParser] Avoid repeated hash lookups (NFC) (#131555) 2025-03-17 07:42:50 -07:00
Kazu Hirata
8789c0083d
[Transforms] Avoid repeated hash lookups (NFC) (#131554) 2025-03-17 07:42:21 -07:00
Kazu Hirata
b8317df8d8
[FileCheck] Avoid repeated hash lookups (NFC) (#131553) 2025-03-17 07:41:51 -07:00
Brox Chen
8bc0f879a0
[AMDGPU][True16][CodeGen] D16 LDS load/store pseudo instructions in true16 (#131427)
Implement new pseudos with the suffix _t16 which have VGPR_16 as the
store src or load dst. This affects LDS 8 and 16-bit loads and stores.
Lower the pseudos to the existing real Hi/Lo instructions in MC inst
layer with VGPR_32 src or dst

---------

Co-authored-by: Abhinav <abhinav.garg@amd.com>
2025-03-17 10:28:45 -04:00
Devon Loehr
2ff370f452
Warn about virtual methods in final classes (#131188)
There's never any point to adding a `virtual` specifier to methods in a
`final` class, since the class can't be subclassed. This adds a warning
when we notice this happening, as suggested in #131108.

We don't currently implement the second part of the suggestion, to warn
on `virtual` methods which are never overridden anywhere. Although it's
feasible to do this for things with internal linkage (so we can check at
the end of the TU), it's more complicated to implement and it's not
clear it's worth the effort.

I tested the warning by compiling chromium and clang itself. Chromium
resulted in [277 warnings across 109
files](https://github.com/user-attachments/files/19234889/warnings-chromium.txt),
while clang had [38 warnings across 29
files](https://github.com/user-attachments/files/19234888/warnings-clang.txt).
I inspected a subset of the warning sites manually, and they all seemed
legitimate.

This warning is very easy to fix (just remove the `virtual` specifier)
and I haven't seen any false positives, so it's suitable for
on-by-default. However, I've currently made it off-by-default because it
fires at several places in the repo. I plan to submit a followup PR
fixing those places and enabling the warning by default.
2025-03-17 15:07:31 +01:00
Pankaj Dwivedi
1c3a9a853c
[AMDGPU] frame index elimination hit assertion for scavenged nonreg (#130287)
Avoid spilling and fold the offset into `FIOp` when the scavenger fails
to find a free reg during frame index elimination.

Fixes #130120
2025-03-17 19:33:07 +05:30
Balazs Benics
19adc69029
[analyzer] Add [[maybe_unused]] forgotten in 57e36419b251 (#131617)
Fixes
https://github.com/llvm/llvm-project/pull/131175#discussion_r1998764727
2025-03-17 15:00:45 +01:00
Zhuoran Yin
1e89a76a04
[MLIR] Refactor to create vectorization convOp precondition check (#130181)
In corner situations, the vectorization pass may face to lower a conv2d
op and assert in a completely irrelevant location in
vectorizeConvolution() subroutine.

~~This PR rejects the conv2d op early and make the asserted routine to
return failure as a defensive workaround.~~

In addressing this, the PR moved all condition check away from the
`Conv1dGenerator` into the `convOpPreconditionCheck()` function. This
makes the unsupported ops such as conv2d to be rejected early and leave
a cleaner `Conv1dGenerator` constructor.
2025-03-17 09:32:45 -04:00
Simon Pilgrim
b79d53caaa [X86] X86MCInstLower.cpp - printConstant - don't assume the source constant data is smaller than the printed data
Bail out if the constant types aren't compatible

Fixes #131389
2025-03-17 13:08:55 +00:00
Michał Górny
ed57ab0c2b
[cmake] Move FindLibcCommonUtils to shared cmake, to fix standalone builds (#131586)
Move `FindLibcCommonUtils` from LLVM's CMake module directory to the
shared top-level CMake directory, as the module is intended to be used
from within the source tree rather than the installed LLVM version. This
fixes standalone offload builds after #131205.
2025-03-17 08:00:09 -05:00
Carlos Galvez
06546e005d
[clang][NFC] Fix typo 'initializeation' (#131594)
Co-authored-by: Carlos Gálvez <carlos.galvez@zenseact.com>
2025-03-17 13:42:20 +01:00
Florian Hahn
17b4be8f63
[VPlan] Move setting name and adding VFs after recipe creation.(NFC)
Recipe creation is the only place where the VF range is restricted. Move
setting the VFs just after initial recipe creation.
2025-03-17 12:04:09 +00:00
Imad Aldij
e0223fa24a
[Clang][NFC] Rename SecondArgIsLastNamedArgument for clarity and consistency (#131346)
Change the name of the control variable `SecondArgIsLastNamedArgument`
to `SecondArgIsLastNonVariadicArgument` for clarity and consistency.

Following feedback on earlier PR that was merged: 
-
https://github.com/llvm/llvm-project/pull/131238#discussion_r1995690691_
2025-03-17 07:59:20 -04:00
Sergio Afonso
6085f3f6a8
[OpenMP] Address __kmp_dist_for_static_init issue (#129902)
This patch attempts to provide a fix for an issue that appears when the
`__kmp_dist_for_static_init` function is called from a serialized team.

This is triggered by code generated by flang for `distribute parallel
do` constructs whenever an `if` clause for the `parallel` leaf construct
is present. This results in the introduction of a call to
`__kmpc_fork_call_if` in place of `__kmpc_fork_call`. When it evaluates
to `false`, it defers execution to `__kmp_serialized_parallel`, which
creates a new serial team that is picked up by
`__kmp_dist_for_static_init`, resulting in an incorrect `team` pointer
that causes the `nteams == (kmp_uint32)team->t.t_parent->t.t_nproc`
assertion to fail.

The sequence of calls replicating this issue can be summarized as:
  - `__kmpc_fork_teams`
  - `__kmpc_fork_call_if`
  - `__kmpc_dist_for_static_init_*`

Since I am not familiar with the implementation of the OpenMP runtime,
it is possible that the above sequence of calls is incorrect, or that
the bug can be better fixed in another way, so I am open to discussing
this.

The following Fortran program can be compiled with flang to show the
issue:

```f90
! Compile and run: flang -fopenmp test.f90 -o test && ./test
! Check LLVM IR: flang -fc1 -emit-llvm -fopenmp test.f90 -o -

program main
  implicit none
  integer, parameter :: n = 10
  integer :: i, idx(n)

  !$omp teams
  !$omp distribute parallel do if(.false.)
  do i=1,n
    idx(i) = i
  end do
  !$omp end teams

  print *, idx
end program
```
2025-03-17 11:44:29 +00:00
Orlando Cazalet-Hyams
f4feab927b
[NFC][KeyInstr] Add (LLVM_)EXPERIMENTAL_KEY_INSTRUCTIONS (cmake/)definition (#131344)
Key Instructions will start development behind a compile time flag to avoid
passing on the increased memory usage to all debug builds. We're working on
improving DILocation memory characteristics simultaneously; once that work lands
we can remove `EXPERIMENTAL_KEY_INSTRUCTIONS`.

This patch doesn't add any code, it's just so we can get the SIE buildbot
building with the new option right away.
2025-03-17 11:32:59 +00:00
Anutosh Bhat
e57cd100ca
Define LLVM_ABI and CLANG_ABI for __EMSCRIPTEN__ builds (#131578)
While building llvm (clang, lld) against emscripten we see this
[error](https://github.com/emscripten-forge/recipes/actions/runs/13803029307/job/38608794602#step:9:1715)

```
 │ │ In file included from $SRC_DIR/llvm/lib/Frontend/OpenACC/ACC.cpp:9:
 │ │ $SRC_DIR/build/include/llvm/Frontend/OpenACC/ACC.h.inc:192:1: error: unknown type name 'LLVM_ABI'
 │ │   192 | LLVM_ABI Directive getOpenACCDirectiveKind(llvm::StringRef Str);
 │ │       | ^
 │ │ $SRC_DIR/build/include/llvm/Frontend/OpenACC/ACC.h.inc:192:19: error: expected ';' after top level declarator
 │ │   192 | LLVM_ABI Directive getOpenACCDirectiveKind(llvm::StringRef Str);
 │ │       |                   ^
 ```

Now this was happening because we weren't defining LLVM_ABI correctly when building against emscripten. If you see [llvm/Support/Compiler.h](https://github.com/llvm/llvm-project/blob/main/llvm/include/llvm/Support/Compiler.h#L206-L210), the condition only checked for the platform __WASM__ . Now Emscripten targets WebAssembly but doesn't imply the platform by default so the check isn't complete to define LLVM_ABI.

The successful build after using this patch can be seen [here](https://github.com/emscripten-forge/recipes/actions/runs/13805214092/job/38614585621)
2025-03-17 11:14:49 +00:00
Pedro Lobo
6eb32a2fa0
[clang] Change placeholder from undef to poison (#131533)
Return a `poison` value, instead of `undef`, if there is no available
SEH info.
2025-03-17 10:49:18 +00:00
Pedro Lobo
8c939f54b4
[WebAssembly] Change placeholder from undef to poison (#131536)
Use `poison` instead of `undef` as a placeholder for phi entries of
unreachable predecessors.
2025-03-17 10:48:46 +00:00
Matt Arsenault
846cf86b2b
libclc: Add missing gfx950 target (#131585) 2025-03-17 17:47:18 +07:00
Luke Hutton
0c34d7a9e7
[mlir][tosa] Require operand/result tensors of at least rank 1 for some operations (#131335)
This commit updates the following operations (operands/results) to be of
at least rank 1 such that it aligns with the expectations of the
specification:
- ARGMAX (input)
- REDUCE_ALL (input/output)
- REDUCE_ANY (input/output)
- REDUCE_MAX (input/output)
- REDUCE_MIN (input/output)
- REDUCE_PRODUCT (input/output)
- REDUCE_SUM (input/output)
- CONCAT (each input in input1/output)
- PAD (input1/output)
- REVERSE (input1/output)
- SLICE (input1/output)
- TILE (input1/output)
- TRANSPOSE (input1/output)

In addition to this change, PAD has been updated to allow unranked
tensors for input1/output, inline with other operations.
2025-03-17 10:22:52 +00:00
Phoebe Wang
5c73c5c9bf
[X86][NFC] Add missing immediate qualifier to VSM3RNDS2 instruction (#131576) 2025-03-17 17:59:39 +08:00
Kiran Chandramohan
93e0df07c2
[Flang][OpenMP] Allow zero trait score (#131473) 2025-03-17 09:49:08 +00:00
David Green
0878dd14b2 [AArch64][GlobalISel] Add coverage for arm64-neon-2velem.ll. NFC 2025-03-17 09:40:46 +00:00
Pierre van Houtryve
e456579e34
[AMDGPU][RegBankCombiner] Add cast_of_cast and constant_fold_cast combines (#131307)
We can add a bunch of exts/truncs during RBSelect, we should be able to fold
them away afterwards.
2025-03-17 10:26:51 +01:00
Pierre van Houtryve
ab1dcac6db
[AMDGPU][RegBankInfo] Promote scalar i16 and/or/xor to i32 (#131306)
See #64591
2025-03-17 10:23:50 +01:00
Donát Nagy
27099982da
[NFC][analyzer] Framework for multipart checkers (#130985)
In the static analyzer codebase we have a traditional pattern where a
single checker class (and its singleton instance) acts as the
implementation of several (user-facing or modeling) checkers that have
shared state and logic, but have their own names and can be enabled or
disabled separately.
 
Currently these multipart checker classes all reimplement the same
boilerplate logic to store the enabled/disabled state, the name and the
bug types associated with the checker parts. This commit extends
`CheckerBase`, `BugType` and the checker registration process to offer
an easy-to-use alternative to that boilerplate (which includes the ugly
lazy initialization of `mutable std::unique_ptr<BugType>`s).
 
In this new framework the single-part checkers are internally
represented as "multipart checkers with just one part" (because this way
I don't need to reimplement the same logic twice) but this does not
require any changes in the code of simple single-part checkers.
 
I do not claim that these multi-part checkers are perfect from an
architectural point of view; but they won't suddenly disappear after
many years of existence, so we might as well introduce a clear framework
for them. (Switching to e.g. 1:1 correspondence between checker classes
and checker names would be a prohibitively complex change.)

This PR ports `DivZeroChecker` to the new framework as a proof of
concept. I'm planning to do a series of follow-up commits to port the
rest of the multi-part checker.
2025-03-17 10:19:57 +01:00
Pierre van Houtryve
7dcea28bf9
[AMDGPU] Add identity_combines to RegBankCombiner (#131305) 2025-03-17 10:11:28 +01:00
Matt Arsenault
1f1f8200bd
AMDGPU: Switch simplifydemandedbits-recursion.ll to generated checks (#131317)
This just checked the s_endpgm. Generate full checks, and remove undefs.
2025-03-17 16:10:01 +07:00