575555 Commits

Author SHA1 Message Date
Michael Kruse
26697f4d07
[Polly] Correct integer comparison bit width (#190493)
For making an integer compareable to bool, don't compare it to bool.

Bug occured during the reduction of #190459
2026-04-06 01:09:51 +00:00
Wenju He
1839b755dd
[runtimes] Skip custom linker validation for gpu/offload targets (#189933)
This fixes `Host compiler does not support '-fuse-ld=lld'` error when
cross-build libclc for gpu target. Cmake configure command is:
-DRUNTIMES_amdgcn-amd-amdhsa-llvm_LLVM_ENABLE_RUNTIMES=libclc \
-DLLVM_RUNTIME_TARGETS="amdgcn-amd-amdhsa-llvm"
libclc targets only support offload target cross-build and can't link
host executable. The configuration error is false positive for offload.

This PR adds a baseline test to first check if the target can link
executable. If it fails (typical for gpu/offload), we skip the custom
linker validation.
2026-04-06 07:18:36 +08:00
Florian Hahn
58208a0cc1
[LV] Additional epilogue tests for find-iv and with uses of IV.(NFC) (#190548)
Additional test coverage for loops not yet supported, with sinkable
find-iv expressions (github.com/llvm/llvm-project/pull/183911) and uses
of the IV.

PR: https://github.com/llvm/llvm-project/pull/190548
2026-04-05 20:42:11 +00:00
Florian Hahn
c109dd1e9a
[VPlan] Refactor FindLastSelect matching to use m_Specific(PhiR) (NFC). (#190547)
Match the select operands directly against PhiR using m_Specific,
binding only the non-phi IV expression. This replaces the generic
TrueVal/FalseVal matching followed by an assert and conditional
extraction.

Split off from approved
https://github.com/llvm/llvm-project/pull/183911/ as suggested.
2026-04-05 20:07:34 +00:00
Hicham Omari
4bd1facaed
[llvm][docs] Fix typo (#190150)
This commit corrects a typo in the project documentation.
2026-04-05 21:00:25 +01:00
Samuel Thibault
9ce30c8dc3
[Orc][LibResolver] Fix GNU/Hurd build (#184470)
GNU/Hurd does not put a PATH_MAX static constraint on path lengths. We can instead check the symlink length.
2026-04-05 19:56:31 +01:00
Sergei Barannikov
11e7a49a58
[lldb] Remove VMRange class (NFC) (#190475)
We have a template class `Range` that provides similar functionality and
is much more widely used.
2026-04-05 18:39:44 +00:00
Sergei Barannikov
f8e394b6f8
[lldb] Fix section offset of synthesized entry point symbol (#190348)
In the non-ARM case, the offset was left unset, so the symbol
synthesized for the entry point pointed to the start of the containing
section.
As a drive-by change, simplify offset adjustment in ARM case.
2026-04-05 21:39:24 +03:00
Jonas Devlieghere
353ab41001
[lldb] Update error message in SocketTest::CreatePair (#190544) 2026-04-05 18:23:36 +00:00
Jonas Devlieghere
f866ef202c
[lldb] Bring more diagnostics in compliance with our coding standards (#190410)
The LLVM Coding Standards [1] specify that:

> [T]o match error message styles commonly produced by other tools,
> start the first sentence with a lowercase letter, and finish the last
> sentence without a period, if it would end in one otherwise.

Historically, that hasn't been something we've enforced in LLDB, but in
the past year or so I've started to pay more attention to this in code
reviews. This PR brings more error messages in compliance, further
increasing consistency.

I also adopted `createStringErrorV` where it improved the code as a
drive-by for lines I was already touching.

[1] https://llvm.org/docs/CodingStandards.html#error-and-warning-messages

Assisted-by: Claude Code
2026-04-05 10:41:47 -07:00
Florian Hahn
36e495dd90
[VPlan] Use APSInt in CheckSentinel directly (NFC). (#190534)
Simplify the sentinel checking logic by using APSInt and checking for
both a signed and unsigned sentinel in a single call.

Removes the IsSigned argument

Split off from approved
https://github.com/llvm/llvm-project/pull/183911/ as suggested.
2026-04-05 16:43:59 +00:00
Florian Hahn
a2c16bb59f
[VPlan] Rename CondSelect to FindLastSelect (NFC). (#190536)
…ns (NFC).

Use the more descriptive name FindLastSelect for the conditional select
that picks between the reduction phi and the IV value.

Split off from approved
https://github.com/llvm/llvm-project/pull/183911/ as suggested.
2026-04-05 16:39:34 +00:00
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