Skip to content
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

clang generates definitions of sqrt #1231

Closed
alan-baker opened this issue Sep 14, 2023 · 0 comments · Fixed by #1271
Closed

clang generates definitions of sqrt #1231

alan-baker opened this issue Sep 14, 2023 · 0 comments · Fixed by #1271
Assignees

Comments

@alan-baker
Copy link
Collaborator

https://reviews.llvm.org/D156743 added definitions of float-based sqrt to the opencl header. This leads to problems in clspv:

  • long vectors are always present
  • cllib linking is broken

Short term solution is to enable long vectors and strip builtin definitions prior to linking.

@alan-baker alan-baker self-assigned this Sep 14, 2023
alan-baker added a commit to alan-baker/clspv that referenced this issue Sep 14, 2023
Contributes to google#1231

* Update llvm, spirv-headers, and spirv-tools
* Clang defines sqrt for float in opencl-c-base.h now
  * need to strip it to facilitate linking with cllib
  * need to always enable long vector lowering
    * xfail'd some tests for now
* Add missing dependency for header generation on opencl-c-base.h
alan-baker added a commit that referenced this issue Sep 14, 2023
Contributes to #1231

* Update llvm, spirv-headers, and spirv-tools
* Clang defines sqrt for float in opencl-c-base.h now
  * need to strip it to facilitate linking with cllib
  * need to always enable long vector lowering
    * xfail'd some tests for now
* Add missing dependency for header generation on opencl-c-base.h
arsenm pushed a commit to llvm/llvm-project that referenced this issue Dec 1, 2023
This is reverting the previous implementation to avoid adding inline
function in opencl headers.
This was breaking clspv flow google/clspv#1231, while
https://reviews.llvm.org/D156743 mentioned that just decorating the call
node with `!pfmath` was enough.
This PR is implementing this idea.
The test has been updated with this implementation.
rjodinchr added a commit to rjodinchr/clspv that referenced this issue Dec 11, 2023
alan-baker pushed a commit that referenced this issue Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant