575643 Commits

Author SHA1 Message Date
Alexey Bataev
eaf0135b77
[SLP][NFC]Fix run line for the test, fix test name, NFC
Reviewers: 

Pull Request: https://github.com/llvm/llvm-project/pull/190537
2026-04-05 12:20:43 -04:00
Devajith
ba286040c9
[clang-repl] Use canonical types in QualTypeToString (#190528)
Use the canonical type when generating type strings to ensure sugared
(e.g. `AutoType`, `DecltypeType`) are resolved before calling
getFullyQualifiedType.

This will revert a few commits that were added to fix these assertions.

---------

Co-authored-by: Harald van Dijk <hdijk@accesssoftek.com>
2026-04-05 18:09:39 +02:00
Zeyi Xu
0b7f01ad51
[clang-tidy] Add frames for bugprone-exception-escape options (#187971)
This patch adds frames emitting for
`bugprone-exception-escape.TreatFunctionsWithoutSpecificationAsThrowing`.

As of AI Usage: Gemini 3 is used for pre-commit reviewing.

Closes https://github.com/llvm/llvm-project/issues/184781
2026-04-05 22:07:20 +08:00
Joseph Huber
9b5c7d1f91
[libc] Allow RPC interface to be compiled with MSVC (#190483)
Summary:
This should be portable to other compilers so it can support Windows
infrastructure.

I don't really use MSVC but godbolt seems happy:
https://godbolt.org/z/Ysdx1Y1rq
2026-04-05 09:05:55 -05:00
Matt Arsenault
144c324380
clang: Make --cuda-gpu-arch translation test comprehensive for AMDGPU (#190509) 2026-04-05 15:00:54 +02:00
Hristo Hristov
792fce7cc3
[libc++][ranges][NFC] Format a couple of tests as a prerequisite (#190514)
to https://llvm.org/PR190513 to avoid friction.
2026-04-05 15:20:58 +03:00
Hassnaa Hamdi
c5a904946a
[LV][NFC] remove dead code in canFoldTailByMasking() (#190263)
Remove unused ReductionLiveOuts variable in `canFoldTailByMasking()`.
The set was being populated with reduction loop exit instructions but
was never actually used anywhere in the function.
2026-04-05 12:59:32 +01:00
Hassnaa Hamdi
6bf8279dc2
[LV][NFC] correct comment for isScalarEpilogueAllowed() (#190254)
The comment had the opposite meaning of what the function actually does.
2026-04-05 12:55:36 +01:00
serge-sans-paille
df2de0a26d
[clang-tidy] Improve bugprone.use-after-move interaction with explicit destructor call. (#188866)
It is valid (although niche) to call an explicit destructor after moving
the object.
2026-04-05 10:06:46 +00:00
Sergei Barannikov
199ac48f73
[lldb] Replace ResolveValue() with GetScalar() in DWARFExpression (NFCI) (#185841)
Value::ResolveValue() only does something if the value has an associated
compiler type, which is never set on values used in DWARF expressions.
Simplify code by inlining the method.
2026-04-05 08:11:10 +00:00
Jasmine Tang
e3e4b8481d
[WebAssembly] Add support for shared tags (#188367)
Mostly following the structure of other Shared* constructs

Fixes: #188120
2026-04-05 05:53:20 +00:00
Henrich Lauko
942e1082ac
[CIR] Convert global_visibility from attribute to property (#190488)
Replace CIR_VisibilityAttr with
DefaultValuedProp<EnumProp<CIR_VisibilityKind>>
for global_visibility on GlobalOp and FuncOp. This removes the need for
custom
parse/print functions and simplifies callers to use direct enum values
instead
of wrapping/unwrapping VisibilityAttr.
2026-04-05 07:35:53 +02:00
lonely eagle
d08bb68080
[mlir][reducer] Add opt-pass-file option to opt-reduction pass (#189353)
Currently, the opt-reduction-pass only supports inputting the
optimization pipeline via the command line, which becomes cumbersome
when the pipeline is long. To address this, this PR introduces the
opt-pass-file option. This allows users to save the pipeline in a file
and provide the filename to parse the pipeline.
2026-04-05 12:55:21 +08:00
Timm Baeder
66483dfe34
[clang][AST][NFC] Add default value to Expr::isConstantInitializer() parameter (#190313)
Almost every caller passes `false` for `ForRef`, or rather, doesn't care
what the value is. Use a default value instead.
2026-04-05 06:54:06 +02:00
Younan Zhang
257cc5ad89
[Clang] Fix concept cache for normalized fold expressions (#190312)
When both outer and inner pack substitution indexes are present, we
should cache both. Otherwise we will have wrong cached result.

This is a regression fix so no release note.

Fixes https://github.com/llvm/llvm-project/issues/190169
2026-04-05 10:36:50 +08:00
Kevin Sala Penades
00d5f660f4
[offload][CUDA] Fix DLWRAP for memory routines (#190500) 2026-04-04 19:29:25 -07:00
Serosh
17ed1e6c4b
[clang] diagnose block pointer types as invalid for constant template parameters (#190464)
Fixes a crash by making it ill-formed to have a constant template
parameter with a block pointer type.

Fixes #189247
2026-04-04 22:24:19 -03:00
Matheus Izvekov
7fd02b32f9
[clang] NFC: Add test case for #178324 and mark it as fixed (#190490)
Issue #178324 was actually fixed by #187755

We lost the "declaration does not declare anything" warning since the
regression was introduced, but that was because:
1) Since #78436 we treat __builtin_FUNCSIG in a dependent context
effectivelly as if it contained a template parameter.
2) Our decltype implementation treats eexpressions containing template
parameters as if they were completely opaque (but alas this goes against
the spec, which says in [temp.type]p4 this should be looking only at
type dependence).
3) Since the decltype is opaque, we don't know what lookup will find, so
we can't issue the warning because we don't know if we are going to end
up with a type or an expression.

Fixes #178324
2026-04-04 19:10:29 -03:00
Maarten Steevens
d400080063
[lldb] Inherit Host::GetEnvironment() when launching a wasm runtime (#190476)
Some WebAssembly runtimes might use environment variables such as `HOME`
or `XDG_CONFIG_HOME` to store configuration files, additionally some VMs
might allow wasm modules to read environment variables from the host.
Currently, if a runtime is launched using the WebAssembly platform it
doesn't inherit the environment. As a result wasm runtimes and modules
are unable to read from environment variables and might even fail to
launch (if the config file is required). This PR aims to resolve this
issue, I have tested this with the WARDuino runtime and my WIP gdbstub.
2026-04-04 21:18:09 +00:00
Henry Jiang
0996887138
[dsymutil] Add REQUIRES: host-byteorder-little-endian to pseudo-probe test (#190482) 2026-04-04 14:02:17 -07:00
Michael Kruse
f959327bc8
[Polly][NFC] Convert ScopBuilder::buildUnsignedConditionSets() to isl++ (#190487) 2026-04-04 21:01:20 +00:00
Alexis Engelke
b5e7dbb30a
[IR] Use iteration limit in stripPointerCastsAndOffsets (#190472)
Using a SmallPtrSet is not quite free for such a frequently called
operation. However, calls on ill-formed IR are not particularly rare, so
some iteration limit is needed. Therefore, use a simple counter.

Termination statistics on a Clang Release build for N>5:

   2448 N=6
   1295 N=7
    480 N=8
    294 N=9
    160 N=10
  14350 (endless loop)

Therefore, bound the number of iterations by 12, which should cover most
practically relevant cases.

It is worth noting that _all_ of the endless loop cases have the
following form:

  %incdec.ptr = getelementptr inbounds nuw i8, ptr %incdec.ptr, i64 <N>

I haven't investigated where exactly this comes from, though; but it
occurred frequent enough to add a special case for this.
2026-04-04 20:13:21 +02:00
Jonas Devlieghere
ba3dbbfff3
[lldb] Remove Log::Error and Log::Warning (NFC) (#190440) 2026-04-04 10:41:11 -07:00
Felipe de Azevedo Piovezan
27a762c1a3
[lldb][NFC] Add helper function for computing whether to show Process error (#190189) 2026-04-04 18:39:41 +01:00
Ivan R. Ivanov
420111e9e4
[mlir][LLVM] Fix incorrect verification of atomicrmw f{min,max}imumnum (#190474)
Fix llvm.atomicrmw fminimumnum and fmaximumnum to correctly take the
float operation verification path.
2026-04-04 17:17:37 +00:00
Florian Hahn
ff4c6fe24e
[SCEV] Move NoWrapFlags definition outside SCEV scope, use for SCEVUse. (#190199)
The patch moves out of SCEV's scope so they can be re-used for SCEVUse.
SCEVUse gets an additional getNoWrapFlags helper that returns the union
of the expressions SCEV flags and the use-specific flags.

SCEVExpander has been updated to use this new helper.

In order to avoid other changes, the original names are exposed via
constexpr in SCEV. Not sure if there's a nicer way. One alternative
would be to define the enum in struct, and have SCEV inherit from it.

The patch also clarifies that the SCEVUse flags encode NUW/NSW, and
hides getInt, setInt, etc to avoid potential mis-use.

PR: https://github.com/llvm/llvm-project/pull/190199
2026-04-04 15:03:36 +00:00
Elvis Wang
47cd798670
Revert "[LV] Enable scalable FindLast on RISCV." (#190463)
Reverts llvm/llvm-project#184931 since it crash llvm-test-suite.
https://lab.llvm.org/buildbot/#/builders/210/builds/9807
2026-04-04 23:03:11 +08:00
Kartik Ohlan
7c60d08056
[DAG] computeKnownFPClass - add ISD::SPLAT_VECTOR handling (#189780)
Fixes #189481

Implement ISD::SPLAT_VECTOR in SelectionDAG::computeKnownFPClass to
correctly propagate floating-point properties from scalar operands to
vectors.

Added AArch64 and RISC-V test coverage
2026-04-04 14:54:12 +00:00
Jinsong Ji
ee405335f0
DiagnosticInfo: Fix stack-use-after-scope in DiagnosticInfoStackSize (#190442)
The string literal "stack frame size" passed to the base class
constructor created a temporary Twine that was destroyed after
the base constructor completed, leaving a dangling reference.

Fix by storing the Twine as a member variable in the derived class,
ensuring it lives as long as the diagnostic object itself.

Fixes ASAN stack-use-after-scope error in
  Clang :: Misc/backend-stack-frame-diagnostics-fallback.cpp
  LLVM :: CodeGen/X86/2007-04-24-Huge-Stack.ll
  LLVM :: CodeGen/X86/huge-stack-offset.ll
  LLVM :: CodeGen/X86/huge-stack-offset2.ll
  LLVM :: CodeGen/X86/huge-stack.ll
  LLVM :: CodeGen/X86/large-displacements.ll
  LLVM :: CodeGen/X86/stack-clash-extra-huge.ll
  LLVM :: CodeGen/X86/warn-stack.ll
  LLVM :: CodeGen/X86/win64-stackprobe-overflow.ll
2026-04-04 14:52:54 +00:00
Dave Lee
a8ad2a7d73
[lldb] Fix alias parsing with joined options (#190301)
Fixes a crash with the following alias, which I use for printing the
contents of pointer variables:

```
command alias vp v -P1
```

At some point in the recent-ish past, parsing this alias has started
crashing lldb. The problem is code that assumes the option and its value
are separate. This assumption causes an index past the end of a vector.

This fix changes `FindArgumentIndexForOption`. The function now returns
a pair of indexes, the first index is the option, the second index is
the index of the value. In the case of joined options like `-P1`, the
two indexes are the same.
2026-04-04 07:38:28 -07:00
lonely eagle
230d757a13
[mlir][reducer] make opt-reduction pass clone topOp after check (NFC) (#189356)
To avoid potential memory leaks, this PR defers the ModuleOp cloning
until after the verification check. If the check fails, the
moduleVariant might not be properly deallocated(original
implementation), leading to a memory leak. Therefore, this PR ensures
that the clone operation is only performed after a successful check. It
is part of https://github.com/llvm/llvm-project/pull/189353.
2026-04-04 22:08:34 +08:00
Michael Kruse
fb3fada084
[Polly][NFC] Convert ScopBuilder::getPwAff() to isl++ (#190458) 2026-04-04 13:20:15 +00:00
Alan Li
5e0efc0f1d
Reland "[GlobalISel][LLT] Introduce FPInfo for LLT (Enable bfloat, ppc128float and others in GlobalISel) (#155107)" (#188502)
This is a reland of https://github.com/llvm/llvm-project/pull/155107
along with a fix for old gcc builds.

This patch is reverted in
https://github.com/llvm/llvm-project/pull/188344 due to compilation
failures described in
https://github.com/llvm/llvm-project/pull/155107#issuecomment-4121292756

The fix to old gcc builds is to remove `constexpr` modifiers in the
original patch in 0721d8e7768c011b8cf2d4d223ca6eca3392b1f9
2026-04-04 05:57:13 -07:00
Michael Kruse
47d8003948
[Polly][NFC] Use factory pattern (#190456)
To (theoretically) reduce coupling of Scop and ScopBuilder.
2026-04-04 12:49:13 +00:00
Haohai Wen
6565e08c1e
[lld][COFF] Add /discard-section option to discard input sections by name (#189542)
This provides a general mechanism similar to ELF linker scripts'
/DISCARD/ for COFF. Though the intention is to explicitly discard
.llvmbc and .llvmcmd sections. (See discussion in #150897, #188398
for more details.)
2026-04-04 20:26:12 +08:00
Michael Kruse
948a64720b
[Polly] Assumptions used to derive domain must not be pruned by that domain (#190436)
The code that emits the conditions for whether a statement is executed
by checking whether we are in the statement's domain may apply
assumptions (such as an integer truncation being reversible). Later code
then assumes that these assumptions are only relevent for then the
statement is executed, but actually it is used for determining whether
it is executed.

Break this circular reasoning by introducing an `IsInsideDomain` flag
that can be set when the domain has not been verified yet.

Fixes #190128

Thanks to @thapgua for the bug report
2026-04-04 13:42:04 +02:00
Matt Arsenault
4066590d8e
clang: Stop assuming one toolchain covers all GPUArchs (#190369) 2026-04-04 13:27:53 +02:00
Elvis Wang
a955b3caba
[LV] Enable scalable FindLast on RISCV. (#184931)
This patch enables FindLast reduction vectorization with scalable vectors
on RISCV.
2026-04-04 18:58:58 +08:00
Antonio Frighetto
d27cbc5fa9
[DSE] Introduce eliminateRedundantStoresViaDominatingConditions (#181709)
While optimizing tautological assignments, if there exists a dominating
condition that implies the value being stored in a pointer, and such a
condition appears in a node that dominates the store via equality edge,
then subsequent stores may be redundant, if no write occurs in between.
This is achieved via a DFS top-down walk of the dom-tree, collecting
dominating conditions and propagating them to each subtree, popping them
upon backtracking.

This also generalizes `dominatingConditionImpliesValue` transform, which
was previously taking into account only the immediate dominator.

Compile-time:
https://llvm-compile-time-tracker.com/compare.php?from=f8906704104e446a7482aeca32d058b91867e05c&to=24c5d61f1e28acbe6a59ea4e9a5da0ffcee3bf1a&stat=instructions:u.

Compile-time w/ limit on recursion:
https://llvm-compile-time-tracker.com/compare.php?from=24c5d61f1e28acbe6a59ea4e9a5da0ffcee3bf1a&to=9889567fe8a0515ab895b22003c93fabfd9ac4e5&stat=instructions:u.
Seems to alleviate the small regression in stage2-O3, but seemingly adds
one in stage2-O0-g.
2026-04-04 10:55:25 +00:00
Antonio Frighetto
48c59d1a97
[DSE] Introduce tests for PR181709 (NFC) (#190454) 2026-04-04 12:23:17 +02:00
Anders Waldenborg
da0aec2990
[clang][test] Fix solaris ld driver test to not assume gnu ld location (#186250) 2026-04-04 16:25:36 +07:00
Florian Hahn
093c6391b2
[LV] Add additional tests with IV live-outs. (NFC) (#190395)
Add additional tests with IV live-out users, for which epilogue
vectorization is not enabled yet.

Also modernize check lines.
2026-04-04 10:20:04 +01:00
Stanislav Mekhanoshin
e0908cd7a5
[AMDGPU] Specialize gfx1250 codegen tests for fake and real t16. NFC. (#190390)
This is preparation of turning on real true16, so we can easily
apply it or revert.
2026-04-04 01:55:18 -07:00
Henry Jiang
bc3386c1b9
[dsymutil] Add support for pseudo probes (#186877)
This patch teaches dsymutil to transfer the `__PSEUDO_PROBE` segment and
`__probes` and `__probe_descs` section when creating dSYMs. Without this, both probe sections will get an invalid offset in the dsym bundle.
2026-04-03 23:27:50 -07:00
Yue Huang
38f8945362
[MLIR][Presburger] Fix stale pivot in Smith normal form (#189789)
The pivot used to fix divisibility in Smith normal form is stale. This
will not affect correctness, but can lower efficiency since the outer
loop will be executed more times.

Thanks for @benquike of discovering this.
2026-04-03 23:17:57 -07:00
Zachary Yedidia
e6e388cff0
[LFI][MC] Call setLFIRewriter during LFIMCStreamer initialization (#188625)
Calls `Streamer.setLFIRewriter` during generic LFIMCStreamer
initialization rather than requiring it to be done during
backend-specific initialization. This better follows the existing
conventions in `create*` functions in `TargetRegistry.h`.

Also re-adds the call to initSections for LFI in `llvm-mc.cpp`
(necessary in order to emit the ABI Note section), along with a test to
make sure ABI note emission with the rewriter is working.
2026-04-03 22:02:30 -07:00
Petr Hosek
3080198cc3
Revert "[clang] Fix conflicting declaration error with using_if_exists" (#190441)
Reverts llvm/llvm-project#167646
2026-04-03 19:25:34 -07:00
SiHuaN
5cd98f966e
[RISCV] Select add(vec, splat(scalar)) to PADD_*S for P extension (#190303) 2026-04-04 08:32:56 +08:00
Nishant Patel
6f68502a98
[MLIR][XeGPU] Port tests from the XeGPUSubgroupDistribute to XeGPUSgToWiDistributeExperimental (#189747)
This PR ports tests from subgroup-distribute.mlir (old pass) to
sg-to-wi-experimental.mlir (new pass)
2026-04-03 17:14:16 -07:00
Nishant Patel
b5936d4989
[MLIR][XeGPU] Remove verifyLayouts from sg to wi pass (#190360)
The verifyLayouts function walked the IR before distribution and failed
the pass if any XeGPU anchor op or vector-typed result was missing a
layout attribute. This was added as a temporary guard while the pass was
being developed.
Now we add target check for each op.
2026-04-03 17:00:05 -07:00