534051 Commits

Author SHA1 Message Date
Maksim Levental
d903f6b672 [mlir][SMT] fix MLIRExportSMTLIB by linking MLIRArithDialect 2025-04-12 17:08:57 -04:00
Sam Elliott
f0dc236d33
[RISCV][NFC] Correct c_lui_imm (#135448)
The MCOperandPredicate seems to allow symbols as well as immediates, but
the parser/matcher does not due to `isCLUIImm`. This brings both in line
with each other, and should prevent trying to compress a `lui` with a
symbol, which cannot be emitted as a `c.lui` as there are no relocations
for this as `R_RISCV_RVC_LUI` is deprecated/removed.
2025-04-12 22:57:29 +02:00
Min Hsu
75dea80085 [mailmap] Consolidate all my email addresses 2025-04-12 13:48:02 -07:00
Maksim Levental
acf964b95f
[mlir][SMT] add export smtlib (#131492)
This PR adds the `ExportSMTLIB` translation/egress pass for `SMT`
dialect.
2025-04-12 16:39:16 -04:00
Nikolas Klauser
5bdad0555e
[libc++][NFC] Remove a few aliases in __tree (#134392)
These aliases aren't required anymore, since we've taken an ABI break
unconditionally which these were used to avoid.
2025-04-12 22:39:01 +02:00
Florian Hahn
4fa3b2a184
[VPlan] Use TypeAnalysis instead of underlying instr in VPPredInst (NFC)
Removes another unnecessary use of the underlying instructions during
VPlan execution.
2025-04-12 20:54:27 +01:00
Florian Hahn
995fd47944
[LAA] Make sure MaxVF for Store-Load forward safe dep distances is pow2.
MaxVF computed in couldPreventStoreLoadFowrard may not be a power of 2,
as CommonStride may not be a power-of-2.

This can cause crashes after 78777a20. Use bit_floor to make sure it is
a suitable power-of-2.

Fixes https://github.com/llvm/llvm-project/issues/134696.
2025-04-12 20:05:37 +01:00
Paul Kirth
b71123f127
[clang-doc] Pre-commit tests for static members and functions (#135456)
Issue #59813 mentions that static members are not included in
the documentation generated by clang-doc. This patch adds
some basic testing for that property, with the current incorrect
behavior. Follow up patches will address the missing documentation.
2025-04-12 10:54:27 -07:00
Matheus Izvekov
761787d425
Reland: [clang] Improved canonicalization for template specialization types (#135414)
This relands https://github.com/llvm/llvm-project/pull/135119, after
fixing crashes seen in LLDB CI reported here:
https://github.com/llvm/llvm-project/pull/135119#issuecomment-2794910840

Fixes https://github.com/llvm/llvm-project/pull/135119

This changes the TemplateArgument representation to hold a flag
indicating whether a tempalte argument of expression type is supposed to
be canonical or not.

This gets one step closer to solving
https://github.com/llvm/llvm-project/issues/92292

This still doesn't try to unique as-written TSTs. While this would
increase the amount of memory savings and make code dealing with the AST
more well-behaved, profiling template argument lists is still too
expensive for this to be worthwhile, at least for now.

This also fixes the context creation of TSTs, so that they don't in some
cases get incorrectly flagged as sugar over their own canonical form.
This is captured in the test expectation change of some AST dumps.

This fixes some places which were unnecessarily canonicalizing these
TSTs.
2025-04-12 14:26:30 -03:00
Craig Topper
009971a0d3
[TableGen] Accurately calculate where the source variable ops start in PseudoLoweringEmitter::emitLoweringEmitter. (#135465)
The code was using the number of source operands plus one. The plus one
seems to be an ARM specific value accounting for one of the source
operands having 2 sub operands. No other target in tree uses
PseudoLowering with variadic instructions so this worked.

This patch replaces it with a proper count of the number of sub operands
of all operands. While there I update the loop to use MIOperandNo so we
don't need to count up the sub operands as we go.
2025-04-12 10:00:56 -07:00
Matt Arsenault
b233d79623
R600: Expand is_fpclass (#135234) 2025-04-12 18:49:12 +02:00
Maksim Levental
c6a892e0ed
[mlir][SMT] restore custom builder for forall/exists (#135470)
This reverts commit 54e70ac7650f1c22f687937d1a082e4152f97b22 which
itself fixed an [asan
leak](https://lab.llvm.org/buildbot/#/builders/55/builds/9761) from the
original upstreaming commit. The leak was due to op allocations not
being `free`ed.

~~The necessary change was to explicitly `->destroy()` the ops at the
end of the tests. I believe this is because the rewriter used in the
tests doesn't actually insert them into a module and so without an
explicit `->destroy()` no bookkeeping process is able to take care of
them.~~

The necessary change was to use `OwningOpRef` which calls `op->erase()`
in its [own
destructor](89cfae41ec/mlir/include/mlir/IR/OwningOpRef.h (L39)).
2025-04-12 12:32:40 -04:00
Philip Reames
33e5305c59 [RISCV] Further explain vfmerge.vfm/vmerge.vxm varuat coverage 2025-04-12 07:38:31 -07:00
Jon Roelofs
e838b8b7e7
[Matrix] Fix a miscompile due to an incorrect double-transpose fold (#135397)
Transposes are only inverses of each other when they have matching
shapes.

rdar://145592582
2025-04-12 07:31:13 -07:00
Mark de Wever
d39d24cec1 [libc++][doc] Updates the release notes.
Copies the not-yet-implemented items planned for removal from the
LLVM-20 to the LLVM-21 release notes. This allows to better keep track
of the status of the next release.
2025-04-12 15:26:48 +02:00
Mark de Wever
6de15379f4
[NFC][libc++][test] Minor updates to generated header version test. (#134543)
Adjusting the existing script to match the new output makes it easy to
review the new script works correctly.

This adjusts the tests to match the changes in the new tests, Notably
- removes the synopsis uses 2 spaces indent in `# if`

It does not implement the conditional include part. This would be quite
some effort and these diffs are easy to review manually.

Note there are no tests for the changes; the existing script will be
phased out when the next generators are complete.
2025-04-12 14:20:01 +02:00
Jacek Caban
2b270df2e7
[Object][COFF] Avoid underscore prefix for forwarding exports (#135433)
Fixes #132411.
2025-04-12 13:24:45 +02:00
Andreas Jonson
4dd80b73b0 [SimplifyCFG] test for trunc condition (NFC) 2025-04-12 12:25:40 +02:00
Yingwei Zheng
8b40a09bf5
[Clang][CodeGen][UBSan] Remove redundant EmitCheckValue calls. NFCI (#135141)
`EmitCheckValue` is called inside `EmitCheck`:

b122956390/clang/lib/CodeGen/CGExpr.cpp (L3739)
The outside calls are redundant because
`EmitCheckValue(EmitCheckValue(V))` always returns `EmitCheckValue(V)`.

Required by https://github.com/llvm/llvm-project/pull/135135.
2025-04-12 15:35:45 +08:00
Yingwei Zheng
76e07d8ba5
[LibCall] Infer nocallback for libcalls (#135173)
This patch adds `nocallback` attributes for string/math libcalls. It
allows FuncAttributor to infer `norecurse` more precisely and encourages
more aggressive global optimization.
2025-04-12 15:11:54 +08:00
Aiden Grossman
339f58de16 [Github] Add llvm-symbolizer to CI container
This is needed for symbolizing some test failures. It is under 8MB, so there is
very little cost to adding it.
2025-04-12 05:22:13 +00:00
Fangrui Song
b864405c9b MCAsmInfo: Remove unused UseParensForDollarSignNames
Follow-up to 3acccf042ab8a7b7e663bb2b2fac328d9bf65b38
2025-04-11 22:09:24 -07:00
donald chen
7a6a79551d
[NFC][equivalenceClass] Refactor coding style in EquivalenceClasses.h. (#135467) 2025-04-12 13:08:50 +08:00
Brad Smith
d49063b496
[compiler-rt][sanitizer][NFC] update endif markers for Haiku (#135475) 2025-04-12 00:49:23 -04:00
Craig Topper
6bea80e93f [TableGen] Remove unneeded FIXME. NFC
The message looks correct to me.
2025-04-11 21:37:35 -07:00
Amir Ayupov
fa4ac19f0f
[BOLT] Accept PLT fall-throughs as valid traces (#129481)
We used to report PLT traces as invalid (mismatching disassembled
function contents) because PLT functions are marked as pseudo and
ignored, thus missing CFG. However, such traces are not mismatching
the function contents. Accept them without attaching the profile.

Test Plan: updated callcont-fallthru.s
2025-04-11 21:26:19 -07:00
Jan Svoboda
3a2d9a7c1e
[clang][frontend] Expose CompilerInstance::cloneForModuleCompile() (#135405)
This PR exposes `cloneForModuleCompile()` as a public `CompilerInstance`
member function. This will be eventually used in the dependency scanner
to customize implicit module builds.
2025-04-11 20:47:04 -07:00
Philip Reames
336b290923
[RISCV] Use a DAG combine to prune pointless vrgather.vi (#135392)
If the vrgather.vi is preceeded by a vmv.v.x which writes a superset of
the lanes writen by the vrgather, and the vrgather has no passthru, then
the vrgather has no semantic effect.

This is the start of a mini-series of patches around rewriting
vrgather.vi/vx preceeded by vmv.v.x, vfmf.v.f, vmv.s.x, etc... Starting
with the simplest, but also lowest impact.

One point I'd like a second oppinion on is the out of bounds semenatic
change. As far as I can tell, all the indices are in bounds by
construction. The doc change is as much as I couldn't figure out how to
test the alternative as anything else.
2025-04-11 20:02:53 -07:00
Sagar Kulkarni
357e3803bb
[mlir][vector] Prevent folding non memref-type gather into maskedload (#135371)
This patch fixes an issue in the FoldContiguousGather pattern which was
incorrectly folding vector.gather operations with contiguous indices
into vector.maskedload operations regardless of the base operand type.

While vector.gather operations can work on both tensor and memref types,
vector.maskedload operations are only valid for memref types. The
pattern was incorrectly lowering a tensor-based gather into a
masked-load, which is invalid.

This fix adds a type check to ensure the pattern only applies to
memref-based gather operations.

Co-authored-by: Sagar Kulkarni <sagar@rain.ai>
2025-04-12 04:15:51 +03:00
Maksim Levental
54e70ac765 [mlir][SMT] remove custom forall/exists builder because of asan memory leak 2025-04-11 20:12:36 -04:00
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