Commit Graph

559794 Commits

Author SHA1 Message Date
Lang Hames
17f0afe40a [ORC] Merge GetDylibInterface.h APIs into MachO.h. (#168462)
These APIs are MachO specific, and the interfaces are about to be
extended to support more MachO-specific behavior. For now it makes sense
to group them with other MachO specific APIs in MachO.h.
2025-11-18 11:51:08 +11:00
Eric Christopher
f6ebb357e5 Add documentation about CMAKE_OSX_SYSROOT (#168024)
Add documentation about CMAKE_OSX_SYSROOT so that folks bringing up on
OSX can have a clean test run.
2025-11-17 16:39:36 -08:00
Jonas Devlieghere
186b8ba368 [lldb] Update Lua typemap for #167764 (#168464) 2025-11-18 00:37:24 +00:00
LLVM GN Syncbot
307d7ed92e [gn build] Port 49d5bb0ad0 2025-11-18 00:27:32 +00:00
LLVM GN Syncbot
ec3e5dcf8f [gn build] Port 472e4ab0b0 2025-11-18 00:27:31 +00:00
LLVM GN Syncbot
be96137750 [gn build] Port 1425d75c71 2025-11-18 00:27:30 +00:00
Eli Friedman
5ba8579312 [Arm64EC] Preserve X9 for indirect calls. (#167782)
Arm64EC indirect calls use a function __os_arm64x_check_icall... this
has one obvious return value, x11, which is the function to call.
However, it actually returns one other important value: x9, which is the
final destination for the emulator after the call. If the call is
calling x64 code, x9 is used by the thunk.

Previously, we didn't model this, and it mostly worked because the
compiler usually doesn't modify x9 in the narrow window between the
check, and the call. That said, it can happen in some cases; one
reliable way is to do an indirect tail-call with stack protectors
enabled. (You can also just get unlucky with register allocation, but
it's harder to write a testcase for that.)

This patch uses the cfguardtarget bundle to simplify the calling
convention handling, for similar reasons that x64 uses it: modifying
arbitrary calls is difficult without a separate marking.

Fixes #167430.
2025-11-17 16:24:40 -08:00
Aiden Grossman
efee326373 [CI] Gracefully Fail when Job Completion Timestamp is None (#168457)
There seem to be cases where the workflow status is completed but the
jobs have not completed. We need to gracefully handle these changes to
avoid a crash loop in the metrics container.
2025-11-17 16:24:12 -08:00
Aiden Grossman
eb20b53925 Revert "Reapply "[compiler-rt] Default to Lit's Internal Shell" (#168232)"
This reverts commit bde9062418.

This caused failures on Darwin that were not caught by upstream
buildbots. Reverting for now to give myself some time to fix.
2025-11-18 00:21:06 +00:00
Nico Weber
2c4bce4048 [gn] port 320c18a066 (systemz SDNodeInfo) 2025-11-17 19:11:15 -05:00
Pranav Kant
1bf902ec59 [bazel] Fix #168108 (#168461) 2025-11-18 00:10:58 +00:00
Nico Weber
26b15b7614 [gn] port 43dacd07f6 (ppc SDNodeInfo) 2025-11-17 19:05:18 -05:00
Changpeng Fang
5f38ae4a77 [AMDGPU] update LDS block size for gfx1250 (#167614)
LDS block size should be 2048 bytes (512 dwords) based on current spec.
2025-11-17 16:03:47 -08:00
Nico Weber
0f0cf84dba [gn] port 900c517919 (amdgpu SDNodeInfo) 2025-11-17 18:57:50 -05:00
Fabrice de Gans
865c92be03 llvm: Export ilist_node_base template specialization (#168094)
The core LLVM library implements a specialization for
`ilist_node_base<true, void>`, which is used by other components. This
is needed to link properly when building LLVM as a library on Windows.

This effort is tracked in #109483.
2025-11-17 15:45:53 -08:00
Alexey Samsonov
da61dd28c6 [libc] Move mbtowc, mbstowcs and inverse functions to stdlib.h (#168455)
These functions should be declared in `stdlib.h`, not `wchar.h`, as
confusing as it is. Move them to the proper header file and matching
directories in src/ and test/ trees.

This was discovered while testing libc++ build against llvm-libc, which
re-declares functions like mbtowc in std-namespace in `<cstdlib>`
header, and then uses those functions in its locale implementation.
2025-11-17 15:43:42 -08:00
Jeremy Furtek
b48f293566 Fix build breakage (MLIR LLVM dialect requires MLIRInferIntRangeInterface) (#168440)
This MR fixes a recent build breakage by this MR:
https://github.com/llvm/llvm-project/pull/166648

(Post-merge build error here:
https://lab.llvm.org/buildbot/#/builders/138/builds/21929)

The `MLIRInferIntRangeInterface` library is now a public dependency of
`MLIRLLVMDialect`.
2025-11-17 15:30:39 -08:00
David Peixotto
3bec613d88 [lldb] Add helper to create mock objects for dwarf expression tests (#167956)
This commit adds a new helper function that creates various mock objects
that can be used in dwarf expression testing. The optional register
value and memory contents are used to create MockProcessWithMemRead and
MockRegisterContext that can return expected memory contents and
register values.

This simplifies some tests by removing redundant code that creates these
objects in individual tests and consolidates the logic into one place.
2025-11-17 15:27:23 -08:00
Christopher Ferris
7a14ef0293 [scudo] Skip test if mlock fails. (#168448)
Some linux versions might not support the mlock call, so skip that part
of the test if the mlock fails.
2025-11-17 15:25:33 -08:00
Teresa Johnson
5cf5eb7714 [MemProf] Fixup edges for largest N cold contexts (#167599)
We build the callsite graph by first adding nodes and edges for all
allocation contexts, then match the interior callsite nodes onto actual
calls (IR or summary), which due to inlining may result in the
generation of new nodes representing the inlined context sequence. We
attempt to update edges correctly during this process, but in the case
of recursion this becomes impossible to always get correct.
Specifically, when creating new inlined sequence nodes for stack ids on
recursive cycles we can't always update correctly, because we have lost
the original ordering of the context.

This PR introduces a mechanism, guarded by -memprof-top-n-important=
flag, to keep track of extra information for the largest N cold
contexts. Another flag -memprof-fixup-important (enabled by default)
will perform more expensive fixup of the edges for those largest N cold
contexts, by saving and walking the original ordered list of stack ids
from the context.
2025-11-17 15:00:36 -08:00
Sergei Barannikov
43dacd07f6 [PowerPC] TableGen-erate SDNode descriptions (#168108)
This allows SDNodes to be validated against their expected type profiles
and reduces the number of changes required to add a new node.

The validation functionality has detected several issues, see
`PPCSelectionDAGInfo::verifyTargetNode()`.

Most of the nodes have a description in `*.td` files and were
successfully "imported". Those that don't have a description are listed
in the enum in `PPCSelectionDAGInfo.td`. These nodes are not validated.

Part of #119709.

Pull Request: https://github.com/llvm/llvm-project/pull/168108
2025-11-17 22:58:26 +00:00
Razvan Lupusoru
f0f53326c7 [mlir][acc] Add ACCImplicitRoutine pass for implicit acc routine (#168433)
This change adds the ACCImplicitRoutine pass which implements the
OpenACC specification for implicit routine directives (OpenACC 3.4 spec,
section 2.15.1).

According to the specification: "If no explicit routine directive
applies to a procedure whose definition appears in the program unit
being compiled, then the implementation applies an implicit routine
directive to that procedure if any of the following conditions holds:
The procedure is called or its address is accessed in a compute region."

The pass automatically generates `acc.routine` operations for functions
called within OpenACC compute constructs or within existing routine
functions that do not already have explicit routine directives. It
recursively applies implicit routine directives while avoiding infinite
recursion when dependencies form cycles.

Key features:
- Walks through all OpenACC compute constructs (parallel, kernels,
serial) to identify function calls
- Creates implicit `acc.routine` operations for functions without
explicit routine declarations
- Recursively processes existing `acc.routine` operations to handle
transitive dependencies
- Avoids infinite recursion through proper tracking of processed
routines
- Respects device-type specific bind clauses to skip routines bound to
different device types

Requirements:
- Function operations must implement `mlir::FunctionOpInterface` to be
identified and associated with routine directives.
- Call operations must implement `mlir::CallOpInterface` to detect
function calls and traverse the call graph.
- Optionally pre-register `acc::OpenACCSupport` if custom behavior is
needed for determining if a symbol use is valid within GPU regions (such
as functions which are already considerations for offloading even
without `acc routine` markings)

Co-authored-by: delaram-talaashrafi<dtalaashrafi@nvidia.com>
2025-11-17 14:55:52 -08:00
Prabhu Rajasekaran
e89e359313 [libc]Github] Fix typo on build_type param (#168453)
There is an extra underscore in build_type param in #167583 patch.
Fixing it in this PR.
2025-11-17 14:25:58 -08:00
John Harrison
88b3969dfe [lldb-dap] Address a unit test race condition during initialization. (#167981)
During the initialization sequence in our tests the first 'threads'
response sould only be kept if the process is actually stopped,
otherwise we will have stale data.

In VSCode, during the debug session startup sequence immediately after
'configurationDone' a 'threads' request is made. This initial request is
to retrieve the main threads name and id so the UI can be populated.
However, in our tests we do not want to cache this value unless the
process is actually stopped. We do need to make this initial request
because lldb-dap is caching the initial thread list during
configurationDone before the process is resumed. We need to make this
call to ensure the cached initial threads are purged.

I noticed this in a CI job for another review
(https://github.com/llvm/llvm-project/actions/runs/19348261989/job/55353961798)
where the tests incorrectly failed to fetch the threads prior to
validating the thread names.
2025-11-17 14:19:22 -08:00
Ben Kallus
6245a4f875 Add support for the .base64 directive (#165549)
Starting in version 15, GCC emits a `.base64` directive instead of
`.string` or `.ascii` for char arrays of length `>= 3`.

See [this godbolt link](https://godbolt.org/z/ebhe3oenv) for an example.

This patch adds support for the .base64 directive to AsmParser.cpp, so
tools like `llvm-mc` can process the output of GCC more effectively.

This addresses #165499.
2025-11-17 14:14:08 -08:00
Guy David
7d0a2082bf [AArch64] Treat COPY between cross-register banks as expensive (#167661)
The motivation is to allow passes such as MachineLICM to hoist trivial
FMOV instructions out of loops, where previously it didn't do so even
when the RHS is a constant.
On most architectures, these expensive move instructions have a latency
of 2-6 cycles, and certainly not cheap as a 0-1 cycle move.
2025-11-18 00:05:54 +02:00
Erick Ochoa Lopez
909c9aacea [mlir][amdgpu] Add lowerings for ScaledExtPacked816 (#168123)
* Adds lowerings for amdgpy.scaled_ext_packed816
* updates verifiers
2025-11-17 16:51:52 -05:00
Ziqing Luo
3f60d22051 [-Wunsafe-buffer-usage] Fold the expression "cond ? E1 : E2" when checking safe patterns, if "cond" is a constant (#167989)
In `-Wunsafe-buffer-usage`, many safe pattern checks can benefit from
constant folding. This commit improves null-terminated pointer checks by
folding conditional expressions.

rdar://159374822

---------

Co-authored-by: Balázs Benics <benicsbalazs@gmail.com>
2025-11-17 13:43:53 -08:00
Alexey Samsonov
92c8c87c49 [libc] Implement wcstod and wcstold. (#168020)
These are simply implemented as specializations of strtofloatingpoint
for double / long double and for wchar_t. The unit tests are copied from
the strtod / strtold ones.
2025-11-17 13:42:12 -08:00
Florian Hahn
3cba379e3d [VPlan] Populate and use VPIRMetadata from VPInstructions (NFC) (#167253)
Update VPlan to populate VPIRMetadata during VPInstruction construction
and use it when creating widened recipes, instead of constructing
VPIRMetadata from the underlying IR instruction each time.

This centralizes VPIRMetadata in VPInstructions and ensures metadata is
consistently available throughout VPlan transformations.

PR: https://github.com/llvm/llvm-project/pull/167253
2025-11-17 21:28:49 +00:00
Pranav Kant
ed617bd780 [bazel][buildifier] reformat changes in #168434 (#168443) 2025-11-17 13:21:59 -08:00
Daniel Wedzicha
0d8c29409c Fixed typo in llvm-otool (#168395) 2025-11-17 21:13:24 +00:00
Pranav Kant
7693f124ff [mlir][bazel] Fix #167957 (#168441) 2025-11-17 13:08:06 -08:00
Louis Dionne
aae2b891e8 [libc++] Replace a few .compile.fail.cpp tests by proper clang-verify tests (#167346)
We want to eliminate all .compile.fail.cpp tests since they are brittle:
these tests pass regardless of the specific compilation error, which
means that e.g. a mising include will render the test null.

This is not an exhaustive pass, just a few tests I stumbled upon.
2025-11-17 16:07:45 -05:00
Louis Dionne
24c524d014 [libc++] Enable compiler-rt when performing a bootstrapping build (#167065)
Otherwise, we end up using whatever system-provided compiler runtime is
available, which doesn't work on macOS since compiler-rt is located
inside the toolchain path, which can't be found by default.

However, disable the tests for compiler-rt since those are linking
against the system C++ standard library while using the just-built
libc++ headers, which is non-sensical and leads to undefined references
on macOS.
2025-11-17 16:07:28 -05:00
Adrian Prantl
54c2c7cf0d [LLDB] Fix test compilation errors under asan (NFC) (#168408)
https://green.lab.llvm.org/job/llvm.org/view/LLDB/job/lldb-cmake-sanitized/2744/consoleText
2025-11-17 13:01:52 -08:00
Florian Hahn
321b9d190b [VPlan] Replace VPIRMetadata::addMetadata with setMetadata. (NFC)
Replace addMetadata with setMetadata, which sets metadata, updating
existing entries or adding a new entry otherwise.

This isn't strictly needed at the moment, but will be needed for
follow-up patches.
2025-11-17 20:55:18 +00:00
Alan Li
b00588ffb4 Fix bazel dep caused by f5b73760 (#168436) 2025-11-17 20:46:14 +00:00
Pranav Kant
4bec74a9fb [mlir][bazel] Fix #168066 (#168435) 2025-11-17 12:42:46 -08:00
Pranav Kant
3fb374256b [bazel] Fix #168113 (#168434) 2025-11-17 12:38:57 -08:00
Pranav Kant
bac8d01a4d [bazel][libc] Fixes #165219 (#168429) 2025-11-17 20:18:01 +00:00
Ebuka Ezike
557a6b826b [lldb][NFC] use llvm::erase_if to remove non matching types (#168279) 2025-11-17 20:15:33 +00:00
Prabhu Rajasekaran
b32c434426 [libc][Github] Perform baremetal libc builds (#167583)
Currently there are no 32 bit presubmit builds for libc. This PR
performs 32 bit build only (no test) to check any changes that land in
libc break 32 bit builds.

Co-authored-by: Aiden Grossman <aidengrossman@google.com>
2025-11-17 12:08:39 -08:00
Sergei Barannikov
320c18a066 [SystemZ] TableGen-erate node descriptions (#168113)
This allows SDNodes to be validated against their expected type profiles
and reduces the number of changes required to add a new node.

There is only one node that is missing a description -- `GET_CCMASK`,
others were successfully imported.

Part of #119709.

Pull Request: https://github.com/llvm/llvm-project/pull/168113
2025-11-17 23:03:45 +03:00
David Green
21e0b56d7a [AArch64][GlobalISel] Add basic GISel test coverage for lround and llround. NFC 2025-11-17 19:47:36 +00:00
Guy David
69b4190d5f [AArch64] Optimize extending loads of small vectors (#163064)
Reduces the total amount of loads and the amount of moves between SIMD
registers and general-purpose registers.
2025-11-17 21:39:10 +02:00
Amit Kumar Pandey
c1c22cd3e1 [ASan][HIP] Add ASan declarations and macros. (#167522)
This patch adds the following device ASan hooks and guarded macros in
__clang_hip_libdevice_declares.h

  - Function Declarations
    - __asan_poison_memory_region
    - __asan_unpoison_memory_region
    - __asan_address_is_poisoned
    - __asan_region_is_poisoned

  - Macros
    - ASAN_POISON_MEMORY_REGION
    - ASAN_UNPOISON_MEMORY_REGION
2025-11-17 11:13:09 -08:00
John Harrison
c555522818 [lldb-dap] Migrating 'evaluate' to structured types. (#167720)
Adding structured types for the evaluate request handler.

This should be mostly a non-functional change. I did catch some spelling
mistakes in our tests ('variable' vs 'variables').
2025-11-17 11:08:49 -08:00
Keith Smiley
af6af8e4eb [bazel] Port 0a58e49c44 (#168424) 2025-11-17 11:08:22 -08:00
Florian Hahn
bafb3f6788 [LV] Add test with existing noalias metadata and runtime checks.
Add test where we have loads with existing noalias metadata and noalias
metadata gets added by loop versioning.
2025-11-17 19:01:26 +00:00