533871 Commits

Author SHA1 Message Date
Pranav Kant
a4fbc6f78f
[bazel] Fix a typo (#135460) 2025-04-11 17:05:52 -07:00
Pranav Kant
b74dbf7fb2
[bazel] Add support for SMT Dialect (#135454)
This fixes #131480
2025-04-11 16:34:49 -07:00
Matheus Izvekov
6aae1047b6
[clang] ASTImporter: fix SubstNonTypeTemplateParmExpr source location (#135450)
This makes it clear which source location is imported.
2025-04-11 20:18:16 -03:00
Craig Topper
4c67bdd973
[RISCV] Don't fold offsets into auipc if offset is larger than the reference global variable. (#135297)
The global variable should be within 2GB of the PC, but an offset to an
address outside the global might not be.

Fixes #134525.
2025-04-11 16:12:19 -07:00
Nico Weber
957bd6aa32 [gn] port d1fd97737e90 2025-04-11 19:08:05 -04:00
Shafik Yaghmour
eb68b914dd
[NFC][LLVM] Apply std::move to object being pushed back in findSymbolCommon (#135290)
Static analysis found that we could move LineInfo into the Result vector
instead of just copying it.
2025-04-11 15:49:01 -07:00
Jeffrey Byrnes
6e7fe85247
[AMDGPU] Teach iterative schedulers about IGLP (#134953)
This adds IGLP mutation to the iterative schedulers
(`gcn-iterative-max-occupancy-experimental`, `gcn-iterative-minreg`, and
`gcn-iterative-ilp`).

The `gcn-iterative-minreg` and `gcn-iterative-ilp` schedulers never
actually applied the mutations added, so this also has the effect of
teaching them about mutations in general. The
`gcn-iterative-max-occupancy-experimental` scheduler has calls to
`ScheduleDAGMILive::schedule()`, so, before this, mutations were applied
at this point. Now this is done during calls to `BuildDAG`, with IGLP
superseding other mutations (similar to the other schedulers). We may
end up scheduling regions multiple times, with mutations being applied
each time, so we need to track for
`AMDGPU::SchedulingPhase::PreRAReentry`
2025-04-11 15:34:49 -07:00
Alexandre Ganea
46135ade9e [Sema] On Windows, silence erroneous warning when building with MSVC
Fixes what seems to be a buggy warning in MSVC:
```
[1/37] Building CXX object tools\clang\lib\Sema\CMakeFiles\obj.clangSema.dir\SemaConcept.cpp.obj
C:\git\llvm-project\clang\lib\Sema\SemaConcept.cpp(1933): warning C4101: '$S26': unreferenced local variable
```
2025-04-11 17:50:15 -04:00
Alexandre Ganea
715c61e9a7 [lldb][lldbp-dap] On Windoows, silence warnings when building with MSVC
Fixes:
```
[6373/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\DAP.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\DAP.cpp(725) : warning C4715: '`lldb_dap::DAP::HandleObject'::`30'::<lambda_2>::operator()': not all control paths return a value
[6421/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\Protocol\ProtocolTypes.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(203) : warning C4715: 'lldb_dap::protocol::ToString': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(98) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(72) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolTypes.cpp(111) : warning C4715: 'lldb_dap::protocol::toJSON': not all control paths return a value
[6426/7138] Building CXX object tools\lldb\tools\lldb-dap\CMakeFiles\lldb-dap.dir\Protocol\ProtocolBase.cpp.obj
C:\git\llvm-project\lldb\tools\lldb-dap\Protocol\ProtocolBase.cpp(287) : warning C4715: 'lldb_dap::protocol::fromJSON': not all control paths return a value
```
2025-04-11 17:50:15 -04:00
Alexandre Ganea
e1d91ba06d [lldb] Fix erroneous return value
Found when building with MSVC on Windows, was seeing:
```
[2703/7138] Building CXX object tools\lldb\source\Plugins\Process\Utility\CMakeFiles\lldbPluginProcessUtility.dir\NativeRegisterContextDBReg.cpp.obj
C:\git\llvm-project\lldb\source\Plugins\Process\Utility\NativeRegisterContextDBReg.cpp(286): warning C4305: 'return': truncation from 'unsigned int' to 'bool'
```
2025-04-11 17:50:15 -04:00
Alexandre Ganea
78fbba9921 [compiler-rt] On Windows, silence warning when building with Clang ToT
Fixes:
```
[6113/7139] Building CXX object projects\compiler-rt\lib\interception\CMakeFiles\RTInterception.x86_64.dir\interception_win.cpp.obj
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): warning: unannotated fall-through between switch labels [-Wimplicit-fallthrough]
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): note: insert 'FALLTHROUGH;' to silence this warning
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
      |     FALLTHROUGH;
C:\git\llvm-project\compiler-rt\lib\interception\interception_win.cpp(746,5): note: insert 'break;' to avoid fall-through
  746 |     case 0xB841:  // 41 B8 XX XX XX XX : mov r8d, XX XX XX XX
      |     ^
      |     break;
1 warning generated.
```
2025-04-11 17:50:15 -04:00
Alexandre Ganea
12c4be1ba8 [clang][unittests] On Windows, silence warning when building with MSVC
Fixes:
```
[113/324] Building CXX object tools\clang\unittests\AST\ByteCode\CMakeFiles\InterpTests.dir\BitcastBuffer.cpp.obj
C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(52): warning C4309: 'initializing': truncation of constant value
C:\git\llvm-project\clang\unittests\AST\ByteCode\BitcastBuffer.cpp(53): warning C4309: 'initializing': truncation of constant value
```
2025-04-11 17:50:14 -04:00
Alexandre Ganea
84ed81bc8a [lldb] On Windows, silence warning when building with Clang ToT
Fixes:
```
[930/2017] Building CXX object tools\lldb\unittests\Thread\CMakeFiles\ThreadTests.dir\ThreadTest.cpp.obj
C:\git\llvm-project\lldb\unittests\Thread\ThreadTest.cpp(51,23): warning: cast from 'FARPROC' (aka 'long long (*)()') to 'SetThreadDescriptionFunctionPtr' (aka 'long (*)(void *, const wchar_t *)') converts to incompatible function type [-Wcast-function-type-mismatch]
   51 |       SetThreadName = reinterpret_cast<SetThreadDescriptionFunctionPtr>(
      |                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   52 |           ::GetProcAddress(hModule, "SetThreadDescription"));
      |           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 warning generated.
```
2025-04-11 17:49:26 -04:00
Amr Hesham
93370c4ab3
[CIR] Make LLVM & OGCG variables match the same pattern (#135427)
Follow-up patch to improve variable names in LLVM and OGCG in
https://github.com/llvm/llvm-project/pull/134536
2025-04-11 14:36:00 -07:00
Maksim Levental
de67293c09
[mlir][SMT] upstream SMT dialect (#131480)
This PR upstreams the `SMT` dialect from the CIRCT project. Here we only
check in the dialect/op/types/attributes and lit tests. Follow up PRs
will add conversions in and out and etc.

Co-authored-by: Bea Healy <beahealy22@gmail.com>
Co-authored-by: Martin Erhart <maerhart@outlook.com>
Co-authored-by: Mike Urbach <mikeurbach@gmail.com>
Co-authored-by: Will Dietz <will.dietz@sifive.com>
Co-authored-by: fzi-hielscher <hielscher@fzi.de>
Co-authored-by: Fehr Mathieu <mathieu.fehr@gmail.com>
2025-04-11 17:10:09 -04:00
Matheus Izvekov
4530922cfd
[clang] fix serialization for SubstNonTypeTemplateParmPackExpr (#135428)
This fixes a PCM non-determinism regression reported here:
https://github.com/llvm/llvm-project/pull/134560#issuecomment-2797744370

There was a bit in `SubstNonTypeTemplateParmPackExpr` which we missed to
serialize, and that bit eventually propagates to
`SubstNonTypeTemplateParmExpr`.

As a drive by, improve serialization for PackIndex on
SubstNonTypeTemplateParmExpr by using the newly introduced
UnsignedOrNone helpers.

There are no release notes since this regression was never released.
2025-04-11 18:04:18 -03:00
Valentin Clement (バレンタイン クレメン)
2837fd7e5a
[flang][openacc] Allow if_present multiple times on host_data and update (#135422)
Similar to #135415.

The spec has not strict restriction to allow a single `if_present`
clause on the host_data and update directives. Allowing this clause
multiple times does not change the semantic of it. This patch relax the
rules in ACC.td since there is no restriction in the standard.

The OpenACC dialect represents the `if_present` clause with a `UnitAttr`
so the attribute will be set if the is one or more `if_present` clause.
2025-04-11 14:01:03 -07:00
Valentin Clement (バレンタイン クレメン)
609361ab39
[flang][openacc] Allow finalize clause on exit data more than once (#135415)
The spec has not strict restriction to allow a single `finalize` clause
on the `exit data` directive. Allowing this clause multiple times does
not change the semantic of it. This patch relax the rules in `ACC.td`
since there is no restriction in the standard.

The OpenACC dialect represent the finalize clause with a UnitAttr so the
attribute will be set if the is one or more `finalize` clause.
2025-04-11 13:54:48 -07:00
vdonaldson
a8da4834f7
[flang] IEEE_SCALB and SCALE - kind=2, kind=3 (#135374)
Implement the kind=2,3 variants of language intrinsic SCALE and
intrinsic module procedure IEEE_SCALB, including exception signaling.
2025-04-11 16:38:45 -04:00
Jan Korous
ee801cdd6e
[-Wunsafe-buffer-usage] Add findUnsafePointers (#135421) 2025-04-11 13:28:18 -07:00
Brad Smith
d1fd97737e
[compiler-rt][sanitizer] add Haiku support (#134772)
Co-authored-by: Jérôme Duval <jerome.duval@gmail.com>
2025-04-11 16:21:00 -04:00
Victor Vianna
90a202f2ff
[cpp23] Remove usage of std::aligned_union<> in llvm (#135146)
std::aligned_union<> is deprecated in C++23. See more details in the
linked bug.

Bug: https://crbug.com/388068052
2025-04-11 16:16:33 -04:00
Tai Ly
d78b486414
[mlir][tosa] Add error_if checks for Mul Op (#135075)
This adds error_if validation checking for Mul Op

Signed-off-by: Tai Ly <tai.ly@arm.com>
2025-04-11 13:14:46 -07:00
Florian Hahn
ae0aa2dea2
[VPlan] Merge cases using getResultType in inferScalarType (NFC). 2025-04-11 21:01:58 +01:00
Peter Klausler
72144d119a
[flang][runtime] Fix recently broken big-endian formatted integer input (#135417)
My recent change to speed up formatted integer input has a bug on
big-endian targets that has shown up on ppc64 AIX build bots. Fix.
2025-04-11 12:52:23 -07:00
Shilei Tian
a45b133d40
[AMDGPU][Verifier] Mark calls to entry functions as invalid in the IR verifier (#134910) 2025-04-11 15:32:37 -04:00
Ikhlas Ajbar
32c39092ea
[llvm][Hexagon] Promote operand v2i1 to v2i32 (#135409)
Fixes #118879
2025-04-11 14:25:50 -05:00
David Green
052225dc03 [AArch64] Use a lower Costsize cost in getScalarizationOverhead.
This is a follow on to #130946 to use the same codesize cost override in
getScalarizationOverhead for vector instructions.
2025-04-11 20:18:26 +01:00
Andrzej Warzyński
fedd79bdcd
[mlir][vector] Tighten the semantics of vector.{load|store} (#135151)
This change refines the verifier for `vector.load` and `vector.store` to
disallow the use of vectors with higher rank than the source or
destination memref. For example, the following is now rejected:

```mlir
  %0 = vector.load %src[%c0] : memref<?xi8>, vector<16x16xi8>
  vector.store %vec, %dest[%c0] : memref<?xi8>, vector<16x16xi8>
```

This pattern was previously used in SME end-to-end tests and "happened"
to work by implicitly assuming row-major memory layout. However, there
is no guarantee that such an assumption will always hold, and we should
avoid relying on it unless it can be enforced deterministically.

Notably, production ArmSME lowering pipelines do not rely on this
behavior. Instead, the expected usage (illustrated here with scalable
vector syntax) would be:

```mlir
  %0 = vector.load %src[%c0, %c0] : memref<?x?xi8>, vector<[16]x[16]xi8>
```

This PR updates the verifier accordingly and adjusts all affected tests.
These tests are either removed (if no longer relevant) or updated to use
memrefs with appropriately matching rank.
2025-04-11 20:08:08 +01:00
Jonas Devlieghere
179d30f8c3
Revert "[lldb] Make sure the process is stopped when computing the symbol context (#134757)" (#135408)
This reverts commit e84a80408523a48d6eaacd795f1615e821ffb233 because on
Linux there seems to be a race around GetRunLock. See #134757 for more
context.
2025-04-11 11:50:42 -07:00
Felipe de Azevedo Piovezan
c2939b9bf6
Reland "[lldb] Clear thread-creation breakpoints in ProcessGDBRemote::Clear (#134397)" (#135296)
This reapplies commit
232525f069.

The original commit triggered a sanitizer failure when `Target` was
destroyed. In `Target::Destroy`, `DeleteCurrentProcess` was called, but
it did not destroy the thread creation breakpoints for the underlying
`ProcessGDBRemote` because `ProcessGDBRemote::Clear` was not called in
that path.

`Target `then proceeded to destroy its breakpoints, which resulted in a
call to the destructor of a `std::vector` containing the breakpoints.
Through a sequence of complicated events, destroying breakpoints caused
the reference count of the underlying `ProcessGDBRemote` to finally
reach zero. This, in turn, called `ProcessGDBRemote::Clear`, which
attempted to destroy the breakpoints. To do that, it would go back into
the Target's vector of breakpoints, which we are in the middle of
destroying.

We solve this by moving the breakpoint deletion into
`Process:DoDestroy`, which is a virtual Process method that will be
called much earlier.
2025-04-11 11:46:22 -07:00
Alexey Bataev
38e64b1a84 [SLP]Fix minbiwidth analysis for gather nodes with SIToFP users
If the buildvector node has cast to float user, it cannot be considered as safe
for truncation, need to use the original bitwidth here.

Fixes #135410
2025-04-11 11:40:41 -07:00
Roland McGrath
db4ad4686f
[libc] Add myself as maintainer for Public Headers / hdrgen (#135209) 2025-04-11 11:33:52 -07:00
erichkeane
52ef55864f [OpenACC] Fix source-location on a handful of CIR Directives
Apparently we used the 'end location' instead of 'start' in a few
places.
2025-04-11 11:33:20 -07:00
Farzon Lotfi
6f5e993b17
[DirectX] legalize usub.sat (#135288)
fixes #135285

This change implements the `usub.sat` intrinsic to perform an unsigned
saturating subtraction on the 2 arguments.
The minimum value this operation is clamp to is 0.
2025-04-11 14:32:44 -04:00
Mark de Wever
df579ce4b6
[libc++] Adds is_implemented function for new ftm generator. (#134538)
At the moment the ftm macro for __cpp_lib_to_chars will have the
following values:

standard_ftms: {
    "c++17": "201611L",
    "c++20": "201611L",
    "c++23": "201611L",
    "c++26": "201611L",
}

implemented_ftms: {
    "c++17": None,
}

This is an issue with the test whether the FTM is implemented it does:
  self.implemented_ftms[ftm][std] == self.standard_ftms[ftm][std]
This will fail in C++20 since implemented_ftms[ftm] does not have the
key c++20. This adds a new helper function and removes the None entries
when a FTM is not implemented.

---------

Co-authored-by: Louis Dionne <ldionne.2@gmail.com>
2025-04-11 20:27:29 +02:00
Daniel Thornburgh
1e54bca669
[libc] Add dthorn as maintainer for allocator on baremetal (#135203)
This was on request from other maintainers, given that I've been
de-facto acting as maintainer of the baremetal allocator stuff.
2025-04-11 11:19:43 -07:00
Alexey Bataev
c9ad5bed7f [SLP][NFC]Add a test with the incorrect type promotion after bitwidth analysis, NFC 2025-04-11 11:10:01 -07:00
Mark de Wever
e15025dd50 [libc++] Another Apple CI quick-fix.
Like #135202 this fixes another issue after the XCode update.
2025-04-11 20:02:49 +02:00
Kevin Gleason
e911f90a40
[mlir] Add support for broader range of input files in generate-test-checks.py (#134327)
A few additions:

- Lines with `{{`: These can show up if serializing non-MLIR info into
string attrs `my.attr = {{proto}, {...}}`. String escape the opening
`{{`, given that check lines are generated this has no effect on
`{{.*}}` etc in generated lines.
- File split line: Normally these are skipped because of their indent
level, but if using `--starts_from_scope=0` to generate checks for the
`module {...} {` line, and since MLIR opt tools emit file split lines by
default, some `CHECK: // -----` lines were emit.
- (edit removed this, fixed by
https://github.com/llvm/llvm-project/pull/134364) AttrAliases: I'm not
sure if I'm missing something for the attribute parser to work
correctly, but I was getting many `#[[?]]` for all dialect attrs. Only
use the attr aliasing if there's a match.
2025-04-11 13:00:47 -05:00
Alexey Bataev
a2d129b792 [SLP]Fix a crash when trying to reduce in revec after minbitwidth analysis
Need to use the original scalar type, when building the reduction, and
use the scalar type, when performing casting, to avoid compiler crash.
2025-04-11 10:58:39 -07:00
Andy Kaylor
abe3b90b3f
[CIR] Fix warnings, again! (#135284)
The calleeDecl var will be used in the near future, so I left it. At
least for clang, the [[maybe_unused]] attribute takes care of the
warnings related to that variable. The other warning was a simple lack
of return after errorNYI.
2025-04-11 10:57:08 -07:00
LLVM GN Syncbot
cb974dcd77 [gn build] Port de5b099dd154 2025-04-11 17:48:57 +00:00
Jan Korous
de5b099dd1
[-Wunsafe-buffer-usage][NFC] Factor out FixitUtil (#135100) 2025-04-11 10:47:52 -07:00
Jonas Devlieghere
68ab45f053
Revert "[lldb] ProcessGdbRemote header gardning"
This reverts commit 2fd860c1f559c0b0be66cc000e38270a04d0a1a3 as this is
causing a EXC_BAD_ACCESS on Darwin:

https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/as-lldb-cmake/23807/
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake/11255/
2025-04-11 10:44:43 -07:00
Alexey Bataev
bd0b2bdacc [SLP][NFC]Use VF instead of VL.size and modernize some transformations, NFC. 2025-04-11 10:29:30 -07:00
Morris Hafner
566c30e324
[CIR] Upstream binary assignments and comma (#135115)
This patch adds `VisitBinAssign` and `VisitBinComma` to the ClangIR
`ScalarExprEmitter` to enable assignments and the comma operator.

---------

Co-authored-by: Morris Hafner <mhafner@nvidia.com>
2025-04-11 10:26:29 -07:00
Valentin Clement (バレンタイン クレメン)
8fb6bb3e23
[flang][openacc] Allow multiple device_type clauses on init and shutdown (#135314)
Relax the restriction for init and shutdown directives for device_type
clause. The clause can be allowed multiple times.
2025-04-11 10:15:17 -07:00
Juan Manuel Martinez Caamaño
d995b2ebdc
[Clang][AMDGPU] Accept builtins in lambda declarations (#135027)
`Sema::getCurFunctionDecl(AllowLambda = false)` returns a nullptr when
the lambda declaration is outside a function (for example, when
assigning a lambda to a static constexpr variable).

This triggered an assertion in
`SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall`.

Using `Sema::getCurFunctionDecl(AllowLambda = true)` returns the
declaration of the enclosing lambda.

Stumbled with this issue when refactoring some code in CK.
2025-04-11 19:11:46 +02:00
Henry Jiang
68b7cba2b0
[LoopIdiom] Update strlen idiom body loop condition to be clean up by LoopDeletion (#134906)
Fixes the case where subsequent passes were unable to find and delete
the invariant loop left over by the strlen idiom conversion. Since
`loop-deletion` only operate on computable loops, we can update the loop
condition to something more easily picked up by `loop-deletion`

As pointed out in https://github.com/llvm/llvm-project/issues/134736
2025-04-11 12:55:45 -04:00