Commit Graph

560605 Commits

Author SHA1 Message Date
Walter Lee
f0e0a22158 [bazel] Delete redundant visibility (#169493)
default_visibility is already public.
2025-11-25 13:21:56 +00:00
Paul Walker
6bf3249fe9 [Clang][Sema] Emit diagnostic for __builtin_vectorelements(<SVEType>) when SVE is not available. (#168097)
As is done for other targets, I've moved the target type checking code
into SemaARM and migrated existing uses.

Fixes https://github.com/llvm/llvm-project/issues/155736
2025-11-25 13:14:10 +00:00
Durgadoss R
9e53ef3d8c [MLIR][NVVM] Update mbarrier.arrive.* Op (#168758)
This patch updates the mbarrier.arrive.* family of Ops to include 
all features added up-to Blackwell.
* Update the `mbarrier.arrive` Op to include shared_cluster
  memory space, cta/cluster scope and an option to lower using
  relaxed semantics.
* An `arrive_drop` variant is added for both the `arrive` and
  `arrive.nocomplete` operations.
* Updates for expect_tx and complete_tx operations.
* Verifier checks are added wherever appropriate.
* lit tests are added to verify the lowering to the intrinsics.

TODO:
* Updates for the remaining mbarrier family will be done in
  subsequent PRs. (mainly, arrive.expect-tx, test_wait and try_waits)

Signed-off-by: Durgadoss R <durgadossr@nvidia.com>
2025-11-25 18:32:13 +05:30
Jan Patrick Lehr
4bc654d649 Revert "[Flang] Move builtin .mod generation into runtimes" (#169489)
Reverts llvm/llvm-project#137828

Buildbot error in
https://lab.llvm.org/staging/#/builders/105/builds/37275
2025-11-25 13:54:27 +01:00
LLVM GN Syncbot
262716b35b [gn build] Port 07ad928d92 2025-11-25 12:47:00 +00:00
Nikolas Klauser
07ad928d92 [libc++] Introduce __specialized_algorithms (#167295) 2025-11-25 13:46:19 +01:00
Ramkumar Ramachandra
e06c148af7 [IVDesc] Use SCEVPatternMatch to improve code (NFC) (#168397) 2025-11-25 12:29:56 +00:00
Simon Pilgrim
af3af8ea5a [X86] setcc-wide-types.ll - cleanup check prefixes NFC (#169488)
Match typical prefixes used in x86 SSE/AVX tests
2025-11-25 12:19:59 +00:00
Jay Foad
4e37526fdb [AMDGPU] Fix test after #169378 2025-11-25 12:17:17 +00:00
Balázs Benics
17b19c5034 [analyzer] Unroll loops of compile-time upper-bounded loops (#169400)
Previously, only literal upper-bounded loops were recognized. This patch
relaxes this matching to accept any compile-time deducible constant
expression.

It would be better to rely on the SVals (values from the symbolic
domain), as those could potentially have more accurate answers, but this
one is much simpler.
Note that at the time we calculate this value, we have not evaluated the
sub-exprs of the condition, consequently, we can't just query the
Environment for the folded SVal.
Because of this, the next best tool in our toolbox is comp-time
evaluating the Expr.

rdar://165363923
2025-11-25 12:16:56 +00:00
Jay Foad
d748c81218 [AMDGPU] Change the immediate operand of s_waitcnt_depctr / s_wait_alu (#169378)
The 16-bit immediate operand of s_waitcnt_depctr / s_wait_alu has some
unused bits. Previously codegen would set these bits to 1, but setting
them to 0 matches the SP3 assembler behaviour better, which in turn
means that we can print them using the human readable SP3 syntax:

s_wait_alu 0xfffd ; unused bits set to 1
s_wait_alu 0xff9d ; unused bits set to 0
s_wait_alu depctr_va_vcc(0) ; unused bits set to 0, human readable

Note that the set of unused bits changed between GFX10.1 and GFX10.3.
2025-11-25 11:55:26 +00:00
Nikolas Klauser
105900ced1 [libc++] Always define _LIBCPP_GLIBC_PREREQ (#169405)
Always defining the macro allows us to simplify the few places where
it's used.
2025-11-25 12:51:23 +01:00
Nikolas Klauser
68c2a8140f [libc++][C++03] Fix ODR tests (#169349)
We don't really need to include `<__config>`. We just need to include a
public C++ header.
2025-11-25 12:49:59 +01:00
Aiden Grossman
51dd3ec13c [MLIR][OpenMP] Bail early in sortMapIndices if indices are the same (#169474)
If we are given the same index in the comparator callback, simply return
false. Otherwise we will end up adding invalid items to
occludedChildren, causing extra items to get removed that should not be,
resulting in failures that manifest in different forms (assertions, asan
failures, ubsan failures, etc.).
2025-11-25 06:23:12 -05:00
Sander de Smalen
e1b08731e5 Revert "Reland "RegisterCoalescer: Add implicit-def of super register when coalescing SUBREG_TO_REG""
This reverts commit bb78728826.
2025-11-25 11:01:27 +00:00
Ravil Dorozhinskii
bc4143b27a [DAG] SDPatternMatch - add m_SpecificFP matcher (#167438)
This patch introduces SpecificFP matcher for SelectionDAG nodes.

This includes:

Adding SpecificFP_match() in SDPatternMatch.h.
Adding test coverage in SelectionDAGPatternMatchTest.cpp.

Closes #165566
2025-11-25 11:49:36 +01:00
Felipe de Azevedo Piovezan
4b137e7446 [lldb][NFC] Remove code dupl in favour of a named variable in UnwindAssemblyInstEmulation (#169369) 2025-11-25 10:34:39 +00:00
Ramkumar Ramachandra
cb63e99e58 [VPlan] Include flags in VectorPointerRecipe::printRecipe (#169466)
The change is non-functional with respect to emitted IR.
2025-11-25 10:26:51 +00:00
Zhaoxin Yang
5e7631e14a [LoongArch][DAGCombiner] Combine vand (vnot ..) to vandn (#161037)
After this commit, DAGCombiner will have more opportunities to perform
vector folding. This patch includes several foldings, as follows:
- VANDN(x,NOT(y)) -> AND(NOT(x),NOT(y)) -> NOT(OR(X,Y))
- VANDN(x, SplatVector(Imm)) -> AND(NOT(x), NOT(SplatVector(~Imm)))
2025-11-25 17:46:28 +08:00
Simon Pilgrim
f287abd53e [DAG][X86] Improve custom i256/i512 AVX512 CTLZ/CTTZ Handling with MVT::i256/i512 (#168860)
This patch proposes to move the AVX512 CTLZ/CTTZ i256/i512 codegen to
ReplaceNodeResults to allow them to be declared as custom lowering -
this allows expansion of larger int types (e.g. i1024) to fallback to
them during their expansion.

However to declare these i256/i512 ops as custom, we need to add
MVT::i256/i512 simple types - I'm intending to add further large integer
handling in the future, some of which will use vector register
instructions, and its going to be much easier if this can be handled
with i128/i256/i512 types that match the vector register sizes.

This exposed a regression in NVPTX due to their use of EVT::isSimple()
to match their upper integer size bounds.
2025-11-25 09:46:14 +00:00
Michael Kruse
86fbaef99a [Flang] Move builtin .mod generation into runtimes (#137828)
Move building the .mod files from openmp/flang to openmp/flang-rt using
a shared mechanism. Motivations to do so are:

1. Most modules are target-dependent and need to be re-compiled for each
target separately, which is something the LLVM_ENABLE_RUNTIMES system
already does. Prime example is `iso_c_binding.mod` which encodes the
target's ABI. Most other modules have `#ifdef`-enclosed code as well.

2. CMake has support for Fortran that we should use. Among other things,
it automatically determines module dependencies so there is no need to
hardcode them in the CMakeLists.txt.

3. It allows using Fortran itself to implement Flang-RT. Currently, only
`iso_fortran_env_impl.f90` emits object files that are needed by Fortran
applications (#89403). The workaround of #95388 could be reverted.


Some new dependencies come into play:
* openmp depends on flang-rt for building `lib_omp.mod` and
`lib_omp_kinds.mod`. Currently, if flang-rt is not found then the
modules are not built.
* check-flang depends on flang-rt: If not found, the majority of tests
are disabled. If not building in a bootstrpping build, the location of
the module files can be pointed to using
`-DFLANG_INTRINSIC_MODULES_DIR=<path>`, e.g. in a flang-standalone
build. Alternatively, the test needing any of the intrinsic modules
could be marked with `REQUIRES: flangrt-modules`.
* check-flang depends on openmp: Not a change; tests requiring
`lib_omp.mod` and `lib_omp_kinds.mod` those are already marked with
`openmp_runtime`.

As intrinsic are now specific to the target, their location is moved
from `include/flang` to `<resource-dir>/finclude/flang/<triple>`. The
mechnism to compute the location have been moved from flang-rt
(previously used to compute the location of `libflang_rt.*.a`) to common
locations in `cmake/GetToolchainDirs.cmake` and
`runtimes/CMakeLists.txt` so they can be used by both, openmp and
flang-rt. Potentially the mechnism could also be shared by other
libraries such as compiler-rt.

`finclude` was chosen because `gfortran` uses it as well and avoids
misuse such as `#include <flang/iso_c_binding.mod>`. The search location
is now determined by `ToolChain` in the driver, instead of by the
frontend. Now the driver adds `-fintrinsic-module-path` for that
location to the frontend call (Just like gfortran does).
`-fintrinsic-module-path` had to be fixed for this because ironically it
was only added to `searchDirectories`, but not
`intrinsicModuleDirectories_`. Since the driver determines the location,
tests invoking `flang -fc1` and `bbc` must also be passed the location
by llvm-lit. This works like llvm-lit does for finding the include dirs
for Clang using `-print-file-name=...`.
2025-11-25 10:33:58 +01:00
Cullen Rhodes
a11e7347fb [llvm][nfc] Ignore OpenAI Codex artifacts (#162481)
Follow-up to #153853 to also ignore Codex artifacts [1]. AGENTS.md may
be at the root or in sub-directories, so unlike other Markdown config
files I've not prefixed it with '/'.

[1] https://github.com/openai/codex/blob/main/docs/getting-started.md#memory-with-agentsmd
2025-11-25 09:32:55 +00:00
Jie Fu
cf5234bac4 [AArch64] Silence a warning (NFC)
/llvm-project/llvm/lib/Target/AArch64/MachineSMEABIPass.cpp:952:12:
 error: unused variable 'SMEFnAttrs' [-Werror,-Wunused-variable]
  SMEAttrs SMEFnAttrs = AFI->getSMEFnAttrs();
           ^
1 error generated.
2025-11-25 17:23:26 +08:00
Pierre van Houtryve
a086fb2fbb [AMDGPU][gfx1250] Add wait_xcnt before any access that cannot be repeated (#168852)
The xcnt wait is actually required before any memory access that can
only be done once, so atomic stores and volatile accesses are affected.
This patch also ensures buffer instructions are handled.
2025-11-25 10:11:04 +01:00
Benjamin Maxwell
eb568d6d0c [AArch64][SME] Handle zeroing ZA and ZT0 in functions with ZT0 state (#166361)
In the MachineSMEABIPass, if we have a function with ZT0 state, then
there are some additional cases where we need to zero ZA and ZT0.

If the function has a private ZA interface, i.e., new ZT0 (and new ZA if
present). Then ZT0/ZA must be zeroed when committing the incoming ZA
save.

If the function has a shared ZA interface, e.g. new ZA and shared ZT0.
Then ZA must be zeroed on function entry (without a ZA save commit).

The logic in the ABI pass has been reworked to use an "ENTRY" state to
handle this (rather than the more specific "CALLER_DORMANT" state).
2025-11-25 09:09:47 +00:00
LLVM GN Syncbot
2ce363d252 [gn build] Port a39af125db 2025-11-25 08:55:46 +00:00
Gergely Bálint
ed95c4d6ec [BOLT][BTI] Add MCPlusBuilder::createBTI (#167305)
- creates a BTI j|c landing pad MCInst.
- create getBTIHintNum utility in AArch64/Utils, to make sure BOLT
  generates BTI immediates the same way as LLVM.
- add MCPlusBuilder unittests to cover new function.
2025-11-25 09:51:40 +01:00
Tomer Shafir
6193f2aeda [AArch64] Assert expandMOVImm prioritizes optimal single MOVZ/N (#169341)
The expansion of move immediate in `expandMOVImm` follows the priority
of the `MOV` alias. In addition, the selection there properly prefers
expansion based on perf optimality order. This change adds a simple
assert that `expandMOVImmSimple` expands a single optimal MOVZ/MOVK.
2025-11-25 10:48:23 +02:00
Dharuni R Acharya
a39af125db [NVVM] Move pretty-print functions from NVVMIntrinsicUtils.h to cpp file (#168997)
This patch moves the print functions from `NVVMIntrinsicUtils.h` to
`NVVMIntrinsicUtils.cpp`, a file created in the `llvm/lib/IR` directory.

Signed-off-by: Dharuni R Acharya <dharunira@nvidia.com>
2025-11-25 14:12:50 +05:30
Longsheng Mou
f817a1b039 [NFC] Fix typo of integer (#169325) 2025-11-25 16:06:13 +08:00
Maksim Panchenko
5490bcf4aa [BOLT] Add missing new line. NFC 2025-11-25 00:05:13 -08:00
Men-cotton
30c49a4022 [mlir][LLVMIR] Handle anonymous TBAA roots during metadata emission (#169167)
This commit enhances MLIR's TBAA export with support for anonymous TBAA roots. The import for this was around for a bit but the export was missing.

Fixes: #160721
2025-11-25 08:37:36 +01:00
David Green
1d64fd5d42 [ARM] Introduce intrinsics for MVE add/sub/mul under strict-fp. (#169156)
As far as I understand, the MVE fp vadd/vsub/vmul instructions will set
exception flags in the same ways as scalar fadd/fsub/fmul, but will not
honor flush-to-zero (for f32 they always flush, for f16 they follows the
fpsrc flags) and will always use the default rounding mode.

This means that we cannot convert the vadd_f23/vsub_f32/vmul_f32
intrinsics to llvm.constrained.fadd/fsub/fmul and then vadd/vsub/vmul
without changing the expected behaviour under strict-fp. This patch
introduces a set in intrinsics that we can use instead, going from
vadd_f32 -> llvm.arm.mve.vadd -> MVE_VADD.

The current implementations assumes that the standard variant of a
strictfp alternative will be a IRBuilder, this can be changed to take a
IRBuilder or IRInt.
2025-11-25 07:29:55 +00:00
David Green
44a7d2f22a [AArch64] Add patterns for add(x, trunc(shift)) (#168927)
This can be lowered to a 64bit add where we only use the bottom 32bits
of the result. It is conceptually the same as
https://alive2.llvm.org/ce/z/Xfz3Rf, but with the sext replaced by an
anyext.
2025-11-25 06:57:09 +00:00
Mend Renovate
675dc35d80 Update [Github] Update GHA Dependencies (#169257)
This PR contains the following updates:

| Package | Type | Update | Change | Pending |
|---|---|---|---|---|
| ghcr.io/llvm/ci-ubuntu-24.04-abi-tests | container | digest |
`f80125c` -> `9138b6a` | |
|
[github/codeql-action](https://redirect.github.com/github/codeql-action)
| action | patch | `v4.31.3` -> `v4.31.4` | `v4.31.5` |

---

> [!WARNING]
> Some dependencies could not be looked up. Check the Dependency
Dashboard for more information.

---

### Release Notes

<details>
<summary>github/codeql-action (github/codeql-action)</summary>

###
[`v4.31.4`](https://redirect.github.com/github/codeql-action/releases/tag/v4.31.4)

[Compare
Source](https://redirect.github.com/github/codeql-action/compare/v4.31.3...v4.31.4)

##### CodeQL Action Changelog

See the [releases
page](https://redirect.github.com/github/codeql-action/releases) for the
relevant changes to the CodeQL CLI and language packs.

##### 4.31.4 - 18 Nov 2025

No user facing changes.

See the full
[CHANGELOG.md](https://redirect.github.com/github/codeql-action/blob/v4.31.4/CHANGELOG.md)
for more information.

</details>

---

### Configuration

📅 **Schedule**: Branch creation - Between 12:00 AM and 12:59 AM, only on
Monday ( * 0 * * 1 ) (UTC), Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

👻 **Immortal**: This PR will be recreated if closed unmerged. Get
[config
help](https://redirect.github.com/renovatebot/renovate/discussions) if
that's undesired.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/llvm/llvm-project).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xNi4xIiwidXBkYXRlZEluVmVyIjoiNDIuMTkuNSIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
2025-11-24 22:06:27 -08:00
Ramkumar Ramachandra
c25e0d3e29 [VPlan] Simplify x + 0 -> x (#169394) 2025-11-25 05:58:41 +00:00
Lang Hames
488ed96d66 [orc-rt] Remove stray debugging output. NFCI. (#169451) 2025-11-25 16:39:36 +11:00
Pranav Bhandarkar
28fde68501 [Flang] - Enhance testing for strictly-nested teams in target regions. (#168437)
This patch enhances the semantics test for checking that teams
directives are strictly nested inside target directives.

Fixes https://github.com/llvm/llvm-project/issues/153173
2025-11-24 23:36:41 -06:00
Erik Enikeev
9c2d5e2994 [Mips] Set custom lowering for STRICT_FSETCC/STRICT_FSETCCS ops. (#168303) 2025-11-25 00:02:37 -05:00
Keith Smiley
9626c90c33 [bazel] Use zlib-ng from the BCR (#169450)
This way if a downstream project also uses this, it is dedup'd
2025-11-24 20:37:05 -08:00
Carl Ritson
b1111356e6 [AMDGPU] Pre-commit test for #169213 (NFC) 2025-11-25 13:08:15 +09:00
Petr Penzin
26362c6857 [RISCV] Add segmented tunes to tt-ascalon-d8 (#168800)
Add TuneOptimizedNFnSegmentedLoadStore tune flags to tt-ascalon-d8
processor definition.
2025-11-24 19:50:48 -08:00
Chandler Carruth
c6f433e880 [bazel][libc] Remove target compatibility restrictions for float128 (#169292)
The restrictions here aren't nearly as much about the OS as the compiler
and architecture, but the Bazel restriction was OS-based. Everything
seems to work well on even Arm64 macOS, and I would expect most BSDs and
other OSes to work well with Clang's support on x86-64.

The source code here already handles detecting when there is compiler
support for the type. And the users of this don't `select` or do
anything else to conditionally include the header, so it seems better to
not restrict access to the header from the build system, and instead
continue making the source code compatible or a no-op on relevant
configurations.
2025-11-24 19:19:26 -08:00
Erik Enikeev
f0bb5cfda7 [Mips] Add instruction selection for strict FP (#168870)
This consists of marking the various strict opcodes as legal, and
adjusting instruction selection patterns so that 'op' is 'any_op'. The
changes are similar to those in D114946 for AArch64 and #160696 for ARM.
Only Mips32/64 FPU instructions are affected.

Added lowering for for STRICT_FP_TO_UINT and STRICT_FP_TO_SINT ops.
2025-11-24 22:07:57 -05:00
Alexander Richardson
31d4150fd4 [TableGen] Change a reachable assert to a fatal error
I hit this when using a RegisterClass with a ValueTypeByHwMode that
was missing the RegInfos field. Add a test for this error.

Reviewed By: arsenm

Pull Request: https://github.com/llvm/llvm-project/pull/169439
2025-11-24 18:55:10 -08:00
Matthias Springer
6ec686735c [mlir][arith] Add support for sitofp, uitofp to ArithToAPFloat (#169284)
Add support for `arith.sitofp` and `arith.uitofp`.
2025-11-25 11:31:23 +09:00
Kewen Meng
8217c6415a Revert "[MC] Use a variant to hold MCCFIInstruction state (NFC)" (#169442)
Reverts llvm/llvm-project#164720

Revert to unblock bots.
https://lab.llvm.org/buildbot/#/builders/140/builds/34645
2025-11-24 18:30:02 -08:00
Craig Topper
b63a1883c1 [RISCV] Use a switch in VSETVLIInfo::print(). NFC (#169441)
This allows the compiler to verify we've covered all enum values.
2025-11-25 02:21:37 +00:00
Hristo Hristov
d7f6301390 [libc++][string] Applied [[nodiscard]] to non-member functions (#169330)
`[[nodiscard]]` should be applied to functions where discarding the
return value is most likely a correctness issue.
- https://libcxx.llvm.org/CodingGuidelines.html#apply-nodiscard-where-relevant
2025-11-25 04:02:40 +02:00
Matthias Springer
3db8ed0500 [mlir][arith] Add support for fptosi, fptoui to ArithToAPFloat (#169277)
Add support for `arith.fptosi` and `arith.fptoui`.
2025-11-25 10:50:20 +09:00