575643 Commits

Author SHA1 Message Date
Nishant Patel
9c0a9bb3c6
[MLIR][XeGPU] Add support for reducing to scalar in sg to wi pass (#190193) 2026-04-03 16:56:28 -07:00
Jonas Devlieghere
46411f384d
[lldb] Update dsym-python-script.test for #190407 (#190432) 2026-04-03 16:48:04 -07:00
Valentin Clement (バレンタイン クレメン)
00d713446e
[flang][cuda] Do not flag dummy arg component as host array (#190431) 2026-04-03 23:47:18 +00:00
Schrodinger ZHU Yifan
d6534f437d
[libc][signal] remove wrongly added constexpr (#190424)
Hotfix for CI failure
2026-04-03 23:04:20 +00:00
Jackson Stogel
b0a54bec9b
[bazel] Fixes c34c0442ee1fe400dc35a7dd7776d48ad65768dd (#190416) 2026-04-03 15:47:32 -07:00
Schrodinger ZHU Yifan
463f6cb576
[libc] update abort implementation and lift it for internal usage (#189756) 2026-04-03 18:40:52 -04:00
Peter Collingbourne
18268ebc76
gn build: Port 7b2aa02a33df
Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/190419
2026-04-03 15:29:52 -07:00
Peter Collingbourne
a7aa857e9b
gn build: Port d08ebbe8eba1
Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/190418
2026-04-03 15:29:25 -07:00
Peter Collingbourne
5c355ef216
Remove unnecessary -O1 from clang command.
It is generally inappropriate to pass -O flags to IRGen tests because
it makes them sensitive to optimizer behavior. #186548 makes a change to
optimizer behavior that would cause this test to fail without this change.

Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/190417
2026-04-03 15:28:34 -07:00
Jonas Devlieghere
52568a54d9
[lldb] Keep the existing behavior for untrusted dSYMs (#190407)
This patch does two thing:

- It reverts to the previous behavior of warning for untrusted dSYMs.
- It includes whether a dSYM is trusted or untrusted in the warning
output.

My reasoning is that there's no tooling for automatically signing dSYMs
and therefore we shouldn't change the behavior until this is more
common. The inclusion of whether the dSYM is signed or not is the first
step towards advertising the existence of the feature.

This now also means the release note I added in #189444 is correct
(again).
2026-04-03 22:11:35 +00:00
Craig Topper
beb8b67a6a
[RISCV] Allow coalesceVSETVLIs to move an LI if it allows a vsetvli to be mutated. (#190287)
If the AVL is provided by an LI, move it earlier if it allows us to
mutate the prior vsetvli.

Assisted-by: Claude Sonnet 4.5
2026-04-03 15:02:35 -07:00
Jackson Stogel
3f37512c8f
[DiagnosticInfo] Allow std::string_view in DiagnosticBuilder operator<<. (#190374)
After a68ae7b0cc0922b79114aabe8cf1ec8dc68524d7, calling `<<` with a
`std::string_view` gives:

```
clang/include/clang/Basic/Diagnostic.h:1319:8: error: use of overloaded operator '<<' is ambiguous (with operand types 'const StreamingDiagnostic' and 'const std::string_view')
 1319 |     DB << V;
      |     ~~ ^  ~
```
2026-04-03 15:02:14 -07:00
Min-Yih Hsu
55bcc05a72
[utils][MCA] Add a helper script to create input-file-based tests (#190074)
This is a helper script to create llvm-mca tests that follow the style
described in #173926 . That is, instead of putting both the input
instructions and CHECK lines in the same file, we consolidate all input
(files) into a single place, read by their `.test` files counterpart to
check the per-processor results.

The script added by this patch will enumerate each (`.s`) input files
and create the corresponding `.test` file, parameterized by the provided
`--triple` and `--cpu` options. Users also have the option to exclude
certain input files or add additional `llvm-mca` / `FileCheck`
arguments.
2026-04-03 14:59:14 -07:00
Jon Roelofs
26e1df20f8
[llvm][SupportTests] Fix a race condition in temporary socket construction (#190404)
createUniquePath doesn't make an exclusive lock on the filename until
the socket is created, and thus the removal step in these tests was
creating a TOCTOU race. Instead, arrange for the file to be cleaned up
*after* we're done with it.

rdar://142847430
2026-04-03 21:40:38 +00:00
Matt Arsenault
36e781ceb4
clang: Remove dead null toolchain check (#190402) 2026-04-03 23:35:18 +02:00
Paul Kirth
64987a9ccc
[clang-doc] Enforce arena allocated types are trivially destructible (#190049)
We can enforce at compile-time that the types we want to place in the
arenas are always safe to allocate there.
2026-04-03 21:28:18 +00:00
Craig Topper
c7824ac669
[TargetLowering] Remove stale comment. NFC (#190275)
Missed removing in #188653
2026-04-03 14:26:09 -07:00
Matt Arsenault
6f68e58519
offload: Parse triple using to identify amdgcn-amd-amdhsa (#190319)
Avoid hardcoding the exact triple.
2026-04-03 23:22:48 +02:00
Valentin Clement (バレンタイン クレメン)
77e32a749f
[flang][cuda] Avoid false semantic error on unified array component (#190389) 2026-04-03 14:13:28 -07:00
Eli Friedman
9471fabf8a
[clang] Fix issues with const/pure on varargs function. (#190252)
There are two related issues here. On the declaration/definition side,
we need to make sure the markings are conservative. Then on the caller
side, we need to make sure we don't access parameters that don't exist.

Fixes #187535.
2026-04-03 13:57:35 -07:00
SiliconA-Z
c061f33f66
[ARM] Add new test that will demonstrate the cmn node in the ARM backend (NFC) (#179282)
No code changes yet, but this is going to change once the cmn node lands
in the backend.
2026-04-03 13:57:00 -07:00
Jonas Devlieghere
0732841440
Revert "[lldb/test] Codesign executables built with custom Makefile rules" (#190398)
Reverts llvm/llvm-project#189902 because this seems to cause hangs.
2026-04-03 20:42:29 +00:00
Jonas Devlieghere
1bbcc5ea51
[lldb] Fix the macOS builld after address size was removed from Stream (#190399)
This fixes the macOS build after #190375.
2026-04-03 20:40:06 +00:00
lntue
c34c0442ee
[libc] Add str_to_* and rpc_* shared tests. (#190351)
Also fix several things for LIBC_TYPES_LONG_DOUBLE_IS_DOUBLE_DOUBLE to
make them build.
2026-04-03 16:34:23 -04:00
Paul Kirth
1deab59f6f
[clang-doc] Migrate Namespaces to arena allocation (#190048)
This patch allocates the NamespaceInfo types in the local arenas, and
adapts the merging logic for the new list type and its children.
Memory use and performance improve slightly. Micro-benchmarks show a
regression in merge operations due to the more complex list operations.

 ## Build Clang-Doc Documentation
| Metric | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| Time | 920.5s | 1009.2s | 1002.4s | +8.9% | -0.7% |
| Memory | 86.0G | 43.2G | 43.9G | -49.0% | +1.6% |

 ## Microbenchmarks (Filtered for >1% Delta)
| Benchmark | Baseline | Prev | This | Culm% | Seq% |
| :--- | :--- | :--- | :--- | :--- | :--- |
| BM_BitcodeReader_Scale/10 | 67.9us | 69.7us | 69.3us | +1.9% | -0.7% |
| BM_BitcodeReader_Scale/10000 | 70.5ms | 22.3ms | 24.8ms | -64.8% |
+11.4% |
| BM_BitcodeReader_Scale/4096 | 23.2ms | 4.7ms | 4.4ms | -80.9% | -5.7%
|
| BM_BitcodeReader_Scale/512 | 509.4us | 558.7us | 540.2us | +6.0% |
-3.3% |
| BM_BitcodeReader_Scale/64 | 114.8us | 119.2us | 117.0us | +1.9% |
-1.8% |
| BM_EmitInfoFunction | 1.6us | 1.6us | 1.6us | -1.1% | +0.8% |
| BM_Index_Insertion/10 | 2.3us | 4.2us | 3.7us | +61.7% | -11.3% |
| BM_Index_Insertion/10000 | 3.1ms | 5.4ms | 4.9ms | +56.8% | -9.1% |
| BM_Index_Insertion/4096 | 1.3ms | 2.2ms | 2.0ms | +54.5% | -8.2% |
| BM_Index_Insertion/512 | 153.6us | 259.6us | 236.7us | +54.1% | -8.8%
|
| BM_Index_Insertion/64 | 18.1us | 30.7us | 27.9us | +54.5% | -9.0% |
| BM_JSONGenerator_Scale/10 | 36.8us | 37.6us | 36.6us | -0.7% | -2.7% |
| BM_JSONGenerator_Scale/4096 | 33.7ms | 34.3ms | 34.2ms | +1.4% | -0.3%
|
| BM_JSONGenerator_Scale/64 | 222.4us | 225.6us | 220.2us | -1.0% |
-2.4% |
| BM_Mapper_Scale/10 | 2.5ms | 2.5ms | 2.5ms | -1.4% | -1.7% |
| BM_Mapper_Scale/10000 | 104.3ms | 109.3ms | 105.9ms | +1.6% | -3.1% |
| BM_Mapper_Scale/4096 | 44.3ms | 43.9ms | 44.7ms | +0.8% | +1.8% |
| BM_Mapper_Scale/512 | 7.6ms | 7.6ms | 7.6ms | +0.8% | +1.2% |
| BM_MergeInfos_Scale/10000 | 12.2ms | 1.6ms | 2.0ms | -83.6% | +28.7% |
| BM_MergeInfos_Scale/2 | 1.9us | 1.7us | 1.7us | -8.1% | +0.9% |
| BM_MergeInfos_Scale/4096 | 2.8ms | 520.5us | 557.4us | -79.9% | +7.1%
|
| BM_MergeInfos_Scale/512 | 68.9us | 37.9us | 39.9us | -42.0% | +5.3% |
| BM_MergeInfos_Scale/64 | 10.3us | 6.3us | 6.5us | -36.7% | +2.7% |
| BM_MergeInfos_Scale/8 | 2.8us | 2.2us | 2.2us | -20.7% | +1.2% |
| BM_SerializeFunctionInfo | 25.5us | 25.8us | 26.1us | +2.1% | +1.1% |
2026-04-03 20:33:56 +00:00
Brian Cain
98ced6cfd0
[BOLT] Template patchELFPHDRTable and rewriteNoteSections for ELF32 (#189715)
Template patchELFPHDRTable, rewriteNoteSections, markGnuRelroSections,
and discoverStorage to support both ELF32LE and ELF64LE binaries.
Previously these functions were hardcoded for ELF64LE, causing crashes
when processing 32-bit ELF binaries.

The RewriteInstance constructor now accepts ELF32LE objects in addition
to ELF64LE. The ELF_FUNCTION macro is reused (and moved earlier in the
header) to dispatch to the correct template instantiation.

These changes are preparation for adding support to hexagon architecture
in Bolt.
2026-04-03 15:16:31 -05:00
Joseph Huber
8a8434f22a
[OpenMP] Move alloc / free shared from TLI to alloc tags (#190365)
Summary:
Allocation kinds were added after these were introduced. We only needed
the TLI to identify these in the attributor so we can now just use
attributes. Update the usage in OpenMP and drop the TLI interface.

Fixes: https://github.com/llvm/llvm-project/issues/190072
2026-04-03 15:15:48 -05:00
Alexis Engelke
4a7213867a
[Analysis] No block map in MemoryDependenceAnalysis (#190367)
Avoid expensive hash map of block to value by using a vector. To avoid
allocating and clearing the entire vector per query, cache the
allocation and use an epoch to identify stale values from previous
queries.
2026-04-03 22:13:11 +02:00
Brian Cain
efdbf7b815
[Hexagon] Use trap0(#0xDB) for debugtrap instead of brkpt (#189446)
The brkpt instruction is intended for the in-silicon debugger (ISDB).
When ISDB is not enabled, brkpt is treated as a NOP, so
__builtin_debugtrap() would silently do nothing in user-mode Linux
processes.

Use trap0(#0xDB) instead.
2026-04-03 15:12:49 -05:00
Florian Hahn
6476619f30
[Matrix] Use matrix element type for TBAA nodes. (#190029)
Matrix loads and stores are accesses of their element types. Emit TBAA
nodes using their element type to allow more precise TBAA alias
analysis.

PR: https://github.com/llvm/llvm-project/pull/190029
2026-04-03 20:11:04 +00:00
Alexis Engelke
6c82b72db6
[SROA][NFC] Don't materialize name when discarding names (#190368)
SetValuePrefix has to materialize the prefix into a std::string, which
is non-free and pointless when value names are discarded.
2026-04-03 22:00:44 +02:00
Alexey Karyakin
6f464d1b3a
[Hexagon] Clean up library and include paths and fix --sysroot (#188824)
Unify include and library paths by reusing common code to compute path
prefixes. First, determine the effective sysroot by choosing a
user-provided sysroot, "../target/<triple>", or "../target/hexagon",
in the order of precedence. Based on the sysroot, derive the standard
include path, C++ include path, and base library path.

Fix the default -L library paths so they are taken from the external
sysroot, when one specified. Previously, these paths were always
relative to the install directory and sysroot was ignored.

Remove certain locations from considerations, as there are never used
for the corresponding purpose in existing sysroots:
- fallback to install path, typically "../target/bin", as the base path
  when other sysroot cannot be found;
- similarly, fallback to "../target/" for startup files;
- "../target/bin" for program paths as there are no program files in
  current sysroots.

Other minor changes:
- use windows-correct path delimiting;
- enable hexagon-toolchain-linux.c test for windows hosts.
2026-04-03 14:44:19 -05:00
Daniil Dudkin
418ae6c600
[include-cleaner][NFC] expose and test normalizePath helper (#189364)
Also fix a bug where the root `/` path would become an empty string.
2026-04-03 19:34:07 +00:00
Arthur Eubanks
88f6b181b6
[gn build] Port commits (#190392)
0cecacd971a5
2cff995e91c3
34ec1870ae46
54e5803d0231
64b728128df3
76ed0ad3577e
d95292f67b48
2026-04-03 12:29:38 -07:00
vporpo
94545a7c63
[SandboxVec][Legality][NFC] Outline differentBlock() and areUnique() (#190024)
And reuse them in LoadStoreVec.
2026-04-03 12:14:55 -07:00
Amr Hesham
a4632f6294
[Clang][Sema] Prevent implicit casting Complex type to Vector (#187954)
Emitting an error message in case of implicit casting of a complex type
to a built-in vector type in C

Fixes: #186805
2026-04-03 21:10:58 +02:00
Tom Tromey
8d34545792
Introduce and use Verifier::visitDIType (#189067)
This adds a new method Verifier::visitDIType, and then changes method
for subclasses of DIType to call it. The new method just dispatches to
DIScope and adds a file/line check inspired by
Verifier::visitDISubprogram.
2026-04-03 12:40:37 -06:00
Wei Wang
f33e9faa5d
[SampleProfile] Fix FuncMappings key mismatch for renamed functions in stale profile matching (#187899)
Fix a bug where `distributeIRToProfileLocationMap` fails to find
location mappings from IR to profile for renamed functions because
`FuncMappings` is indexed by the IR function name while
`distributeIRToProfileLocationMap` looks up by the profile function
name. Fixed by making `FuncMappings` to use profile function name as
key.
2026-04-03 11:38:51 -07:00
Sergei Barannikov
85fb6ba2b7
[lldb][Utility] Remove address size from Stream class (NFC) (#190375)
It violates abstraction. Luckily, it was used only in two places, see
DumpDataExtractor.cpp and CommandObjectMemory.cpp.
2026-04-03 21:36:52 +03:00
Paul Kirth
4ad1844304
[clang-doc] Refactor FriendInfo parameters to use ArrayRef (#190047)
This also adapts readBlock for the new layouts.
2026-04-03 11:26:12 -07:00
Jonas Devlieghere
b8ea714224
[lldb] Fix formatting in ModuleList (NFC) (#190382)
I had auto-merge enabled in #189444 and since the formatter is
non-blocking it got merged despite the issue. Given I'm already here, I
just formatted the whole file.
2026-04-03 18:24:50 +00:00
Kewen Meng
f29d23844c
[Buildbot][AMDGPU] Adapt to recent CMake change (#190381)
Make changes to adapt to
https://github.com/llvm/llvm-project/pull/190349
2026-04-03 18:15:44 +00:00
Björn Svensson
6111520043
[clang-tidy] Fix readability-identifier-naming for C++17 structured bindings (#189500)
`BindingDecl` nodes, i.e. the individual names in a structured binding,
were not handled in `IdentifierNamingCheck::findStyleKind()`, causing
them to fall through to the Default style or be silently ignored.
This led to incorrect renames, e.g. applying member variable conventions
to local bindings.

---------

Signed-off-by: Björn Svensson <bjorn.a.svensson@est.tech>
2026-04-03 21:11:18 +03:00
Simon Pilgrim
6832709dc0
[DAG] SDPatternMatch - rename m_Opc -> m_SpecificOpc (#190215)
Match naming convention for other m_Specific* matchers, and frees up the
m_Opc() matcher for future use in #84940 to allow us to capture the
opcode of a unknown binop

Moving to m_SpecificOpc does mess up the formatting in a few places,
I've tried to refactor to use the m_Value(SDValue, ....) matcher where I
can to retrieve some whitespace
2026-04-03 18:03:00 +00:00
Andy Kaylor
68b6a27771
[CIR] Use destination type when emitting constant function ptrs (#189741)
This updates the CIR constant emitter to use the correct destination
type when emitting a constant initializer for a structure that might be
initialized with non-prototyped function pointers. We were previously
using the type from whatever function declaration we had, but this may
not be the correct type.

This change also updates the `replaceUsesOfNonProtoTypeWithRealFunction`
to ignore global initializer uses, which do not need to be updated after
this change.
2026-04-03 10:58:46 -07:00
Md Abdullah Shahneous Bari
ffd29734cc
[mlir][gpu] Extend mgpumoduleLoadJIT API to add assemblySize parameter (#189429)
When JITing SPIR-V using LevelZero API, it expects the length of the
string since passed input data is a `void *`. Problem is, getting the
length of the string is not possible using something like
`strlen(reinterpret_cast<char *>(data))` in `mgpuModuleLoadJIT`
implementation. Becasuse the SPIR-V binary contains null bytes (i.e.,
the data is binary SPIR-V, not null-terminated text).

As a result we need to pass the `assmeblySize` via the
`mgpuModuleLoadJIT(void* data, int optLevel, size_t assmeblySize)`.
2026-04-03 12:45:40 -05:00
Henrich Lauko
f26b30ea35
[CIR] Auto-generate matchAndRewrite for one-to-one CIR-to-LLVM lowerings (#190326)
When a CIR op specifies a non-empty `llvmOp` field, the lowering
emitter now generates the `matchAndRewrite` body that converts the
result type and forwards all operands to the corresponding LLVM op.
This removes 27 boilerplate lowering patterns from LowerToLLVM.cpp.

Ops needing custom logic (FMaxNumOp/FMinNumOp for FastmathFlags::nsz)
override `llvmOp = ""` to retain hand-written implementations.

Also fixes llvmOp names (TruncOp -> FTruncOp, FloorOp -> FFloorOp)
and adds a diagnostic rejecting conflicting llvmOp + custom constructor.
2026-04-03 19:29:03 +02:00
Amr Hesham
2108252f0e
[clang] Fixed a crash when explicitly casting to atomic complex (#172163)
Fixed a crash when explicitly casting a scalar to an atomic complex.

resolve: #114885
2026-04-03 19:28:20 +02:00
Valeriy Savchenko
853ea940ae
[InstCombine][NFC] Expose isKnownExactCastIntToFP as a public method (#190327) 2026-04-03 18:15:49 +01:00
Henrich Lauko
dec90ffbc9
[CIR] Fix record layout for [[no_unique_address]] fields (#186701)
Fix two bugs in CIR's handling of `[[no_unique_address]]` fields:

- Record layout: Use the base subobject type (without tail padding)
instead of the complete object type for [[no_unique_address]] fields,
allowing subsequent fields to overlap with tail padding.
- Field access: Insert bitcasts from the base subobject pointer to the
complete object pointer after cir.get_member for potentially-overlapping
fields, so downstream code sees the expected type.
- Zero-sized fields: Handle truly empty [[no_unique_address]] fields by
computing their address via byte offsets rather than cir.get_member,
since they have no entry in the record layout.

A known gap (CIR copies 8 bytes where OG copies 5 via
`ConstructorMemcpyizer`) is noted for follow-up.
2026-04-03 19:07:25 +02:00