544328 Commits

Author SHA1 Message Date
Craig Topper
2fc6c73b39
[LegalizeTypes] Preserve disjoint flag when expanding OR. (#147640) 2025-07-09 14:15:42 -07:00
Andres-Salamanca
7563531fc9
[CIR] Add test for parsing bitfield_info attribute (#147628)
This PR adds a test for parsing the bitfield_info attribute.
Additionally, it updates the `storage_type` and `is_signed` fields to
match the style used in the incubator ASM format guide.
2025-07-09 16:03:47 -05:00
Krzysztof Parzyszek
2546c6d3f7
[flang][OpenMP] Recognize remaining OpenMP 6.0 spellings in parser (#147723)
Parse OpenMP 6.0 spellings for directives that don't use
OmpDirectiveNameParser.
2025-07-09 16:02:24 -05:00
Krzysztof Parzyszek
d2adfcaa9e
[flang][OpenMP] Handle multiple spellings in OmpDirectiveNameParser (#147722)
Collect all spellings from all supported OpenMP versions before parsing.
Break up the list of spellings by the initial letter to speed up parsing
a little.
2025-07-09 16:02:01 -05:00
Tomohiro Kashiwada
9c4e2dcb56
[libclang][Cygwin] Use LLVM_EXPORTED_SYMBOL_FILE (*.def file) for Cygwin (#147278)
This is not mandatory but recommended for completeness and consistency
with MinGW.
2025-07-09 23:57:12 +03:00
Vijay Kandiah
c4138a24dc
[mlir][acc][flang] Lower nested ACC loops with tile clause as collapsed loops (#147801)
In the case of nested loops, `acc.loop` is meant to subsume all of the
loops that it applies to (when explicitly described as doing so in the
OpenACC specification). So when there is a `acc loop tile(...)` present
on nested Fortran DO loops, `acc.loop` should apply to the `n` loops
that `tile` applies to. This change lowers such nested Fortran loops
with tile clause into a collapsed `acc.loop` with `n` IVs, loop bounds,
and step, in a similar fashion to the current lowering for acc loops
with `collapse` clause.
2025-07-09 15:47:11 -05:00
Peter Collingbourne
2197671109
AArch64: Relax x16/x17 constraint on AUT in certain cases.
On most operating systems, the x16 and x17 registers are not special,
so there is no benefit, and only a code size cost, to constraining AUT to
only using them. Therefore, adjust the backend to only use the AUT pseudo
(renamed AUTx16x17 for clarity) on Darwin platforms. All other platforms
use an unconstrained variant of the pseudo, AUTxMxN, for selection.

Reviewers: ahmedbougacha, kovdan01, atrosinenko

Reviewed By: atrosinenko

Pull Request: https://github.com/llvm/llvm-project/pull/132857
2025-07-09 13:46:44 -07:00
ChiaHungDuan
4ea0ef2e94
[scudo] Move out the definitions of member functions in primary allocators (#147601)
This greatly improves the readability so that we are able to tell the
design by the concise class definition.
2025-07-09 13:42:02 -07:00
Adam Siemieniuk
06ae0c2a10
[mlir][xegpu] Remove vector contract to dpas size restriction (#147470)
Removes contraction shape check to allow representing large
workgroup-level workloads in preparation for distribution.
2025-07-09 22:37:06 +02:00
Florian Hahn
253f8b6873
[VPlan] Support single-scalar VPReplicateRecipes when narrowing IGs.
When narrowing interleave groups, we can treat single scalar
VPReplicateRecipes as already narrowed.
2025-07-09 21:30:44 +01:00
Santhosh Kumar Ellendula
76b1dcfac5
[lldb][lldb-dap] Added support for "WriteMemory" request. (#131820)
Added debug adapter support for write memory.

---------

Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-hyd.qualcomm.com>
Co-authored-by: Santhosh Kumar Ellendula <sellendu@hu-sellendu-lv.qualcomm.com>
2025-07-10 01:59:20 +05:30
Jonas Devlieghere
d193a586c0
[lldb] Change breakpoint interfaces for error handling (#146972)
This RP changes some Breakpoint-related interfaces to return errors. On
its own these improvements are small, but they encourage better error
handling going forward. There are a bunch of other candidates, but these
were the functions that I touched while working on #146602.
2025-07-09 13:19:02 -07:00
Brox Chen
0d2b47ae4a
[AMDGPU][True16][CodeGen] stop emitting spgr_lo16 from isel (#144819)
When true16 is enabled, isel start to emit sgpr_lo16 register when a
trunc/sext i16/i32 is generated, or a salu32 is used by vgpr16 or vice
versa. And this causes a problem as sgpr_lo16 is not fully supported in
the pipeline.

True16 mode works fine in -O3 mode since folding pass remove sgpr_lo16
from the pipeline. However it hit a problem in -O0 mode as folding pass
is skipped.

This patch did:
1. stop emitting sgpr_lo16 from isel
2. update codegen pattern to split uniformed/divergent pattern for
i16/i32 conversion
3. update fix-sgpr-copy pass to address legalization requirement in
true16 mode, update fix-sgpr-copies-f16-true16.mir
test to include all possible combinations

This patch is tested with cts and downstream repo with -O0 testing
2025-07-09 16:17:14 -04:00
Thurston Dang
702784ca76
[msan] Check mask and rounding mode in handleAVX512VectorConvertFPToInt (#147782)
The checks were missing in "Add handler for
llvm.x86.avx512.mask.cvtps2dq.512
(https://github.com/llvm/llvm-project/pull/147377)
2025-07-09 13:06:45 -07:00
Peter Collingbourne
8b9bbd9ed6
MachineLICM: Merge logic for implicit and explicit definitions.
Anatoly Trosinenko found that when hasSideEffect was set to 0 in the
definition of LOADgotAUTH, MultiSource/Benchmarks/Ptrdist/ks/ks test
from llvm-test-suite started to crash. The issue was traced down to
MachineLICM pass placing LOADgotAUTH right after an unrelated copy to
x16 like rewriting this code:

````
bb.0:
  renamable $x16 = COPY renamable $x12
  B %bb.1

bb.1:
  ...
  /* use $x16 */
  ...
  renamable $x20 = LOADgotAUTH target-flags(aarch64-got) @some_variable, implicit-def dead $x16, implicit-def dead $x17, implicit-def dead $nzcv
  /* use $x20 */
  ...
````

like the following:

````
bb.0:
  renamable $x16 = COPY renamable $x12
  renamable $x20 = LOADgotAUTH target-flags(aarch64-got) @some_variable, implicit-def dead $x16, implicit-def dead $x17, implicit-def dead $nzcv
  B %bb.1

bb.1:
  ...
  /* use $x16 */
  ...
  /* use $x20 */
  ...
```

The issue was caused by inconsistent logic between implicit and explicit
operand definitions, where the implicit side was incorrectly skipping
checking RUDefs for dead operands, leading to RuledOut not being set
for the X16 operand.

Because there isn't really a semantic difference between implicit and
explicit operands at this point, let's remove the isImplicit check and
adjust the logic to do the same thing in both cases:

- For implicit operands, we now check and update RUDefs in the same way
  as explicit operands.
- For explicit operands, we now allow dead operands to be skipped.

Reviewers: arsenm, s-barannikov, atrosinenko

Reviewed By: arsenm, s-barannikov

Pull Request: https://github.com/llvm/llvm-project/pull/147624
2025-07-09 13:02:15 -07:00
OverMighty
44582c9f08
[libc] Fix DyadicFloat::generic_as() requiring LIBC_TYPES_HAS_FLOAT16 (#147811)
See https://lab.llvm.org/buildbot/#/builders/215/builds/710.
2025-07-09 21:47:14 +02:00
Andre Kuhlenschmidt
fc9dd58734
[flang][driver] add -Wfatal-errors (#147614)
Adds the flag `-Wfatal-errors` which truncates the error messages at 1 error.
2025-07-09 12:35:43 -07:00
Razvan Lupusoru
8f8b1b0402
[mlir][acc][nfc] Update type interface descriptions (#147807)
PointerLikeType and MappableType interfaces are now described with more
detail.
2025-07-09 12:30:57 -07:00
Krishna Pandey
bb7cea0637
[libc][math][c++23] Add bfloat16 support in LLVM libc (#144463)
This PR enables support for BFloat16 type in LLVM libc along with
support for testing BFloat16 functions via MPFR.

---------

Signed-off-by: krishna2803 <kpandey81930@gmail.com>
Signed-off-by: Krishna Pandey <kpandey81930@gmail.com>
Co-authored-by: OverMighty <its.overmighty@gmail.com>
2025-07-09 21:26:29 +02:00
enh-google
ff365ce1d7
Reland "Fix wcpncpy() return value; add test." (#146753)
Reverts llvm/llvm-project#146752, which was a revert of my accidental
push, so we can actually review and presubmit this time.
2025-07-09 15:25:49 -04:00
Rahul Joshi
2366573679
[TableGen] Minor cleanup in StringToOffsetTable (#147712)
Make `AppendZero` a class member instead of an argument to
`GetOrAddStringOffset` to reflect the intended usage that for a given
`StringToOffsetTable`, all strings must use the same value of
`AppendZero`.

Modify `EmitStringTableDef` to drop the `Indent` argument as its always
set to `""`, and to fail if it's called for a table with
non-null-terminated strings.
2025-07-09 12:22:29 -07:00
Eli Friedman
aa27d4e0c3
[clang] Implement consteval for captured structured bindings. (#147615)
127bf44385424891eb04cff8e52d3f157fc2cb7c implemented most of the
infrastructure for capturing structured bindings in lambdas, but missed
one piece: constant evaluation of such lambdas. Refactor the code to
handle this case.

Fixes #145956.
2025-07-09 12:09:35 -07:00
Diego Caballero
889ac879ce
[mlir][Vector] Remove usage of vector.insertelement/extractelement from Vector (#144413)
This PR is part of the last step to remove `vector.extractelement` and `vector.insertelement` ops.
RFC: https://discourse.llvm.org/t/rfc-psa-remove-vector-extractelement-and-vector-insertelement-ops-in-favor-of-vector-extract-and-vector-insert-ops

It removes instances of `vector.extractelement` and `vector.insertelement` from the Vector dialect layer.
2025-07-09 12:09:17 -07:00
Thurston Dang
61d52ea764
[NFCI][msan] Refactor to use 'isFixedIntVector' etc. (#147789)
Inspired by a suggestion from Florian Google in
https://github.com/llvm/llvm-project/pull/147606#discussion_r2193548994
2025-07-09 12:07:19 -07:00
Philip Reames
7bf439d260 [IA] Partially revert interface change from 4a66ba
As noted in post commit review, the API change here was not required.
I'd apparently confused myself when teasing apart patches from my
development branch.
2025-07-09 12:02:52 -07:00
Finn Plummer
420e2f584d
[DirectX] Add missing verifications during validate of DXILRootSignature (#147111)
This pr resolves some discrepancies in verification during `validate` in
`DXILRootSignature.cpp`.

Note: we don't add a backend test for version 1.0 flag values because it
treats the struct as though there is no flags value. However, this will
be used when we use the verifications in the frontend.

- Updates `verifyDescriptorFlag` to check for valid flags based on
version, as reflected [here](https://github.com/llvm/wg-hlsl/pull/297)
- Add test to demonstrate updated flag verifications
- Adds `verifyNumDescriptors` to the validation of `DescriptorRange`s
- Add a test to demonstrate `numDescriptors` verification
- Updates a number of tests that mistakenly had an invalid
`numDescriptors` specified

Resolves: https://github.com/llvm/llvm-project/issues/147107
2025-07-09 12:02:02 -07:00
Lei Huang
d5da826159
[PowerPC][NFC] Define new alias for mma accumulate builtins (#147382)
Move documentation for macros up to where the macros are initially defined and
add new custom MMA builtin macro in prep for adding more accumulate builtins to clang.

---------

Co-authored-by: Amy Kwan <amy.kwan1@ibm.com>
2025-07-09 14:46:15 -04:00
MangalaPG
dd54b8e462
Clang-Tidy issues in fixed in file SystemZISelLowering.cpp (#147251)
Corrected variable names corrections according to the clang-tidy
standards.

---------

Signed-off-by: MangalaPG <mangala.P.G@ibm.com>
2025-07-09 20:26:42 +02:00
LU-JOHN
85cc4afdef
[NFC][AMDGPU] Do not hardcode minimum instruction alignment (#147785)
Use symbolic value for minimum instruction alignment.

Signed-off-by: John Lu <John.Lu@amd.com>
2025-07-09 14:24:33 -04:00
Matthias Braun
bdc0119e1b
ErrorHandling: Check for EINTR and partial writes (#147595)
Calls to the posix `write` function can return -1 and set errno to
`EINTR` or perform partial writes when interrupted by signals. In those
cases applications are supposed to just try again. See for example the
documentation in glibc:
https://sourceware.org/glibc/manual/latest/html_node/I_002fO-Primitives.html#index-write

This fixes the uses in `ErrorHandling.cpp` to retry as needed.
2025-07-09 11:19:21 -07:00
Alex MacLean
b44c50d416
[NVPTX] Rework and cleanup FTZ ISel (#146410)
This change cleans up DAG-to-DAG instruction selection around FTZ and
SETP comparison mode. Largely these changes do not impact functionality
though support for `{sin.cos}.approx.ftz.f32` is added.
2025-07-09 11:16:48 -07:00
ganenkokb-yandex
a57aaedc35
Ast importer visitors (#138838)
I've rebased commit from
[Evianaive](https://github.com/Evianaive/llvm-project/commits?author=Evianaive)
and compiled it.
I hope it will speed up fix for #129393.

---------

Co-authored-by: Evianaive <153540933@qq.com>
2025-07-09 21:12:31 +03:00
Rahman Lavaee
fcecf177c1
[SHT_LLVM_BB_ADDR_MAP] Emit callsite offsets in the SHT_LLVM_BB_ADDR_MAP section. (#146563)
Callsite offsets will help map addresses to the right position in the
basic block (before or after a callsite).

This PR also bumps the BBAddrMap version to 3.

The encoding/decoding ability is already pushed upstream
8d7a8fcc3ab9f6d4c4a7e4312876fe94ed3d6c4f.
2025-07-09 11:11:15 -07:00
jyli0116
4c27279ec4
[GlobalISel] Add Saturated Truncate Instructions (#147526)
Introduces saturated truncate instructions to Global ISel:
G_TRUNC_SSAT_S, G_TRUNC_SSAT_U, G_TRUNC_USAT_U. These were previously
introduced to SDAG to reduce redundant code.

The patch only initially introduces the instruction, a later patch will
follow to add combines and legalization for each instruction.
2025-07-09 18:56:17 +01:00
Rahman Lavaee
cd9236d788
Account for inline assembly instructions in inlining cost. (#146628)
Inliner currently treats every "call asm" IR instruction as a single
instruction regardless of how many instructions the inline assembly may
contain. This may underestimate the cost of inlining for a callee
containing long inline assembly. Besides, we may need to assign a higher
cost to instructions in inline assembly since they cannot be analyzed
and optimized by the compiler.

This PR introduces a new option `-inline-asm-instr-cost` -- set zero by
default, which can control the cost of inline assembly instructions in
inliner's cost-benefit analysis.
2025-07-09 10:48:07 -07:00
Leandro Lupori
a63846b475
[flang] Fix array assignment regression introduced by #147371 (#147761)
In some cases fixed shape arrays can be fir.heap/fir.ptr, even
after hlfir::derefPointersAndAllocatables() is called.
2025-07-09 14:41:56 -03:00
James Y Knight
c57fe2f6ca [bazel] Update after 058056329982db13d513bc05d3c98f6558418242 2025-07-09 13:37:21 -04:00
Justin King
64453c802e
rtsan: Support free_sized and free_aligned_sized from C23 (#145085)
Adds support to RTSan for `free_sized` and `free_aligned_sized` from
C23.

Other sanitizers will be handled with their own separate PRs.

For https://github.com/llvm/llvm-project/issues/144435

Signed-off-by: Justin King <jcking@google.com>
2025-07-09 10:36:59 -07:00
Aiden Grossman
8c32f9517a
[CI][Github] Remove MAX_PARALLEL_*_JOBS Args from Windows Runs (#147770)
This patch removes setting the MAX_PARLLEL_COMPILE_JOBS and
MAX_PARALLEL_LINK_JOBS env variables in the windows runs. These were
originally used to control the parallelism on the old infrastructure and
we set them on the new infrastructure explicitly so that we could
maintain both at the same time. Now it does not make sense to keep them
explicitly set that we do not need to explicitly control the parallelism
given the amount of RAM we have on the machines. This also adds a
maintnenace cost as evidenced by the fact that these have been incorrect
(64 instead of 32) for quite a while.
2025-07-09 10:25:09 -07:00
Petr Hosek
30a2b8baca
[CMake][Fuchsia] Switch to RUNTIMES_USE_LIBC option (#147776)
LIBCXX_LIBC was renamed to RUNTIMES_USE_LIBC in #134893.
2025-07-09 10:10:34 -07:00
Hervé Poussineau
1431f8f76f
[libc++] Simplify definition of __libcpp_recursive_mutex_t (#147385)
As it only depends of pointer size, use `_WIN64` define to simplify conditions.
2025-07-09 12:53:08 -04:00
Simon Pilgrim
3e4e5dbc25 [AMDGPU] shl_add_ptr.ll - regenerate test checks 2025-07-09 17:50:07 +01:00
Philip Reames
4a66ba2a4d
[IA] Support deinterleave intrinsics w/ fewer than N extracts (#147572)
For the fixed vector cases, we already support this, but the
deinterleave intrinsic cases (primary used by scalable vectors) didn't.
Supporting it requires plumbing through the Factor separately from the
extracts, as there can now be fewer extracts than the Factor. Note that
the fixed vector path handles this slightly differently - it uses the
shuffle and indices scheme to achieve the same thing.
2025-07-09 09:41:07 -07:00
Chelsea Cassanova
76a841a5e6
Revert "Reland "[lldb][RPC] Upstream lldb-rpc-gen tool" (#146969)" (#147779)
Reverts llvm/llvm-project#147417. Failing an assert:
`lldb-rpc-gen:
../llvm-project/lldb/tools/lldb-rpc/lldb-rpc-gen/server/RPCServerSourceEmitter.cpp:361:
void lldb_rpc_gen::RPCServerSourceEmitter::EmitMethodCallAndEncode(const
Method &): Assertion `Pos != MethodsWithPointerReturnTypes.end() &&
"Unable to determine the size of the return buffer"' failed.`
2025-07-09 09:39:30 -07:00
Min-Yih Hsu
c2a818f48b
[RISCV] Add scheduling info for XSfvqmaccdod/qoq and XSfvfwmaccqqq instructions (#147626)
XSfvqmaccdod/qoq and XSfvfwmaccqqq are SiFive's small-size matrix
multiplication extensions. This patches add scheduling info for their
instructions along with six new SchedReadWrite.
2025-07-09 09:38:44 -07:00
Andrew Rogers
080ade03ac
[llvm] statically link TableGenTests (#147577)
## Purpose
Statically link `TableGenTests` so it can still build when linked
against an LLVM Windows DLL.

## Background
The effort to build LLVM as a WIndows DLL is tracked in #109483.
Additional context is provided in [this
discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307).

If `TableGenTests` is linked against LLVM built as a DLL on Windows, it
will fail due to a large number of duplicate symbols found in both the
LLVM DLL and TableGen libraries. This is because `LLVMTableGenBasic` and
`LLVMTableGenCommon` are linked statically against LLVM (using
`DISABLE_LLVM_LINK_LLVM_DYLIB`) so already contain a sub-set of symbols
also exported from the LLVM DLL.

This patch was originally part of #145448.
2025-07-09 09:37:33 -07:00
Amr Hesham
ddfc13c191
[CIR] Upstream __builtin_creal for ComplexType (#146927)
Upstream `__builtin_creal` support for ComplexType

https://github.com/llvm/llvm-project/issues/141365
2025-07-09 18:28:00 +02:00
Fraser Cormack
9b5959dd9a
[libclc] Change symlinks to copies on Windows (#147759)
This mirrors how other LLVM libraries handle symlinks
2025-07-09 17:20:56 +01:00
Chelsea Cassanova
afc82ce3aa
Reland "[lldb][RPC] Upstream lldb-rpc-gen tool" (#146969) (#147417)
Relands the commit to upstream the lldb-rpc-gen tool in order to fix a
build failure on the linux remote bots. The reland adds the Clang
resource dir unconditionally to the invocation for the tool instead of
only adding it in the event that we're using a standalone build.

Original PR description:

This commit upstreams the lldb-rpc-gen tool, a ClangTool that generates
the LLDB RPC client and server interfaces. This tool, as well as LLDB
RPC itself is built by default. If it needs to be disabled, put
-DLLDB_BUILD_LLDBRPC=OFF in your CMake invocation.

https://discourse.llvm.org/t/rfc-upstreaming-lldb-rpc/85804

Original PR Link:

https://github.com/llvm/llvm-project/pull/138031
2025-07-09 09:19:42 -07:00
Jonas Devlieghere
2756ba57f1
[lldb] Enable SWIG Doxygen Translation (#147617)
Enable SWIG support for translating Doxygen comments found in interface
and header files into a target language's normal documentation language.
This feature was introduced in SWIG 4.0 and currently only supports
Python (and Java). Hand-written documentation still takes precedence.

SWIG documentation: https://www.swig.org/Doc4.0/Doxygen.html
2025-07-09 09:13:57 -07:00