Skip to content

[libclc] Move frexp to CLC library; optimize half vecs #127836

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 1 commit into from
Feb 20, 2025

Conversation

frasercrmck
Copy link
Contributor

This commit moves the frexp builtin to the CLC library.

It simultaneously optimizes the code generated for half vectors, which was previously scalarizing and casting up to float. With this commit it still casts up to float, but keeps it in the vector form.

This commit moves the frexp builtin to the CLC library.

It simultaneously optimizes the code generated for half vectors, which
was previously scalarizing and casting up to float. With this commit it
still casts up to float, but keeps it in the vector form.
@frasercrmck frasercrmck added the libclc libclc OpenCL library label Feb 19, 2025
@frasercrmck frasercrmck requested a review from arsenm February 19, 2025 17:59
Copy link
Contributor

@arsenm arsenm left a comment

Choose a reason for hiding this comment

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

This should move to use the new frexp intrinsic

@frasercrmck
Copy link
Contributor Author

This should move to use the new frexp intrinsic

Interesting, thanks for pointing it out. Looks like worst case it generates roughly equivalent inline code in LegalizeDAG and won't call out to libm or anything, which suits us. We'd need an elementwise builtin equivalent but yeah it looks promising. I'll make a note of it.

@frasercrmck frasercrmck merged commit 684ad25 into llvm:main Feb 20, 2025
10 checks passed
@frasercrmck frasercrmck deleted the libclc-clc-frexp branch February 20, 2025 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libclc libclc OpenCL library
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants