Skip to content

Conversation

@wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Aug 7, 2025

Before this PR, PostOrderFunctionAttrsPass in opt run can deduce memory(none) for these functions.

This PR explicitly adds the attribute to align with Clang's OpenCL headers and ensures the attribute is present throughout the compilation flow. Generated bitcode files amdgcn--amdhsa.bc and nvptx64--nvidiacl.bc become slightly smaller.

…mory

Before this PR, PostOrderFunctionAttrsPass in opt run can deduce
memory(none) for these functions.

This PR explicitly adds the attribute to align with Clang's OpenCL
headers and ensures the attribute is present throughout the compilation
flow. Generated bitcode files amdgcn--amdhsa.bc and nvptx64--nvidiacl.bc
become slightly smaller.
@wenju-he wenju-he requested a review from frasercrmck August 7, 2025 08:35
@llvmbot llvmbot added the libclc libclc OpenCL library label Aug 7, 2025
@wenju-he wenju-he requested a review from arsenm August 7, 2025 08:36
#define _CLC_OVERLOAD __attribute__((overloadable))
#define _CLC_DECL
#define _CLC_INLINE __attribute__((always_inline)) inline
#define _CLC_CNFN __attribute__((const))
Copy link
Contributor

Choose a reason for hiding this comment

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

Use a less inscrutable abbreviation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Use a less inscrutable abbreviation?

done, changed to _CLC_CONST

@wenju-he wenju-he requested a review from arsenm August 8, 2025 05:05
@wenju-he wenju-he merged commit 111cdaa into llvm:main Aug 12, 2025
9 checks passed
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.

4 participants