Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW25 2025) #19031

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1,649 commits into
base: sycl
Choose a base branch
from
Draft

Conversation

iclsrc
Copy link
Contributor

@iclsrc iclsrc commented Jun 17, 2025

JDevlieghere and others added 30 commits June 2, 2025 14:43
See llvm/llvm-project#139128
If multiple entries match the source, than the latest entry takes the
precedence.`
See llvm/llvm-project#139128
If multiple entries match the source, than the latest entry takes the
precedence.
Implemented wmempcpy and added tests
This PR removes the necessity to know the dimension of the embeddings while invoking `Embedder::Create`. Having the `Dimension` parameter introduces complexities in downstream consumers. 

(Tracking issue - #141817)
This fixes a bug where parsing PDBs with usages of register enums were
asserting.

The main problem is that printing out the code view register enums are
taken care of here:

https://github.com/nikitalita/llvm-project/blob/e4888a92402f53000a3a5e79d3792c034fc2f343/llvm/lib/ObjectYAML/CodeViewYAMLSymbols.cpp#L152

Which requires a COFF::header in the IO context for the machine type,
which we didn't have when dumping a pdb or parsing a yaml file. So, we
make a fake one with the machine type.
Implemented wcscmp and added tests
fixes #124347 
Implemented wcsrchr and added tests
Implemented wcsncat and tests.

---------

Co-authored-by: Sriya Pratipati <[email protected]>
Added CRASH_ON_NULLPTR macro to wcspbrk function and related test
CFIPrograms' most common uses are within debug frames, but it is not
their only use. For example, some assembly writers encode them by hand
into .cfi_escape directives. This PR extracts code for them into its own
files, setting them up to be evaluated from outside debug frames
themselves.

One in a series of NFC DebugInfo/DWARF refactoring changes to layer it
more cleanly, so that binary CFI parsing can be used from low-level
code, (such as byte strings created via .cfi_escape) without circular
dependencies. The final goal is to make a more limited dwarf library
usable from lower-level code.
## Purpose

This patch is one in a series of code-mods that annotate LLVM’s public
interface for export. This patch annotates the `llvm/IR`,
`llvm/IRPrinter`, and `llvm/IRReader` libraries. These annotations
currently have no meaningful impact on the LLVM build; however, they are
a prerequisite to support an LLVM Windows DLL (shared library) build.

## Background

This effort is tracked in #109483. Additional context is provided in
[this
discourse](https://discourse.llvm.org/t/psa-annotating-llvm-public-interface/85307),
and documentation for `LLVM_ABI` and related annotations is found in the
LLVM repo
[here](https://github.com/llvm/llvm-project/blob/main/llvm/docs/InterfaceExportAnnotations.rst).

The bulk of these changes were generated automatically using the
[Interface Definition Scanner (IDS)](https://github.com/compnerd/ids)
tool, followed formatting with `git clang-format`.

The following manual adjustments were also applied after running IDS on
Linux:
- Add `#include "llvm/Support/Compiler.h"` to files where it was not
auto-added by IDS due to no pre-existing block of include statements.
- Add `LLVM_ABI_FRIEND` to friend member functions declared with
`LLVM_ABI`
- Add `LLVM_TEMPLATE_ABI` and `LLVM_EXPORT_TEMPLATE` to exported
instantiated templates
- Add `LLVM_ABI` to a subset of private class methods and fields that
require export
- Add `LLVM_ABI` to a small number of symbols that require export but
are not declared in headers
- Reorder `LLVM_ABI` with `[[deprecated]]` and `[[nodiscard]]`
attributes.

## Validation

Local builds and tests to validate cross-platform compatibility. This
included llvm, clang, and lldb on the following configurations:

- Windows with MSVC
- Windows with Clang
- Linux with GCC
- Linux with Clang
- Darwin with Clang
Implemented wcsstr and tests.
fixes #124348

---------

Co-authored-by: Sriya Pratipati <[email protected]>
Implemented wcsncmp and added tests
The yaml ended up with a typo, possibly due to merge issues. This patch
fixes it.
This change upstreams the code to support emitting inline C++ function
definitions, including the ASTConsumer handler for inline definitions
and the code to load the 'this' pointer.

This necessitates introducing the Itanium CXXABI class. No other CXXABI
subclasses are supported at this time. The Itanium CXXABI is used for
AppleARM64, which will require its own handler for a few special cases
(such as array cookies) later.
The subject test sporadically fails on the AIX builder:
https://lab.llvm.org/buildbot/#/builders/64/builds/3921/steps/6/logs/FAIL__lit___timeout-hang_py

This appears to be an environment issue potentially connected to high
load because the problem is not observed on other AIX machines.

This patch separates the "hard" timeout value from the value used to
signal a hang. This allows for a more generous "hard" timeout value,
which allows observation of cases that take longer to finish despite not
hanging.
Most bits of this are straightforward: when we emit SVE instructions in
the prologue/epilogue, emit corresponding opcodes.

The unfortunately nasty bit is the handling of the frame pointer in
functions that use the SVE calling convention. If we have SVE callee
saves, and need to restore the stack pointer from the frame pointer,
it's impossible to encode callee saves that happen after the frame
pointer. So this patch rearranges the stack to put SVE callee saves
first. This isn't really that complicated on its own, but it leads to a
lot of tricky conditionals (see FPAfterSVECalleeSaves).
…1916)

Currently, libc++'s `<tuple>` is using the deprecated
`__reference_binds_to_temporary` intrinsic. This PR starts to use
`__reference_constructs_from_temporary` if possible.

It seems that `__reference_constructs_from_temporary` should be used via
an internal type traits provided in
`<__type_traits/reference_constructs_from_temporary.h>`. But given the
old intrinsic was directly used, this PR doesn't switch to the current
convention yet.

P2255R2 is related. Although the paper indicated that constructors of
`tuple` should be deleted in such a case.

---------

Co-authored-by: Nikolas Klauser <[email protected]>
At the time `__reference_constructs_from_temporary` got implemented,
`__reference_binds_to_temporary` was mentioned as deprecated in
`LanguageExtensions.rst`, but no deprecation warning was emitted. This
PR adds the previously missing warning.
We rename `createGenericSchedLive` and `createGenericSchedPostRA`
to `createSchedLive` and `createSchedPostRA`, and add a template
parameter `Strategy` which is the generic implementation by default.

This can simplify some code for targets that have custom scheduler
strategy.
The chained ops can be folded away when they have the same alignment.

Signed-off-by: hanhanW <[email protected]>
This changes the save/restore procedures to save/restore registers one
by one - to match the stack alignment for the ILP32E/LP64E ABIs, rather
than the larger batches of the conventional ABIs. The implementations of
the save routines are not tail-shared, to reduce the number of
instructions. I think this also helps code size but I need to check this
again.

I would expect (but haven't measured) that the majority of functions
compiled for the ILP32E/LP64E ABIs will in fact use both callee-saved
registers, and therefore there are still savings to be had, but I think
those can come later, with more data (especially if those changes are
just to the instruction sequences we use to save the registers, rather
than the number and alignment of how this is done).

This is a potential break for all of the ILP32E/LP64E ABI - we may
instead have to teach the compiler to emit the CFI information correctly
for the grouping we already have implemented (because that grouping
matches GCC). It depends on how intentional we think the grouping is in
the original ILP32E/LP64E save/restore implementation was, and whether
we think we can fix that now.
mdtoguchi and others added 3 commits June 17, 2025 20:00
The optimization level setting to the `-cc1` call has been updated to be
    earlier in the line.  Adjust the tests to match.
__builtin_spirv_generic_cast_to_ptr_explicit was added upstreaming but
because it has limited SYCL support, tests can't run properly.
@jsji jsji temporarily deployed to WindowsCILock June 18, 2025 19:20 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock June 18, 2025 19:20 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock June 18, 2025 19:43 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock June 18, 2025 20:21 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock June 18, 2025 20:21 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disable-lint Skip linter check step and proceed with build jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.