533264 Commits

Author SHA1 Message Date
Leandro Lupori
76fee8f4ed
[flang][OpenMP][NFC] Don't use special chars in error messages (#134686)
Some error messages were using a special char for `fi`, in the
word `specified`, probably due to a typo.

This caused an error on Windows: #134625
2025-04-07 16:22:51 -03:00
Brad Smith
8f5a3ec649
[sanitizer_common] Use HW_NCPUONLINE sysctl on NetBSD in GetNumberOfCPUs() (#134704) 2025-04-07 15:15:12 -04:00
Piotr Fusik
10bef367a5
[RISCV][test] Fix a comment typo (#134242) 2025-04-07 20:47:21 +02:00
YLChenZ
529e9127f0
[clang][doc]: Merge entries with duplicate content. (#134089)
Before the patch:

![docb4](https://github.com/user-attachments/assets/6db1000f-d555-48b8-8a19-85c41b043fd8)
after the patch:

![doc-after](https://github.com/user-attachments/assets/1cff64b6-db2e-48d8-b0a9-a403fd61f8af)

Fixes #133706
2025-04-07 14:42:57 -04:00
Jason Molenda
369c7739d0 Revert "[lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)"
This reverts commit 21d912121c9f41385b165a736be787527f5bd7c2.

Failure on the aarch64 ubuntu bot when setting the 4th watchpoint;
may be a hardware limitation on that bot.  I thought creating four
watchpoints would be generally safe, but I don't need to do that
for my test, will re-land without it.
2025-04-07 11:21:58 -07:00
Jason Molenda
21d912121c
[lldb][debugserver] Fix an off-by-one error in watchpoint identification (#134314)
debugserver takes the address of a watchpoint exception and calculates
which watchpoint was responsible for it. There was an off-by-one error
in the range calculation which causes two watchpoints on consecutive
ranges to not correctly identify hits to the second watchpoint. The
result is that lldb wouldn't show the second watchpoint as ever being
hit.

rdar://145107575
2025-04-07 11:11:31 -07:00
Pranav Kant
4607d39c7e
[bazel] Fix build (#134697)
Fixes fallback from #134439
2025-04-07 10:36:38 -07:00
Nico Weber
1043f5cb0b [gn] port 16c84c4475b9 2025-04-07 13:30:59 -04:00
vdonaldson
c1c0d551ba
[flang] Non-type-bound defined IO lowering for an array of derived type (#134667)
Update Non-type-bound IO lowering to call OutputDerivedType for an array
of derived type (rather than OutputDescriptor).
2025-04-07 13:24:48 -04:00
Rahul Joshi
23c27f3efc
[NFC][LLVM][AArch64] Cleanup pass initialization for AArch64 (#134315)
- Remove calls to pass initialization from pass constructors.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 10:24:27 -07:00
Matt Arsenault
783201b184
Attributor: Don't follow uses of ConstantData (#134573)
These should not really have uselists, and it's not worth the compile
time of looking at all uses of trivial constants. The main observable
change of this is it no longer adds align attributes on constant null
uses, but those are not useful. Some of these cases should potentially
be more aggressive and not look at any Constant users.
2025-04-07 23:59:53 +07:00
Simon Pilgrim
4701afaeaf [X86] combineX86ShufflesRecursively - merge loops peeking through shuffle operands. NFC.
Merge loops to peek through free insert_subvector / bitcasts / extract_subvector.

To keep this NFC I haven't reordered the peek throughs - this will done in a future patch to help with #133947 regressions
2025-04-07 17:51:56 +01:00
Jan Leyonberg
fbc8335311
[MLIR][OpenMP] Add codegen for teams reductions (#133310)
This patch adds the lowering of teams reductions from the omp dialect to
LLVM-IR. Some minor cleanup was done in clang to remove an unused
parameter.
2025-04-07 12:47:16 -04:00
Tai Ly
cb9afe53bf
[mlir][tosa] Fix validation pass assert (#134445)
This fixes a validation pass assert when processing ops with quantized
element types.
The failure case is added to invalid.mlir
The fix is to re-order the validation checking so that only ops with
int/float operands and results pass the first stage of validation pass,
so that the remaining checks do not need to handle quantized data types.

Signed-off-by: Tai Ly <tai.ly@arm.com>
2025-04-07 09:47:07 -07:00
Matt Arsenault
1c8291ffc4 RISCV: Convert test to opaque pointers 2025-04-07 23:45:54 +07:00
Jerry-Ge
112af87964
[mlir][tosa] Add parenthesis for the weight padding calculation (#134420)
Minor change.

Signed-off-by: Jerry Ge <jerry.ge@arm.com>
2025-04-07 09:43:46 -07:00
Henry Jiang
600eeed51f
[JITLink][NFC] Guard functions used only for debug for XCOFFLinkGraphBuilder (#134413) 2025-04-07 12:32:02 -04:00
Alexey Bataev
f413772b31 [SLP]Fix last instruction selection for vectorized last instruction in SplitVectorize nodes
If the last instruction in the SplitVectorize node is vectorized and
scheduled as part of some bundles, the SplitVectorize node might be
placed in the wrong order, leading to a compiler crash. Need to check if
the vectorized node has vector value and place the SplitVectorize node after the vector instruction to prevent a compile crash.

Fixes issue reported in https://github.com/llvm/llvm-project/pull/133091#issuecomment-2782826805
2025-04-07 09:27:08 -07:00
Lee Wei
f7cc213d58
[ConstraintSystem] Update comments (#127351)
It took me some time to fully understand the implementation of
Fourier–Motzkin elimination in the Constraint System, so I added an
example in the comments. Hopefully future developers can understand the
algorithm more easily with the example.
2025-04-08 00:22:47 +08:00
Mark de Wever
a406fb8f5a
[libc++] Clang-tidy operator& hijacker. (#128366)
Guards against introducing new places where operator& depends on a
template type.
2025-04-07 18:19:58 +02:00
Leandro Lupori
01ec74dfd0
[flang][OpenMP] Fix copyprivate of procedure pointers (#134292)
Just modify the assert to consider fir::BoxProcType as valid. No
other changes are needed.

Fixes #131549
2025-04-07 13:18:07 -03:00
Mark de Wever
1847b00330
[libc++][ci] Removes C++2b selection option. (#88557)
Since Clang 16 is no longer supported all compilers support C++23.
2025-04-07 18:17:11 +02:00
Linux User
0a35dd7e99
[llvm-ar] --help: fix unquoted angle bracket (#101364)
Changes the argument in llvm-ar help message from `-M [<mri-script]` to
`-M [< mri-script]`
2025-04-07 17:12:50 +01:00
Simon Pilgrim
efce8f1ce6 [X86] combineX86ShufflesRecursively - use enumerate to iterate over shuffle operands. NFC. 2025-04-07 17:09:36 +01:00
Farzon Lotfi
16c84c4475
[DirectX] Add target builtins (#134439)
- fixes #132303
- Moves dot2add from a language builtin to a target builtin.
-  Sets the scaffolding for Sema checks for DX builtins
-  Setup DirectX backend as able to have target builtins
- Adds a DX TargetBuiltins emitter in
`clang/lib/CodeGen/TargetBuiltins/DirectX.cpp`
2025-04-07 12:06:57 -04:00
Rahul Joshi
7fe6e70e7c
[NFC][LLVM][NVPTX] Cleanup pass initialization for NVPTX (#134311)
- Move all pass initialization function calls to NVPTX target
initialization and out of individual pass constructors.
- Move all pass initialization function declaration to NVPTX.h.
- https://github.com/llvm/llvm-project/issues/111767
2025-04-07 08:54:44 -07:00
Paul Kirth
268c065eab
[fatlto] Add coroutine passes when using FatLTO with ThinLTO (#134434)
When coroutines are used w/ both -ffat-lto-objects and -flto=thin,
the coroutine passes are not added to the optimization pipelines.
Ensure they are added before ModuleOptimization to generate a
working ELF object.

Fixes #134409.
2025-04-07 08:41:49 -07:00
David Spickett
b09daa4b23
[llvm][docs] 2 small fixes to GitHub guide (#134620)
1. `arc` is long gone, no need to mention it.
2. Say exactly where user branches can be made.
2025-04-07 16:39:04 +01:00
Alexandre Ganea
c75eac7c03
[LLD][COFF] Don't dllimport from static libraries (#134443)
This reverts commit 6a1bdd9 and re-instate behavior that matches what
MSVC link.exe does, that is, error out when trying to dllimport a symbol
from a static library.

A hint is now displayed in stdout, mentioning that we should rather dllimport the symbol
from a import library.

Fixes https://github.com/llvm/llvm-project/issues/131807
2025-04-07 11:34:24 -04:00
Julian Lettner
4b90f24db8
[LLDB] Add integration test for libsanitizers trace collection (#134323)
Add integration test for libsanitizers trace collection
(`SanitizersAllocationTraces=all`).
    
rdar://144244084
2025-04-07 08:33:27 -07:00
Joseph Huber
e2885772f0 [libc] Fix function that wasn't updated in wrapper headers 2025-04-07 10:30:58 -05:00
Matheus Izvekov
954ccee5d5
[clang] fix partial ordering of NTTP packs (#134461)
This fixes partial ordering of pack expansions of NTTPs, by procedding
with the check using the pattern of the NTTP through the rules of the
non-pack case.

This also unifies almost all of the different versions of
FinishTemplateArgumentDeduction (except the function template case).
This makes sure they all follow the rules consistently, instantiating
the parameters and comparing those with the argument.

Fixes #132562
2025-04-07 12:30:51 -03:00
Michael Klemm
7fa388d77b
[Flang][OpenMP] Fix bug with default(none) and host-assoc threadprivate variable (#134122)
When a host associated `threadprivate` variable was used in a parallel
region with `default(none)` in an internal subroutine was failing,
because the compiler did not properly determine that the variable was
pre-determined `threadprivate` and thus should not have been reported as
missing a DSA.
2025-04-07 17:20:17 +02:00
Justin Bogner
48bad5bbcd
[HLSL] Include SPIRV in LLVM_TARGETS_TO_BUILD in the HLSL cmake cache (#133287)
Since SPIRV is no longer an experimental target this wasn't actually
enabling it any more.
2025-04-08 00:07:15 +09:00
Matt Arsenault
28a391848c Bitcode: Convert test to opaque pointers 2025-04-07 21:59:11 +07:00
zhijian lin
8fddef8483
[SelectionDAG] Introducing a new ISD::POISON SDNode to represent the poison value in the IR. (#125883)
A new ISD::POISON SDNode is introduced to represent the `poison value`
in the IR, replacing the previous use of ISD::UNDEF.
2025-04-07 10:03:05 -04:00
Farzon Lotfi
82103dfae9
Revert "Reland [Clang][Cmake] fix libtool duplicate member name warnings" (#134656)
Reverts llvm/llvm-project#133850
2025-04-07 10:00:53 -04:00
Igor Wodiany
cff65657d9
[mlir][spirv] Fix incorrect argument erasure in deserializer (#134610)
The current implementation iterates and modifies the list of arguments
at the same time. Depending on the number of arguments this will trigger
an assert: `assert(index < arguments.size())`. This change replaces loop
with a range based erasure.
2025-04-07 15:00:33 +01:00
Farzon Lotfi
0d71d9ab28
Reland [Clang][Cmake] fix libtool duplicate member name warnings (#133850)
fixes https://github.com/llvm/llvm-project/issues/133199

As of the third commit the fix to the linker missing references in
`Targets/DirectX.cpp` found in
https://github.com/llvm/llvm-project/pull/133776 was fixed by moving
`HLSLBufferLayoutBuilder.cpp` to `clang/lib/CodeGen/Targets/`.

It fixes the circular reference issue found in
https://github.com/llvm/llvm-project/pull/133619 for all
`-DBUILD_SHARED_LIBS=ON` builds by removing `target_link_libraries` from
the sub directory cmake files.

testing for amdgpu offload was done via
`cmake -B ../llvm_amdgpu -S llvm -GNinja -C
offload/cmake/caches/Offload.cmake -DCMAKE_BUILD_TYPE=Release`

PR https://github.com/llvm/llvm-project/pull/132252 Created a second
file that shared <TargetName>.cpp in clang/lib/CodeGen/CMakeLists.txt

For example There were two AMDGPU.cpp's one in TargetBuiltins and the
other in Targets. Even though these were in different directories
libtool warns that it might not distinguish them because they share the
same base name.

There are two potential fixes. The easy fix is to rename one of them and
keep one cmake file. That solution though doesn't future proof this
problem in the event of a third <TargetName>.cpp and it seems teams want
to just use the target name

https://github.com/llvm/llvm-project/pull/132252#issuecomment-2758178483.

The alternative fix that this PR went with is to seperate the cmake
files into their own sub directories as static libs.
2025-04-07 09:53:07 -04:00
Asher Mancinelli
b2711e1526
[flang][nfc] Support volatile on ref, box, and class types (#134386)
Part one of merging #132486. Add support for representing volatility in
the type system for reference, box, and class types. Don't do anything
with volatile just yet, only support and test their representation and
utility functions.

The naming convention is a little goofy - `fir::isa_volatile_type` and
`fir::updateTypeWithVolatility` use different capitalization, but I put
them near similar functions and tried to match the surrounding
conventions and [the
docs](https://github.com/llvm/llvm-project/blob/main/flang/docs/C%2B%2Bstyle.md#naming)
best I could.
2025-04-07 06:51:02 -07:00
Pedro Lobo
0ab2061c4f
[WebAssembly] Represent trap instructions as poison (#134553)
The WebAssemblyLowerRefTypesIntPtrConv pass currently uses `undef` to
represent trap instructions. These can instead be represented by the
`poison` value.
2025-04-07 14:29:55 +01:00
Farzon Lotfi
771b94fa83
[NFC][SPIRV] remove unimplemented function define for selectCross (#134478)
- `selectCross` looks to be a function that had its implementation and
usage removed but this define some how stuck around.
- this change removes the definition.
2025-04-07 09:26:36 -04:00
Nashe Mncube
67dd2019ac
Recommit [AArch64][SVE]Use FeatureUseFixedOverScalableIfEqualCost for A510/A520 (#134606)
Recommit. This work was done by #132246 but failed buildbots due to the
test introduced needing updates

Inefficient SVE codegen occurs on at least two in-order cores, those
being Cortex-A510 and Cortex-A520. For example a simple vector add

```
void foo(float a, float b, float dst, unsigned n) {
    for (unsigned i = 0; i < n; ++i)
        dst[i] = a[i] + b[i];
}
```

Vectorizes the inner loop into the following interleaved sequence of
instructions.

```
        add     x12, x1, x10
        ld1b    { z0.b }, p0/z, [x1, x10]
        add     x13, x2, x10
        ld1b    { z1.b }, p0/z, [x2, x10]
        ldr     z2, [x12, #1, mul vl]
        ldr     z3, [x13, #1, mul vl]
        dech    x11
        add     x12, x0, x10
        fadd    z0.s, z1.s, z0.s
        fadd    z1.s, z3.s, z2.s
        st1b    { z0.b }, p0, [x0, x10]
        addvl   x10, x10, #2
        str     z1, [x12, #1, mul vl]
```

By adjusting the target features to prefer fixed over scalable if the
cost is equal we get the following vectorized loop.

```
         ldp q0, q3, [x11, #-16]
         subs    x13, x13, #8
         ldp q1, q2, [x10, #-16]
         add x10, x10, #32
         add x11, x11, #32
         fadd    v0.4s, v1.4s, v0.4s
         fadd    v1.4s, v2.4s, v3.4s
         stp q0, q1, [x12, #-16]
         add x12, x12, #32
```

Which is more efficient.
2025-04-07 14:09:43 +01:00
Krisztian Rugasi
382962b4a8 [GlobalISel] Fix dangling reference in CombinerHelper::matchCombineExtractedVectorLoad 2025-04-07 15:04:36 +02:00
Andrzej Warzyński
2f6bc47a18
[mlir][vector] Standardise valueToStore Naming Across Vector Ops (NFC) (#134206)
This change standardises the naming convention for the argument
representing the value to store in various vector operations.
Specifically, it ensures that all vector ops storing a value—whether
into memory, a tensor, or another vector — use `valueToStore` for the
corresponding argument name.

Updated operations:
* `vector.transfer_write`, `vector.insert`, `vector.scalable_insert`,
  `vector.insert_strided_slice`.

For reference, here are operations that currently use `valueToStore`:
* `vector.store` `vector.scatter`, `vector.compressstore`,
  `vector.maskedstore`.

This change is non-functional (NFC) and does not affect the
functionality of these operations.

Implements #131602
2025-04-07 13:56:54 +01:00
Matthias Springer
bafa2f4442
[mlir][memref] Check memory space before lowering alloc ops (#134427)
Check the memory space before lowering allocation ops, instead of
starting the lowering and then rolling back the pattern when the memory
space was found to be incompatible with LLVM.

Note: This is in preparation of the One-Shot Dialect Conversion
refactoring.

Note: `isConvertibleAndHasIdentityMaps` now also checks the memory
space.
2025-04-07 14:38:18 +02:00
JaydeepChauhan14
4509bc1299
[X86][GlobalISel] Enable POWI function with libcall mapping (#134369) 2025-04-07 14:32:56 +02:00
Jay Foad
e2fe78797f
[Clang] Use "syncscope" instead of "synchscope". NFC. (#134616)
This matches the spelling of the keyword in LLVM IR.
2025-04-07 13:32:36 +01:00
Christian Sigg
9fe6f6a0d4
[bazel] Change gentbl_cc_library(tbl_outs) to dicts (#134349)
Follow up from https://github.com/llvm/llvm-project/pull/134271
2025-04-07 14:23:22 +02:00
Mats Jun Larsen
4d1e4eff5f
[IR] Avoid call to deprecated PointerType::get (NFC) (#134609)
Should keep MSVC quiet as noticed by @rksimon in #134517.

Assertions have been copied over from PointerType::get in order to not
silently change invariants with this call.
2025-04-07 12:09:00 +00:00