575358 Commits

Author SHA1 Message Date
Joseph Huber
b2d3a6574c
[libc] Rename rpc::Status to rpc::RPCStatus to reduce conflicts (#190239)
Summary:
`Status` is unfortunately heavily overloaded in practice. Things like
X11 define it as a macro. Best to just remove that possibility entirely.
2026-04-02 14:55:57 -05:00
xys-syx
1474e3e4f4
[MLIR][NVVM] Derive NVVM_SyncWarpOp from NVVM_IntrOp for import support (#188415)
Change `NVVM_SyncWarpOp` base class from `NVVM_Op` to
`NVVM_IntrOp<"bar.warp.sync">`, which auto-generates `llvmEnumName =
nvvm_bar_warp_sync` and registers it with
`-gen-intr-from-llvmir-conversions` and
`-gen-convertible-llvmir-intrinsics`. This enables LLVM IR to MLIR
import. The hand-written `llvmBuilder` is removed as the default
`LLVM_IntrOpBase` builder is equivalent.
2026-04-02 15:41:50 -04:00
Matt Arsenault
a68ae7b0cc
DiagnosticInfo: Use Twine for resource name (#190228)
Allow more flexibility in phrasing of the overallocated
resource.
2026-04-02 21:41:38 +02:00
Rahul Joshi
43a8b7de88
[NFC][LLVM] Rename several ArgsTys arguments to OverloadTys. (#190210)
Rename several arguments to intrinsic related functions from `ArgsTys`
to `OverloadTys` to better reflect their meaning. The only variables
left with name `ArgTys` now actually mean function argument types.

Also reamove an incorrect comment in Intrinsics.td. Dependent types do
allow forward references starting with
7957fc6547
2026-04-02 12:36:28 -07:00
Matt Arsenault
2ec19b86b5
ValueTracking: x - floor(x) cannot introduce overflow (#189003)
This returns a value with an absolute value less than 1 so it
should be possible to propagate no-infs.
2026-04-02 19:26:22 +00:00
Ehsan Amiri
0abef30c80
[DA] Fix warning introduced by #189740 (#190226)
The following warning is issued for llvm/lib/Analysis/DependenceAnalysis.cpp:2004

warning: suggest parentheses around ‘&&’ within ‘||’
2026-04-02 15:15:25 -04:00
Craig Topper
e2e5db8401
[TargetLowering] Speculative fix for a non-determinism issue between different compilers. (#190219)
The evaluation order of function arguments is unspecified by the C++
standard. We had two getNode calls as function arguments which causes
the nodes to be created in a different order depending on the compiler
used. This patch moves them to their own variables to ensure they are
called in the same order on all compilers.

Possible fix for #190148.
2026-04-02 12:12:28 -07:00
Prabhu Rajasekaran
e97a42d5f9
[Driver] UEFI -mno-incremental-linker-compatible (#188800)
The `-mno-incremental-linker-compatible` switch translates to Brepro
linker flag and must be passed on to the underlying linker to match the
behavior of the Windows triples that produce PE COFF.
2026-04-02 19:11:28 +00:00
Bangtian Liu
86b5f11ecc
[mlir][GPU] Add constant address space to GPU dialect (#190211)
This PR adds a `constant` address space to the` GPU dialect and
lowerings to all GPU backends.

Signed-off-by: Bangtian Liu <liubangtian@gmail.com>
2026-04-02 15:02:12 -04:00
Dominik Montada
f7b6cc1efa
[llvm-reduce] Set the target triple before parsing machine functions (#189989)
Make sure that the module has a target triple set before trying to parse
machine functions. This can be required for (downstream) targets if MIR
parsing relies on features guarded by the target triple.
2026-04-02 20:55:45 +02:00
Amr Hesham
fdc54c9a1e
[CIR][NFC] Use RelativeCXXABIVTables after isRelativeLayout is removed (#190229)
Update the ClangIR side after changes related to removing
isRelativeLayout and using RelativeCXXABIVTables directly from #139315
2026-04-02 18:48:19 +00:00
Tamir Duberstein
4642a6183d
[CMake] Extract Mach-O version helper (#190225)
Use CMake's native MACHO_COMPATIBILITY_VERSION and MACHO_CURRENT_VERSION
properties rather than manually pass linker flags. These properties are
available since CMake 3.17.0, released in 2020.
2026-04-02 18:48:01 +00:00
Tamir Duberstein
533d0ac216
[CMake] Group SOVERSION logic (#190224)
There are two blocks whose conditions are coupled; combine them to make
the conditional logic less error prone.
2026-04-02 18:36:59 +00:00
Steven Perron
6331bfa41a
[HLSL] Add GetDimensions to Texture2D. (#189991)
This commit add the GetDimensions methods to Texture2D. For DXIL, it
requires intrinsics that are not yet available. They are added, but not
implemented.

Assisted-by: Gemini

Co-authored-by: Helena Kotas <hekotas@microsoft.com>
2026-04-02 18:26:02 +00:00
Alex Langford
e0e439ce9f
[lldb] Remove libc++ category from TestNavigateHiddenFrame.py (#190016)
This test technically does not require libc++. The test binary mimics
libc++'s namespace layout to trigger some frame hiding logic in lldb,
but it does not require libc++ to function.
2026-04-02 11:12:47 -07:00
Alex Langford
343210656c
[lldb] Standardize TestVectorOfEnums.py as a C++ data formatter test (#189757)
This is explicitly marked as a libc++ test and functionally tests the
formatter for a vector of enums. I put it in the generic directory
because there's no reason this couldn't work for other c++ stdlibs.

Additionally, this should be using the custom libc++ like the other
tests.
2026-04-02 11:12:00 -07:00
Ramkumar Ramachandra
d0e265f20d
[VPlan] Cleanup and generalize VPIRMetadata CastInfo (NFC) (#190162)
Similar to b0230f59 ([VPlan] Cleanup and generalize VPPhiAccessors
CastInfo, #190027).
2026-04-02 19:00:23 +01:00
Karthik Senthil
e6bb6d906a
[NVPTX][AsmPrinter] Demonstrate usage of NVPTXTargetAsmStreamer in NVPTXAsmPrinter. (#188539)
Currently NVPTXAsmPrinter uses intermediate strings to generate ASM and
emit directly to output streamer as raw text. This PR demonstrates how
the printer can be updated to use NVPTXTargetAsmStreamer instead,
thereby getting rid of the intermediate strings. This is shown only for
the PTX header and module level directives.
2026-04-02 10:56:55 -07:00
Justin Stitt
43233b8aae
[Clang] Add missing __ob_trap check for sign change (#188340)
Add a missing OBTrapInvolved check before EmitIntegerSignChangeCheck().

This is considered "missing" as a previous attempt (https://github.com/llvm/llvm-project/pull/185772) to properly add an `__ob_trap` backdoor missed this particular instance.

This backdoor is needed because we want `__ob_trap` types to be picky about implicit conversions (including implicit sign change):

```c
	unsigned int __ob_trap big = 4294967295;
	(signed int)big; // should trap!
```

Move the `OBTrapInvolved` setup to the top of the function so it can be used in all the places we need it.
2026-04-02 10:51:46 -07:00
Florian Hahn
8e61085291
[Matrix] Place allocas in function entry. (#190032)
Create allocas for temporary matrixes in the function entry. Limit the
lifetime via lifetime.start & lifetime.end. This avoids dynamic allocas.

Improvement suggested in
https://github.com/llvm/llvm-project/pull/188721.

PR: https://github.com/llvm/llvm-project/pull/190032
2026-04-02 17:36:13 +00:00
PiJoules
bd9e0e8fcf
[clang] Consolidate the relative vtable layout getters (#139315)
We have 3 different getters to get the vtable component type. This
consolidates them into just the one in LangOpts.
2026-04-02 10:33:05 -07:00
Anshul Nigham
2fc712d8d9
[NewPM] Adds a port for AArch64O0PreLegalizerCombiner (#189776)
Adds a standard porting for AArch64O0PreLegalizerCombiner.

Note:

- Moves the AArch64GenO0PreLegalizeGICombiner.inc import outside of
anonymous namespace to use it as a member in the NewPM class (which
needs to be declared in AArch64.h)
- Test update needed a requires directive for the libcall-lowering-info
dependency

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
2026-04-02 10:29:29 -07:00
David Rivera
598029333d
[CIR][NVPTX] NVPTX lowering info skeleton, PTX AS mapping and Poison attr lowering (#186562) 2026-04-02 13:25:46 -04:00
Zahira Ammarguellat
d8bfd7c63a
[OpenMP] Fix iteration count for nested triangular OpenMP loops (#190153)
This patch restricts the triangular loop iteration count optimization to
only apply to nested triangular loops (`depth >= 2`), not first-level
triangular loops.
The optimization computes iterations as `(Upper - Lower + 1`) for
triangular loops where the inner loop bound depends on an outer loop
counter. However, this formula only works correctly for deeply nested
triangular dependencies: `k` depends on `j`, and `j` itself depends on
`i` For first-level triangular loops: `k` depends directly on `i`, the
standard iteration count formula handles the calculation correctly.
2026-04-02 13:24:00 -04:00
Steven Perron
5124dd2536
[SPIRV] Add get dimension intrinsics. (#189746)
Add the intrinsics in the wg-hlsl proposal
[[0033] - GetDimensions mapping to built-ins functions and LLVM
intrinsics](https://github.com/llvm/wg-hlsl/blob/main/proposals/0033-resources-get-dimensions.md#lowering-to-spir-v) to the SPIR-V backend. This enabled us to implement the GetDimensions
methods in textures in Clang.

Assisted-by: Gemini
2026-04-02 13:14:34 -04:00
vporpo
a9158af0a3
[AMDGPU][SIInsertWaitcnt][NFC] Replace LastFlat array with distinct variables (#185993)
We only seem to be using LastFlat[LOAD_CNT] and LastFlat[DS_CNT] so it
doesn't look like there is a good reason for using an array. Also, we
seem to be operating on all elements of the array while merging, which
is not great.
2026-04-02 09:49:56 -07:00
Craig Topper
24146ce5cf
[TargetLowering] Remove INT_MIN special case from prepareSREMEqFold. (#188653)
If the divisor is INT_MIN, we can still treat it like any other power of
2. We'll fold i32 (seteq (srem X, INT_MIN)) to
(setule (rotr (add (mul X, 1), INT_MIN), 31), 1). Alive2 says this is
correct https://alive2.llvm.org/ce/z/vjzqKk.

The multiply is a NOP, the add toggles the sign bits. The rotate puts
the lowest 31 bits of into the upper 31 bits. The sign bit is now in the
LSB. The compare checks if the upper 31 bits are 0.

srem X, INT_MIN has a remainder of 0 if X is 0 or INT_MIN which is
equivalent to checking if the uppper 31 bits are 0 after the rotate.

I don't think we need to add any constant for power of 2 but toggling
the sign bit like we do now doesn't hurt.
2026-04-02 09:45:47 -07:00
Simon Pilgrim
8991ce9cff
[AMDGPU] Add basic clmul test coverage (#190205) 2026-04-02 16:41:34 +00:00
Tony Guillot
42b6a6faaa
[Clang] Fixed the behavior of C23 auto when an array type was specified for a char * (#189722)
At the time of the implementation of
[N3007](https://www.open-std.org/jtc1/sc22/wg14/www/docs/n3007.htm) in
Clang, when an array type was specified, an error was emitted unless the
deduced type was a `char *`.
After further inspection in the C standard, it turns out that the
inferred type of an `char[]` should be deduced to a `char *`, which
should emit an error if an array type is specified with `auto`.

This now invalidates the following cases:
```c
auto s1[] = "test";
auto s2[4] = "test";
auto s3[5] = "test";
```

Fixes #162694
2026-04-02 18:40:21 +02:00
Graham Hunter
deaef1c1b7
[LV] Adjust exit recipe detection to run on early vplan (#183318)
Splitting out some work from #178454; this covers the enums for
early exit loop type (none, readonly, readwrite) and the style
used (readonly with multiple exit blocks, or masking with the
last iteration done in scalar code), along with changing the early
exit recipe detection to suit moving the transform for handling
early exit readwrite loops earlier in the vplan pipeline.
2026-04-02 17:25:35 +01:00
Timm Baeder
ef409e649c
[clang][bytecode] Add an assertion in initScope() op (#189972)
I've run into a problem in a branch lately that would've benefitted from
this assertion.
2026-04-02 17:49:46 +02:00
Chinmay Deshpande
5ecc7e1e57
[AMDGPU][NFC] Update gating target feature for SWMMAC instructions (#190012) 2026-04-02 08:39:59 -07:00
Florian Hahn
97dbf38c9c
[SCEVExpander] Add SCEVUseVisitor and use it in SCEVExpander (NFC) (#188863)
Add SCEVUseVisitor, a new visitor class where all visit methods receive
a SCEVUse instead of a const SCEV*. Use it for SCEVExpander, so it can
use use-specific flags in the future.

PR: https://github.com/llvm/llvm-project/pull/188863
2026-04-02 15:08:01 +00:00
Kartik Ohlan
87104ee514
[Clang] [Sema] Diagnose returning an initializer list from a lambda with a return type of void (#188904)
We previously didn’t diagnose attempts to return an initializer list from
a lambda with an explicit return type of `void`. This patch fixes that. It also 
cleans up the error message so it actually says "lambda" instead of "block".

Fixes #188661

Signed off by: Kartik
2026-04-02 14:55:54 +00:00
Ramkumar Ramachandra
bb2a63a673
[VPlan] Use m_Isa to improve code (NFC) (#190149) 2026-04-02 15:53:05 +01:00
zGoldthorpe
e9a62c7698
[DAG] computeKnownFPClass: handle ISD::FABS (#190069)
Use `KnownFPClass::fabs` to handle `ISD::FABS`.

This case will help with updating #188356 to use `computeKnownFPClass`.
2026-04-02 14:48:54 +00:00
Trung Nguyen
9dc1da6e87
[clang] Add support for MSVC force inline attrs (#185282)
Add support for `[[msvc::forceinline]]` and
`[[msvc::forceinline_calls]]`.

`[[msvc::forceinline]]` is equivalent to Microsoft's `__forceinline`
when placed before a function declaration.
Unlike `__forceinline`, `[[msvc::forceinline]]` works with lambdas.

`[[msvc::forceinline_calls]]` is simliar to `[[clang::always_inline]]`
but only works on statements.

Both are implemented as aliases of `[[clang::always_inline]]` with
special checks.

Fixes #186539.
2026-04-02 16:42:26 +02:00
Aditya Medhane
c1fd7d7a1f
[APINotes][BoundsSafety] Upstream API notes format for bounds-safety function parameters
Related: #183340
Upstream from swiftlang/llvm-project@721e6a3 with some modifications.

Since __counted_by and related attributes aren't supported upstream yet
in function signatures, this only upstreams the format part — YAML
parsing, binary serialization, and deserialization. Semantic application
is a follow-up.

Modifications from downstream:
- Renamed local YAML struct from `BoundsSafety` to `BoundsSafetyNotes`
to avoid name collision with `Param::BoundsSafety` field (downstream
fixed this in a subsequent commit)
- `Level` in `BoundsSafetyNotes` is now `std::optional<unsigned>` so we
can actually tell apart "user didn't write Level:" from "Level: 0"
- `asdf_sized` and `asdf_sized_n` use `void *buf` — makes more sense for
sized_by
- Added `asdf_counted_indirect` with `int **` and `Level: 1` to test the
indirection level path
- Removed a vacuous assert (`CountedBy == 0`, always true for unsigned)
- Added `operator!=` for `BoundsSafetyInfo` to match other types in
`Types.h`
- Added doc comments for `LevelAudited` and `Level`
2026-04-02 15:10:48 +01:00
Leandro Lupori
d59356aac5
Revert "Reland "[flang][OpenMP] Fix lowering of LINEAR iteration variables (#183794)"" (#190180)
Reverts llvm/llvm-project#188851
2026-04-02 11:09:30 -03:00
Charles Zablit
29c083a61f
[lldb][windows] simplify the ConPTY draining subprocess (#190178)
In some environments like swiftlang, the `''` causes the command used to
drain the init sequence of the ConPTY to fail. Replacing with a `cls`
invocation removes the need for quotation marks and works just as well.
2026-04-02 15:08:52 +01:00
Petar Avramovic
5226289b8e
Revert "AMDGPU: Codegen for v_dual_dot2acc_f32_f16/bf16 from VOP3" (#190159)
This reverts commit 47f6a19181b426baa03182ab6a7a41e16b35301d.
Breaks MIOpen, don't have propper fix yet.
2026-04-02 14:05:08 +00:00
Ryotaro Kasuga
75359e1e1f
[DA] Add static to analyzeCoefficientsForGCD (NFC) (#190172) 2026-04-02 14:04:31 +00:00
Simon Pilgrim
91b3b67a9e
[X86] known-pow2.ll - adjust pow2_trunc_vec to show failure to pass through demanded elts mask to determine pow2orzero mask (#190170) 2026-04-02 14:04:09 +00:00
lntue
3d359887c4
[libc] Add powerpc64le to libc-shared-tests precommit CI. (#190096) 2026-04-02 09:58:26 -04:00
Mehdi Amini
a36f821e77
[mlir][linalg] Add test for ReduceOp empty-input verifier; remove dead empty-output check (#189614)
Add a FileCheck test covering the 'expected at least one input' error in
ReduceOp::verify(). The companion 'expected at least one output' check
was dead code: SameVariadicOperandSize fires first whenever
inputs.size() \!= inits.size(), and when both are empty the input check
fires first; remove the unreachable branch.

Assisted-by: Claude Code
2026-04-02 15:57:53 +02:00
Jean-Didier PAILLEUX
0625467c63
[Flang] Fix lowering failure for some constructs inside a CHANGE TEAM (#184342)
This PR is here to fix the `CHANGE_TEAM` construct if it contains an
IF/ELSE (construct with a body too) in its body, for example.
2026-04-02 15:54:13 +02:00
Dhruv Chauhan
b87be02cc7
Revert "[mlir][tensor] Forward concat insert_slice destination into DPS provider" (#190143)
This reverts commit 1418f80.

The change can cause an infinite rewrite loop when
ForwardConcatInsertSliceDest interacts with
FoldEmptyTensorWithExtractSliceOp.
2026-04-02 14:48:44 +01:00
Alexey Bataev
c2f97c5917
[SLP] Do not skip tiny trees with gathered loads to vectorize
The isTreeTinyAndNotFullyVectorizable check for 2-node trees
(insertelement root + gather child) was too aggressive: it rejected
trees even when LoadEntriesToVectorize was non-empty, preventing
gathered loads from being vectorized into masked loads/strided loads, etc.

Reviewers: hiraditya, RKSimon

Pull Request: https://github.com/llvm/llvm-project/pull/190181
2026-04-02 09:47:01 -04:00
Charles Zablit
aff601aed8
[lldb][windows] fix duplicate OnLoadModule events (#189376) 2026-04-02 14:46:00 +01:00
Stefan Gränitz
60efb5c0a3
[llvm] Fix SupportHTTP linkage with libLLVM in unit-tests (#190097)
Since libSupportHTTP is part of the LLVM dylib, we must link it as a
component now. Fixes https://github.com/llvm/llvm-project/issues/189978
2026-04-02 15:37:08 +02:00