Skip to content

[libspirv] Fix recent conflict resolutions #19401

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

Closed

Conversation

frasercrmck
Copy link
Contributor

This commit combines some fixes for acos/asin/modf and some CMake fixes.

The three maths functions were using an old macro that upstream renamed.

Upstream also made the output directory of the final libclc files explicit with a variable, instead of relying on the current binary dir. This was in preparation for the ability for upstream to place libclc directly into clang's resource directory; see 81e6552.

Downstream we'd already done something similar, only we were relying on placing libclc files in ${LLVM_LIBRARY_OUTPUT_INTDIR}/clc. The tests were also relying on this. During the pulldown we were left with bits of CMake code using the upstream location and other bits using the downstream location. This commit unifies all under the upstream variable name, but temporarily adjusts it to point to the downstream location. Over time I am hoping that upstream and downstream will align on the same location for libclc library files.

This commit also removes some now-unused CMake functions. After f14620a libdevice no longer uses libclc's CMake functions. This meant that we are now able to align closer to upstream. Our downstream link_bc had some divergence due to libdevice, and upstream doesn't use process_bc. Indeed, we weren't using it either after a recent pulldown. Lastly, upstream doesn't use add_libclc_alias and neither do we. It's possible that this will temporarily break on Windows due to us not including some old downstream divergence which changes symlinks to copies on Windows, but upstream 9b5959d has been landed so we can either wait to pull that in or cherry-pick it. Either way we are left with far fewer divergences from upstream so should make libclc more maintainable.

This commit combines some fixes for acos/asin/modf and some CMake fixes.

The three maths functions were using an old macro that upstream renamed.

Upstream also made the output directory of the final libclc files
explicit with a variable, instead of relying on the current binary dir.
This was in preparation for the ability for upstream to place libclc
directly into clang's resource directory; see 81e6552.

Downstream we'd already done something similar, only we were relying on
placing libclc files in `${LLVM_LIBRARY_OUTPUT_INTDIR}/clc`. The tests
were also relying on this. During the pulldown we were left with bits of
CMake code using the upstream location and other bits using the
downstream location. This commit unifies all under the upstream variable
name, but temporarily adjusts it to point to the downstream location.
Over time I am hoping that upstream and downstream will align on the
same location for libclc library files.

This commit also removes some now-unused CMake functions. After
f14620a libdevice no longer uses libclc's CMake functions. This meant
that we are now able to align closer to upstream. Our downstream
`link_bc` had some divergence due to libdevice, and upstream doesn't use
`process_bc`. Indeed, we weren't using it either after a recent
pulldown. Lastly, upstream doesn't use `add_libclc_alias` and neither do
we. It's possible that this will temporarily break on Windows due to us
not including some old downstream divergence which changes symlinks to
copies on Windows, but upstream 9b5959d has been landed so we can
either wait to pull that in or cherry-pick it. Either way we are left
with far fewer divergences from upstream so should make libclc more
maintainable.
@frasercrmck frasercrmck requested a review from a team as a code owner July 11, 2025 12:13
@frasercrmck frasercrmck added the libclc libclc project related issues label Jul 11, 2025
@frasercrmck frasercrmck requested review from jchlanda and removed request for a team July 11, 2025 12:13
@mikolaj-pirog mikolaj-pirog requested a review from vmaksimo July 11, 2025 12:14
@bwyma
Copy link
Contributor

bwyma commented Jul 11, 2025

I already pushed a patch I was working on to fix the test failures before I saw this. It will conflict.
I will apply all of these changes and send you a link to the PR.

@bwyma
Copy link
Contributor

bwyma commented Jul 11, 2025

This AddLibclc.cmake does not build properly because the remangled versions depend upon ${builtins_lib} which is not defined within ${LIBCLC_OUTPUT_LIBRARY_DIR}. These should be updated to ${libclc_builtins_lib}. I will include this change in the patch.

bwyma added a commit to bwyma/intel-llvm that referenced this pull request Jul 11, 2025
This includes all of the changes from intel#19401 and resolves the conflict
with 17fe1b5.
bwyma added a commit that referenced this pull request Jul 13, 2025
This includes all of the changes from #19401 and resolves the conflict
with 17fe1b5.
@frasercrmck
Copy link
Contributor Author

Superceded by #19410

@frasercrmck frasercrmck deleted the sycl-web-fix-libspirv-testing branch July 14, 2025 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc project related issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants