552254 Commits

Author SHA1 Message Date
Ryosuke Niwa
2f9a458f35
[WebKit checkers] Treat asm brk as trivial (#155046)
Like other functions which results in abort, treat asm brk instruction
as trivial.
2025-09-11 14:49:59 -07:00
Aiden Grossman
73b24d27d8 Reapply "[llvm] Use lit internal shell by default"
This reverts commit 5125f476b2f90ccf157c78d73bc6fe14c4413a27.

This was reverted because it broke some debuginfod tests. Those have been fixed
now in #158141. Relanding now and hoping it sticks this time.
2025-09-11 21:27:27 +00:00
Aiden Grossman
e87dc2ebf9
[llvm-debuginfod] Update tests to work with internal shell (#158141)
This patch updates the llvm-debuginfod tests to work with the lit
internal shell. One test was missing env before environment variables
and another was using a brace expansion.
2025-09-11 14:26:13 -07:00
Jason Molenda
20e55f359d [lldb][NFC] Mark API test skipIfRemote to avoid a bot
The lldb-remote-linux-ubuntu bot (and only this bot) is still failing
for TestCortexMExceptionUnwind.py because the Target triple is
somehow inheriting a non-Darwin OS.  I marked this API test
skipUnlessDarwin but this bot can be identified more specifically
by a skipIfRemote test.  There's no benefit to running this test
remotely anyway; it doesn't execute any code.
2025-09-11 14:19:44 -07:00
jtstogel
e0817c6427
[bazel] Redo LSP changes to fix bazel build (#158150)
Reverts llvm/llvm-project#157691

Change was relanded in https://github.com/llvm/llvm-project/pull/157885
2025-09-11 14:15:01 -07:00
Gábor Spaits
43561ad204
[BasicBlockUtils] Handle funclets when detaching EH pad blocks (#157363)
Fixes #148052 .

When removing EH Pad blocks, the value defined by them becomes poison. These poison values are then used by `catchret` and `cleanupret`, which is invalid. This commit replaces those unreachable `catchret` and `cleanupret` instructions with `unreachable`.
2025-09-11 22:52:16 +02:00
nerix
65787728b7
[LLDB][NativePDB] Implement AddSymbols (#154121)
This PR implements `SymbolFileNativePDB::AddSymbols` which adds public
symbols to the symbol table.

These symbols are found in the publics stream. It contains mangled names
coupled with addresses. Addresses are a pair of (segment, offset).
If I understood correctly, then the segment is the section ID from the
COFF header. Sections are already
[constructed](c48ec7fb60/lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.cpp (L1048))
using this 1-based index ([MS
docs](https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#section-table-section-headers)).
This allows us to use `section_list->FindSectionByID`.
2025-09-11 22:35:19 +02:00
Louis Dionne
82218fb1db [libc++] Use the correct pull-request base and targets for the benchmarking job 2025-09-11 16:33:11 -04:00
Ryosuke Niwa
b64ed9d79e
[WebKit checkers] Recognize NS_RETURNS_RETAINED and CF_RETURNS_RETAINED. (#157629)
This PR adds the support for treating a function return value to be safe
if the function is annotated with NS_RETURNS_RETAINED or
CF_RETURNS_RETAINED.
2025-09-11 13:32:51 -07:00
Mircea Trofin
3097688a47
[SimplifyCFG] Set branch weights when merging conditional store to address (#154841) 2025-09-11 13:21:59 -07:00
Tomohiro Kashiwada
ca09801bd0
[LLVM][Coverage][Unittest] Fix dangling reference in unittest (#147118)
In loop of `writeAndReadCoverageRegions`, `OutputFunctions[I].Filenames`
references to contents of `Filenames` after returning from
`readCoverageRegions` but `Filenames` will be cleared in next call of
`readCoverageRegions`, causes dangling reference.
The lifetime of the contents of `Filenames` must be equal or longer than
`OutputFunctions[I]`, thus it has been moved into `OutputFunctions[I]`
(typed `OutputFunctionCoverageData`).
2025-09-11 23:12:54 +03:00
Matt Arsenault
eb3b7ddc69
X86: Fix win64 tail call regression for tail call to loaded pointer (#158055)
Fix regression after 62f2641d603db9aef99dd5c434a1dfe7d3f56346. Previous
patch handled the register case, but the memory case snuck another use
of ptr_rc_tailcall hidden inside i64mem_TC
2025-09-11 23:12:01 +03:00
Changpeng Fang
05a705efda
[AMDGPU] Restrict to VGPR only for mfma scale operands (#158117)
Restrict to VGPR only (VRegSrc_32) for mfma scale operands to workaround
a hardware design defect: For all Inline/SGPR constants, SP HW use bits
[30:23] as the scale.

TODO: We may still be able to allow Inline Constants/SGPR, with a proper
shift, to obtain a potentially better performance.

Fixes: SWDEV-548629
2025-09-11 13:10:33 -07:00
Louis Dionne
73e64e534f [libc++] Fix sed pattern to extract benchmarks from the comment body 2025-09-11 16:05:27 -04:00
Henrik G. Olsson
9eb17cc034
[Utils] Add support for split-file to diff_test_updater (#157765) 2025-09-11 12:58:59 -07:00
Reid Kleckner
4ae520bfb4 [cmake] Add missing shared library dependency after f3efbce 2025-09-11 19:58:25 +00:00
Louis Dionne
bd6e217ac6 [libc++] Remove concurrency in the right libc++ job
Early-cancellation should have been removed from libcxx-run-benchmarks.yml
in the first place, not libcxx-build-and-test.yaml.
2025-09-11 15:56:23 -04:00
Joel E. Denny
0e3c5566c0
[PGO] Add llvm.loop.estimated_trip_count metadata (#152775)
This patch implements the `llvm.loop.estimated_trip_count` metadata
discussed in [[RFC] Fix Loop Transformations to Preserve Block
Frequencies](https://discourse.llvm.org/t/rfc-fix-loop-transformations-to-preserve-block-frequencies/85785).
As the RFC explains, that metadata enables future patches, such as PR
#128785, to fix block frequency issues without losing estimated trip
counts.
2025-09-11 15:55:18 -04:00
Louis Dionne
e08588d4ae [libc++] Get rid of concurrency in the libc++ benchmarking job 2025-09-11 15:52:32 -04:00
Michael Jones
0ab2df2e47
[libc][bazel] add tests and targets for ctype (#158124)
Adds tests and targets for all the ctype functions.
2025-09-11 12:47:28 -07:00
Michael Jones
b4650a4378
[libc][bazel] Add tests and targets for inttypes (#158127)
Adds tests and targets for the remaining inttypes functions.
2025-09-11 12:46:47 -07:00
Louis Dionne
162755bd39 [libc++] Add a workflow that builds benchmarks when commenting on a PR
This worfklow is still being tested, since I can't figure out how to
trigger it without actually merging it to main.
2025-09-11 15:46:19 -04:00
Florian Hahn
d5e7c27d53
[SCEVExp] Remove special-case handling umul_with_overflow by 1 (NFCI).
b50ad945dd4faa288 added umul_with_overflow simplifications to
InstSimplifyFolder (used by SCEVExpander) and 9b1b93766dfa34ee9 added
dead instruction cleanup to SCEVExpander.

Remove special handling of umul by 1, handled automatically due to the
changes above.
2025-09-11 20:09:10 +01:00
Druzhkov Sergei
770cd432a6
[lldb-dap] Add invalidated event (#157530)
This patch fixes the problem, when after a `setVariable` request
pointers and references to the variable are not updated. VSCode doesn't
send a `variables` request after a `setVariable` request, so we should
trigger it explicitly via`invalidated` event .Also, updated
`writeMemory` request in similar way.
2025-09-11 12:06:46 -07:00
Alexey Samsonov
6ab2b87451
[libc] Clean up errno header usage in some more tests. (#157974)
Either remove spurious libc_errno.h which are no longer needed, or
migrate some tests to ErrnoCheckingTest to remove manual errno
manipulation.
2025-09-11 11:38:30 -07:00
Adrian Prantl
e0117a555d
[lldb] Fix undefined behavior (#158119)
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/2178/consoleText

```
[2025-09-11T13:10:53.352Z] /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp:14138:35: runtime error: signed integer overflow: 2147483624 + 608 cannot be represented in type 'int32_t' (aka 'int')
[2025-09-11T13:10:53.352Z] SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior /Users/ec2-user/jenkins/workspace/llvm.org/lldb-cmake-sanitized/llvm-project/lldb/source/Plugins/Instruction/ARM/EmulateInstructionARM.cpp:14138:35 in 
```
2025-09-11 11:07:38 -07:00
Reid Kleckner
f3efbce4a7
[llvm] Move data layout string computation to TargetParser (#157612)
Clang and other frontends generally need the LLVM data layout string in
order to generate LLVM IR modules for LLVM. MLIR clients often need it
as well, since MLIR users often lower to LLVM IR.

Before this change, the LLVM datalayout string was computed in the
LLVM${TGT}CodeGen library in the relevant TargetMachine subclass.
However, none of the logic for computing the data layout string requires
any details of code generation. Clients who want to avoid duplicating
this information were forced to link in LLVMCodeGen and all registered
targets, leading to bloated binaries. This happened in PR #145899,
which measurably increased binary size for some of our users.

By moving this information to the TargetParser library, we
can delete the duplicate datalayout strings in Clang, and retain the
ability to generate IR for unregistered targets.

This is intended to be a very mechanical LLVM-only change, but there is
an immediately obvious follow-up to clang, which will be prepared
separately.

The vast majority of data layouts are computable with two inputs: the
triple and the "ABI name". There is only one exception, NVPTX, which has
a cl::opt to enable short device pointers. I invented a "shortptr" ABI
name to pass this option through the target independent interface.
Everything else fits. Mips is a bit awkward because it uses a special
MipsABIInfo abstraction, which includes members with codegen-like
concepts like ABI physical registers that can't live in TargetParser. I
think the string logic of looking for "n32" "n64" etc is reasonable to
duplicate. We have plenty of other minor duplication to preserve
layering.

---------

Co-authored-by: Matt Arsenault <arsenm2@gmail.com>
Co-authored-by: Sergei Barannikov <barannikov88@gmail.com>
2025-09-11 11:05:29 -07:00
Erick Ochoa Lopez
b812e3d61a
[mlir][vector] Add LinearizeVectorToElements (#157740)
Co-authored-by: James Newling <james.newling@gmail.com>
2025-09-11 13:58:42 -04:00
Erick Ochoa Lopez
9d19250610
[mlir][vector] Add vector.to_elements unrolling (#157142)
This PR adds support for unrolling `vector.to_element`'s source operand.

It transforms

```mlir
%0:8 = vector.to_elements %v : vector<2x2x2xf32>
```

to

```mlir
%v0 = vector.extract %v[0] : vector<2x2xf32> from vector<2x2x2xf32>
%v1 = vector.extract %v[1] : vector<2x2xf32> from vector<2x2x2xf32>
%0:4 = vector.to_elements %v0 : vector<2x2xf32>
%1:4 = vector.to_elements %v1 : vector<2x2xf32>
// %0:8 = %0:4 - %1:4
```

This pattern will be applied until there are only 1-D vectors left.

---------

Signed-off-by: hanhanW <hanhan0912@gmail.com>
Co-authored-by: hanhanW <hanhan0912@gmail.com>
Co-authored-by: Jakub Kuderski <kubakuderski@gmail.com>
2025-09-11 13:56:57 -04:00
Nico Weber
ddb2e34334 [lld/mac] Fix comment typos to cycle bots 2025-09-11 13:51:00 -04:00
Arthur Eubanks
71da9288f6 [gn build] Add missing deps 2025-09-11 17:42:33 +00:00
Arthur Eubanks
5582f0ca1d [gn build] Manually port a3a25996 2025-09-11 17:41:52 +00:00
Thurston Dang
2fca446779
[msan] Handle AVX512 pack with saturation intrinsics (#157984)
Approximately handle avx512_{packssdw/packsswb/packusdw/packuswb} with
the existing handleVectorPackIntrinsic(), instead of relying on the
default (strict) handler.
2025-09-11 10:41:40 -07:00
Grigory Pastukhov
8c0f3b6e8f
[BOLT] Fix debug line emission for functions in multiple compilation units (#151230)
This patch fixes a bug in BOLT's debug line emission where functions
that belong to multiple compilation units (such as inline functions in
header files) were not handled correctly. Previously, BOLT incorrectly
assumed that a binary function could belong to only one compilation
unit, leading to incomplete or incorrect debug line information.

### **Problem**

When a function appears in multiple compilation units (common scenarios
include):

*   Template instantiated functions
* Inline functions defined in header files included by multiple source
files

BOLT would only emit debug line information for one compilation unit,
losing debug information for other CUs where the function was compiled.
This resulted in incomplete debugging information and could cause
debuggers to fail to set breakpoints or show incorrect source locations.

### **Root Cause**

The issue was in BOLT's assumption that each binary function maps to
exactly one compilation unit. However, when the same function (e.g., an
inline function from a header) is compiled into multiple object files,
it legitimately belongs to multiple CUs in the final binary.
2025-09-11 10:41:11 -07:00
Nikita Popov
299ba5dae1 [SupportLSP] Fix dependency on Support 2025-09-11 19:40:10 +02:00
Christopher Ferris
7628abdb87
[scudo] Add tracing framework (#156112)
Add a methodology to allow tracing. By default, this is disabled, but it
can be enabled for any OS that supports it.

Currently, only releaseToOSXXX functions have trace points added.
2025-09-11 10:23:29 -07:00
Bertik23
a3a25996b1
[LLVM][MLIR] Move LSP server support library from MLIR into LLVM (#157885)
This is a second PR on this patch (first #155572), that fixes the
linking problem for `flang-aarch64-dylib` test.

The SupportLSP library was made a component library.

---

This PR moves the generic Language Server Protocol (LSP) server support
code that was copied from clangd into MLIR, into the LLVM tree so it can
be reused by multiple subprojects.

Centralizing the generic LSP support in LLVM lowers the barrier to
building new LSP servers across the LLVM ecosystem and avoids each
subproject maintaining its own copy.

The code originated in clangd and was copied into MLIR for its LSP
server. MLIR had this code seperate to be reused by all of their LSP
server. This PR relocates the MLIR copy into LLVM as a shared component
into LLVM/Support. If this is not a suitable place, please suggest a
better one.

A follow up to this move could be deduplication with the original clangd
implementation and converge on a single shared LSP support library used
by clangd, MLIR, and future servers.
What changes

mlir/include/mlir/Tools/lsp-server-support/{Logging, Protocol,
Transport}.h moved to llvm/include/llvm/Support/LSP
mlir/lib/Tools/lsp-server-support/{Logging, Protocol, Transport}.cpp
moved to llvm/lib/Support/LSP

and their namespace was changed from mlir to llvm

I ran clang-tidy --fix and clang-format on the whole moved files (last
two commits), as they are basically new files and should hold up to the
code style used by LLVM.

MLIR LSP servers where updated to include these files from their new
location and account for the namespace change.

This PR is made as part of the LLVM IR LSP project
([RFC](https://discourse.llvm.org/t/rfc-ir-visualization-with-vs-code-extension-using-an-lsp-server/87773))
2025-09-11 17:17:52 +00:00
Louis Dionne
8da3ab12ce [libc++] Ensure benchmark comparison output ends with a newline
Otherwise, it doesn't compose well with anything else that produces
output.
2025-09-11 12:16:05 -04:00
Louis Dionne
8cbd8f044b
[libc++] Add scripts to build and test libc++ at a specified commit (#158104)
This is useful to perform historical analyses, bisections or establish a
benchmarking baseline after making some changes on a branch. For
example, one can run benchmarks against `main` and easily compare them
to the results on the current feature branch with:

    libcxx/utils/test-at-commit --commit $(git merge-base main HEAD) \
                                -B build/baseline -- <lit args>
    libcxx/utils/libcxx-lit build/candidate <lit args>
    libcxx/utils/compare-benchmarks \
        <(libcxx/utils/consolidate-benchmarks build/baseline) \
        <(libcxx/utils/consolidate-benchmarks build/candidate)

Doing this without these scripts would require checking out the desired
baseline, setting up the build directory and running the tests manually.
With these scripts, this can automatically be automated without dirtying
the current checkout.
2025-09-11 12:14:41 -04:00
Jan Svoboda
d1c0b1b620
[clang] Use VFS for -fopenmp-host-ir-file-path (#156727)
This is a follow-up to #150124. This PR makes it so that the
`-fopenmp-host-ir-file-path` respects VFS overlays, like any other input
file.
2025-09-11 09:08:47 -07:00
Joseph Huber
05bbb947cf
[X86] Relax AVX ABI warning on internal functions (#157570)
Summary:
The vector target should be able to handle vector sizes that are
multiples of the native size, this is useful for implementing math
routines that want to temporarily use a high precision for example.
However, currently this will emit a warning on x86 if any function calls
are involved. https://godbolt.org/z/dK7hGndYh.

I believe that we should be able to relax the ABI restriction if the
functions are completely internal and there were no explicitly states
attributes to conflict. Because the ABI is not exported outside the TU
we should be safe to assume that it won't bite us. In the case that one
call has no features and other does, that will still cause an error. I
may be wrong on this assumption however.

Fixes: https://github.com/llvm/llvm-project/issues/128361
2025-09-11 11:06:20 -05:00
Amr Hesham
5437d90bb7
[CIR] Upstream FPToFPBuiltin ATanOp (#157496)
Upstream support for FPToFPBuiltin ATanOp
2025-09-11 18:01:12 +02:00
Aiden Grossman
5125f476b2 Revert "Reapply "[llvm] Use lit internal shell by default""
This reverts commit f869d7a1b100c9f9fc5bb06effcf4f73346c0919.

This broke some debuginfod tests that are not run by default in most CI
configurations. Reverting for now until I have time to update the tests
and figure out how to get them built locally.
2025-09-11 15:57:32 +00:00
Donát Nagy
b642e8bfbb
[analyzer] Improve messaging in security.VAList (#157846)
Previously the checker `security.VAList` only tracked the set of the
inintialized `va_list` objects; this commit replaces this with a mapping
that can distinguish the "uninitialized" `va_list` objects from the
"already released" ones. Moreover, a new "unknown" state is introduced
to replace the slightly hacky solutions that checked the `Symbolic`
nature of the region.

In addition to sligthly improving the messages, this commit also
prepares the ground for a follow-up change that would introduce an
"indeterminate" state (which needs `va_end` but cannot be otherwise
used) to model the requirements of SEI CERT rule MSC39-C, which states:

> The va_list may be passed as an argument to another function, but
> calling va_arg() within that function causes the va_list to have an
> indeterminate value in the calling function. As a result, attempting
> to read variable arguments without reinitializing the va_list can have
> unexpected behavior.
2025-09-11 17:57:22 +02:00
David Green
3270d98641
[AArch64] Verify OPERAND_SHIFT_MSL and OPERAND_IMPLICIT_IMM_0 (#157031)
This adds some basic verification for the new OPERAND_SHIFT_MSL and the
existing OPERAND_IMPLICIT_IMM_0 immediate operand types, that should be
264/272 or 0 respectively.
2025-09-11 16:56:25 +01:00
Sam Elliott
e1e65a4d91
[RISCV] Fix GPRPairNoX0 Disassembly (#158001)
Both GPRPair and GPRPairNoX0 were using the same decoder before this
change, which meant that GPRPairNoX0 would disassemble zeroes to the
`X0_Pair`.

This ensures the NoX0 decoder correctly fails to decode zeroes.
2025-09-11 08:51:37 -07:00
Andrzej Warzyński
89e32acde5
[mlir][vector] Remove hooks deprecated pre Release/21 branch (#157806)
As mentioned on Discourse,
  * https://discourse.llvm.org/t/psa-vector-standardise-operand-naming

I am removing the deprecated Vector hooks following the creation of the
release/21 branch.

The release/21 branch was created on July 15 (about two months ago) as
noted in the LLVM 21.x release announcement
* https://discourse.llvm.org/t/llvm-21-x-release-information-and-branching
2025-09-11 16:11:16 +01:00
Nathan Gauër
1f0003f1de
Reapply "[HLSL] Rewrite semantics parsing" (#157718) (#158044)
This is a re-land of #152537 now that #157841 is merged.
2025-09-11 17:01:52 +02:00
Kazu Hirata
b6674fe111
[llvm] Proofread Extensions.rst (#158008) 2025-09-11 07:54:44 -07:00
Kazu Hirata
2c12308f69
[Support] Remove trivial_helper, is_copy_assignable, and is_move_assignable (#158007)
These seem to be all dead.  This patch removes them.
2025-09-11 07:54:35 -07:00