Skip to content

LLVM and SPIRV-LLVM-Translator pulldown (WW19 2025) #18403

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

Merged
merged 3,305 commits into from
May 16, 2025
Merged

LLVM and SPIRV-LLVM-Translator pulldown (WW19 2025) #18403

merged 3,305 commits into from
May 16, 2025

Conversation

iclsrc
Copy link
Contributor

@iclsrc iclsrc commented May 12, 2025

ojhunt and others added 30 commits May 3, 2025 01:18
When parsing a function pointer typed field we use
Parser::ParseTypeQualifierListOpt, but then drops subsequent type
attributes and qualifiers unless explicitly handled.

There is an existing solution for the _Atomic qualifier, and this PR
simply extends that to __ptrauth for now. In future we may want to
investigate a more robust mechanism to ensure type qualifiers are not
silently dropped so that future type qualifiers do not suffer the same
problem.
This reverts commit d431921.

Missing gtests have been updated.

Original message:

This addresses an existing TODO and simply moves the current code to add
canonical IV recipes to the initial skeleton construction, at the same
place where the corresponding region will be introduced.
We can use StringRef for PassPrefix because it is used only with
StringRef::starts_with.
Modify the unittest logic in offload to only look for
`third-party/unittest` directory when `llvm_gtest` is not provided by
LLVM itself (in-tree or installed). This makes it possible to run
unittests in sparse checkouts without the `third-party/unittest` tree.

While at it, also make sure `LLVM_THIRD_PARTY_DIR` is actually set while
performing standalone builds. The logic is copied from `compiler-rt`.

---------

Co-authored-by: Joseph Huber <[email protected]>
…(#138411)

Note that orc::ExecutorAddr default-constructs itself with Addr being 0.
The new TableGen warning introduced in 951292b shows the following
warnings:

```
warning: Processor ck807e contains duplicate feature 'edsp'
warning: Processor ck807e contains duplicate feature 'dsp1e2'
warning: Processor ck807e contains duplicate feature 'dspe60'
warning: Processor ck807ef contains duplicate feature 'edsp'
warning: Processor ck807ef contains duplicate feature 'dsp1e2'
warning: Processor ck807ef contains duplicate feature 'dspe60'
```
15bb1db removed the last dependency on ILV, move the code out of
ILV in preparation of consolidating in VPlanRecipes.cpp.
This fixes a warning where a variable assigned in 'if' statement wasn't
referenced again.
It seems we were missing a dependency when adding a new test target,
e.g., test libc.test.src.math.sqrt_test.__unit__ would create a
custom target in the form of:

```
  add_custom_target(
    libc.test.src.__support.FPUtil.dyadic_float_test.__unit__
    COMMAND  ${LIBC_UNITTEST_ENV} ${CMAKE_CROSSCOMPILING_EMULATOR} libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
    COMMENT Running unit test libc.test.src.__support.FPUtil.dyadic_float_test.__unit__ )
``` 

but it wouldn't set that it depends on
libc.test.src.__support.FPUtil.dyadic_float_test.__unit__.__build__
being built.

For some reason, it would break the rv32 buildbot, as it would try to
run a test but the __build__ is nowhere to be found, since it wasn't
built in the first place.
Without it, certain functions such as dladdr are not make available by
the headers.

Signed-off-by: Jeremy Drake <[email protected]>
…8328)

This is no longer necessary, and results in an inconvenient define of
`i386` on i386 Cygwin targets which breaks compiling
llvm/include/llvm/ExecutionEngine/JITLink/i386.h.

Signed-off-by: Jeremy Drake <[email protected]>
GNU ld seems to ignore this option, but LLD treats the presence of this
unknown option as an error.
... to align with other targets, e.g., https://reviews.llvm.org/D77853
(AArch64) and https://reviews.llvm.org/D83634 (AVR).

binutils's sparc port uses %d when imm<=9, diverging from other ports.
We do not follow the binutils sparc port behavior.
…location types

Simplify code, which is enabled by
40789ce ("MCFixup: Move relocation values before FK_NONE")
….h. NFC

Remove a fishy `#undef LoongArch` and an unneeded user-provided dtor.
As described in #136088 (for RISC-V), the `llvm-mc -show-encoding`
output no longer displays descriptive fixup names. Just remove
-show-encoding.
`call local` should perform STT_SECTION adjustment as well as `call .Ltmp0`.
The early support 9fc2909 from 2014 was
confused.
…itions

Reviewers: brad0, rorth, s-barannikov

Reviewed By: s-barannikov

Pull Request: llvm/llvm-project#138398
From SPARC T3 Supplement to the UltraSPARC Architecture 2007 Specification:
> T3 SPARC core has a new 9 stage floating point pipeline and added Fused
> Multiply-Add (FMADD) instruction and VIS 3.0 Instructions compared to
> UltraSPARC T2/T2+.

Reviewers: rorth, s-barannikov, brad0

Reviewed By: s-barannikov

Pull Request: llvm/llvm-project#138399
* Remove unuseful -filetype=asm -show-encoding output from relocation tests.
* Test STT_TLS for TLS relocations
* Test r_offset for a few relocations
* Test ASM output for many relocations
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 13:04 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 13:43 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 13:44 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 13:44 — with GitHub Actions Inactive
Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PrintAsCanonical change looks good to me.

Copy link
Contributor

@premanandrao premanandrao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsji offered to file an issue for tracking the unsupported HLSL tests.
Based on that, I am okay with this change.

@jsji jsji closed this May 16, 2025
@jsji jsji reopened this May 16, 2025
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 17:05 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 17:06 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 17:33 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 17:47 — with GitHub Actions Inactive
@jsji jsji temporarily deployed to WindowsCILock May 16, 2025 17:47 — with GitHub Actions Inactive
@jsji
Copy link
Contributor

jsji commented May 16, 2025

@intel/llvm-gatekeepers This is ready for merge -- the failures in CI are unstable infra, they passed before https://github.com/intel/llvm/actions/runs/15058024714 (no related changes afterwards).

@sarnex
Copy link
Contributor

sarnex commented May 16, 2025

/merge

@jsji
Copy link
Contributor

jsji commented May 16, 2025

/merge

@DoyleLi Down again?

@sarnex sarnex merged commit 8b35b01 into sycl May 16, 2025
118 of 133 checks passed
@KornevNikita
Copy link
Contributor

KornevNikita commented May 19, 2025

Looks like this PD breaks the sycl_cts/bit_cast test - https://github.com/intel/llvm/actions/runs/15081117059/job/42398114254:

[1721/1723] Linking CXX executable bin/test_bit_cast
FAILED: bin/test_bit_cast 
: && /__w/llvm/llvm/toolchain/bin/clang++ -fpreview-breaking-changes -DSYCL2020_CONFORMANT_APIS -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -D__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ -ffp-model=precise tests/bit_cast/CMakeFiles/test_bit_cast_objects.dir/bit_cast_test_core.cpp.o tests/bit_cast/CMakeFiles/test_bit_cast_objects.dir/bit_cast_test_core_fp64.cpp.o tests/common/CMakeFiles/main_function_object.dir/main.cpp.o -o bin/test_bit_cast     -flink-huge-device-code  -fsycl -sycl-std=2020 -fno-sycl-id-queries-fit-in-int  util/libutil.a  oclmath/liboclmath.a  vendor/Catch2/src/libCatch2.a && :
llvm-spirv: /__w/llvm/llvm/src/llvm-spirv/lib/SPIRV/SPIRVWriter.cpp:2701: SPIRV::SPIRVType* SPIRV::LLVMToSPIRVBase::mapType(llvm::Type*, SPIRV::SPIRVType*): Assertion `EmplaceStatus.second && "The type was already added to the map"' failed.
PLEASE submit a bug report to https://github.com/intel/llvm/issues and include the crash backtrace.
Stack dump:
0.	Program arguments: /__w/llvm/llvm/toolchain/bin/llvm-spirv -o /tmp/bit_cast_test_core-4a141a-f58bad.spv -spirv-max-version=1.5 -spirv-debug-info-version=nonsemantic-shader-200 -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_fast_composite,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_long_composites,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_global_variable_decorations,+SPV_INTEL_cache_controls,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_fpga_argument_interfaces,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_latency_control,+SPV_KHR_shader_clock,+SPV_INTEL_bindless_images,+SPV_INTEL_task_sequence,+SPV_INTEL_bfloat16_conversion,+SPV_INTEL_joint_matrix,+SPV_INTEL_hw_thread_queries,+SPV_KHR_uniform_group_instructions,+SPV_INTEL_masked_gather_scatter,+SPV_INTEL_tensor_float32_conversion,+SPV_INTEL_optnone,+SPV_KHR_non_semantic_info,+SPV_KHR_cooperative_matrix,+SPV_EXT_shader_atomic_float16_add,+SPV_INTEL_fp_max_error /tmp/bit_cast_test_core-709e13_1.bc
1.	Running pass "SPIRV::LLVMToSPIRVPass" on module "/tmp/bit_cast_test_core-709e13_1.bc"
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llvm-spirv 0x000057e5b310b9a0
1  llvm-spirv 0x000057e5b3108f9f
2  llvm-spirv 0x000057e5b31090ea
3  libc.so.6  0x00007febe2a05330
4  libc.so.6  0x00007febe2a5eb2c pthread_kill + 284
5  libc.so.6  0x00007febe2a0527e gsignal + 30
6  libc.so.6  0x00007febe29e88ff abort + 223
7  libc.so.6  0x00007febe29e881b
8  libc.so.6  0x00007febe29fb517
9  llvm-spirv 0x000057e5b2aad9e5
10 llvm-spirv 0x000057e5b2acfb24
11 llvm-spirv 0x000057e5b2acf616
12 llvm-spirv 0x000057e5b2ad270f
13 llvm-spirv 0x000057e5b2acf0b9
14 llvm-spirv 0x000057e5b2acb01c
15 llvm-spirv 0x000057e5b2acd3fd
16 llvm-spirv 0x000057e5b2adce2e
17 llvm-spirv 0x000057e5b2add870
18 llvm-spirv 0x000057e5b2addb70
19 llvm-spirv 0x000057e5b2addc86
20 llvm-spirv 0x000057e5b2fee9dd
21 llvm-spirv 0x000057e5b2ab0639
22 llvm-spirv 0x000057e5b299326d
23 llvm-spirv 0x000057e5b28e4dfd
24 libc.so.6  0x00007febe29ea1ca
25 libc.so.6  0x00007febe29ea28b __libc_start_main + 139
26 llvm-spirv 0x000057e5b298abf5
llvm-foreach: Aborted (core dumped)
clang++: error: llvm-spirv command failed with exit code 254 (use -v to see invocation)
clang version 21.0.0git (https://github.com/intel/llvm 6a4665ef4c4b429076c589b923da9b9d5f728739)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /__w/llvm/llvm/toolchain/bin
Build config: +assertions
clang++: note: diagnostic msg: Error generating preprocessed source(s).

@jsji
Copy link
Contributor

jsji commented May 19, 2025

Looks like this PD breaks the sycl_cts/bit_cast test - https://github.com/intel/llvm/actions/runs/15081117059/job/42398114254:

[1721/1723] Linking CXX executable bin/test_bit_cast
FAILED: bin/test_bit_cast 
: && /__w/llvm/llvm/toolchain/bin/clang++ -fpreview-breaking-changes -DSYCL2020_CONFORMANT_APIS -DSYCL2020_DISABLE_DEPRECATION_WARNINGS -D__SYCL_DISABLE_PARALLEL_FOR_RANGE_ROUNDING__ -ffp-model=precise tests/bit_cast/CMakeFiles/test_bit_cast_objects.dir/bit_cast_test_core.cpp.o tests/bit_cast/CMakeFiles/test_bit_cast_objects.dir/bit_cast_test_core_fp64.cpp.o tests/common/CMakeFiles/main_function_object.dir/main.cpp.o -o bin/test_bit_cast     -flink-huge-device-code  -fsycl -sycl-std=2020 -fno-sycl-id-queries-fit-in-int  util/libutil.a  oclmath/liboclmath.a  vendor/Catch2/src/libCatch2.a && :
llvm-spirv: /__w/llvm/llvm/src/llvm-spirv/lib/SPIRV/SPIRVWriter.cpp:2701: SPIRV::SPIRVType* SPIRV::LLVMToSPIRVBase::mapType(llvm::Type*, SPIRV::SPIRVType*): Assertion `EmplaceStatus.second && "The type was already added to the map"' failed.
PLEASE submit a bug report to https://github.com/intel/llvm/issues and include the crash backtrace.
Stack dump:
0.	Program arguments: /__w/llvm/llvm/toolchain/bin/llvm-spirv -o /tmp/bit_cast_test_core-4a141a-f58bad.spv -spirv-max-version=1.5 -spirv-debug-info-version=nonsemantic-shader-200 -spirv-allow-unknown-intrinsics=llvm.genx. -spirv-ext=-all,+SPV_EXT_shader_atomic_float_add,+SPV_EXT_shader_atomic_float_min_max,+SPV_KHR_no_integer_wrap_decoration,+SPV_KHR_float_controls,+SPV_KHR_expect_assume,+SPV_KHR_linkonce_odr,+SPV_INTEL_subgroups,+SPV_INTEL_media_block_io,+SPV_INTEL_device_side_avc_motion_estimation,+SPV_INTEL_fpga_loop_controls,+SPV_INTEL_unstructured_loop_controls,+SPV_INTEL_fpga_reg,+SPV_INTEL_blocking_pipes,+SPV_INTEL_function_pointers,+SPV_INTEL_kernel_attributes,+SPV_INTEL_io_pipes,+SPV_INTEL_inline_assembly,+SPV_INTEL_arbitrary_precision_integers,+SPV_INTEL_float_controls2,+SPV_INTEL_vector_compute,+SPV_INTEL_fast_composite,+SPV_INTEL_arbitrary_precision_fixed_point,+SPV_INTEL_arbitrary_precision_floating_point,+SPV_INTEL_variable_length_array,+SPV_INTEL_fp_fast_math_mode,+SPV_INTEL_long_composites,+SPV_INTEL_arithmetic_fence,+SPV_INTEL_global_variable_decorations,+SPV_INTEL_cache_controls,+SPV_INTEL_fpga_buffer_location,+SPV_INTEL_fpga_argument_interfaces,+SPV_INTEL_fpga_invocation_pipelining_attributes,+SPV_INTEL_fpga_latency_control,+SPV_KHR_shader_clock,+SPV_INTEL_bindless_images,+SPV_INTEL_task_sequence,+SPV_INTEL_bfloat16_conversion,+SPV_INTEL_joint_matrix,+SPV_INTEL_hw_thread_queries,+SPV_KHR_uniform_group_instructions,+SPV_INTEL_masked_gather_scatter,+SPV_INTEL_tensor_float32_conversion,+SPV_INTEL_optnone,+SPV_KHR_non_semantic_info,+SPV_KHR_cooperative_matrix,+SPV_EXT_shader_atomic_float16_add,+SPV_INTEL_fp_max_error /tmp/bit_cast_test_core-709e13_1.bc
1.	Running pass "SPIRV::LLVMToSPIRVPass" on module "/tmp/bit_cast_test_core-709e13_1.bc"
Stack dump without symbol names (ensure you have llvm-symbolizer in your PATH or set the environment var `LLVM_SYMBOLIZER_PATH` to point to it):
0  llvm-spirv 0x000057e5b310b9a0
1  llvm-spirv 0x000057e5b3108f9f
2  llvm-spirv 0x000057e5b31090ea
3  libc.so.6  0x00007febe2a05330
4  libc.so.6  0x00007febe2a5eb2c pthread_kill + 284
5  libc.so.6  0x00007febe2a0527e gsignal + 30
6  libc.so.6  0x00007febe29e88ff abort + 223
7  libc.so.6  0x00007febe29e881b
8  libc.so.6  0x00007febe29fb517
9  llvm-spirv 0x000057e5b2aad9e5
10 llvm-spirv 0x000057e5b2acfb24
11 llvm-spirv 0x000057e5b2acf616
12 llvm-spirv 0x000057e5b2ad270f
13 llvm-spirv 0x000057e5b2acf0b9
14 llvm-spirv 0x000057e5b2acb01c
15 llvm-spirv 0x000057e5b2acd3fd
16 llvm-spirv 0x000057e5b2adce2e
17 llvm-spirv 0x000057e5b2add870
18 llvm-spirv 0x000057e5b2addb70
19 llvm-spirv 0x000057e5b2addc86
20 llvm-spirv 0x000057e5b2fee9dd
21 llvm-spirv 0x000057e5b2ab0639
22 llvm-spirv 0x000057e5b299326d
23 llvm-spirv 0x000057e5b28e4dfd
24 libc.so.6  0x00007febe29ea1ca
25 libc.so.6  0x00007febe29ea28b __libc_start_main + 139
26 llvm-spirv 0x000057e5b298abf5
llvm-foreach: Aborted (core dumped)
clang++: error: llvm-spirv command failed with exit code 254 (use -v to see invocation)
clang version 21.0.0git (https://github.com/intel/llvm 6a4665ef4c4b429076c589b923da9b9d5f728739)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /__w/llvm/llvm/toolchain/bin
Build config: +assertions
clang++: note: diagnostic msg: Error generating preprocessed source(s).

Should be due to KhronosGroup/SPIRV-LLVM-Translator@19d67bdfc9ebf8e

Likely a real compiler bug exposed by llvm-spirv tools refactoring. @intel/dpcpp-spirv-reviewers Please get someone to have a look. Thanks.

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.