575528 Commits

Author SHA1 Message Date
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
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