Skip to content

Conversation

@wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Dec 5, 2025

This is follow-up of comment
#168318 (comment)

libclc OpenCL library is already compiled with flag -fdeclare-opencl-builtins -finclude-default-header.

This is follow-up of comment
llvm#168318 (comment)

libclc OpenCL library is already compiled with flag
`-fdeclare-opencl-builtins -finclude-default-header`.
@llvmbot llvmbot added the libclc libclc OpenCL library label Dec 5, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR removes OpenCL builtin function declarations from the libclc library implementation files and headers. Since the library is already compiled with -fdeclare-opencl-builtins -finclude-default-header flags, these manual declarations are redundant and can be eliminated. The changes streamline the codebase by replacing explicit builtin declarations with the opencl-base.h include where necessary.

  • Removes redundant OpenCL builtin declaration header includes from implementation files
  • Deletes header files containing manual function declarations that are now provided automatically
  • Replaces removed includes with opencl-base.h in files that still need OpenCL base definitions

Reviewed changes

Copilot reviewed 300 out of 476 changed files in this pull request and generated no comments.

Show a summary per file
File Description
libclc/opencl/lib/generic/geometric/*.cl Removed redundant geometric function declaration includes
libclc/opencl/lib/generic/common/*.cl Removed redundant common function declaration includes
libclc/opencl/lib/generic/atomic/*.cl Removed redundant atomic function declaration includes
libclc/opencl/lib/generic/async/*.cl Removed redundant async function declarations, replaced with opencl-base.h
libclc/opencl/lib/clspv/shared/vstore_half.cl Consolidated multiple declaration includes into opencl-base.h
libclc/opencl/lib/clspv/math/fma.cl Removed redundant fma declaration include
libclc/opencl/lib/amdgcn/workitem/*.cl Removed redundant workitem function declarations, some replaced with opencl-base.h
libclc/opencl/lib/amdgcn/synchronization/barrier.cl Removed redundant barrier declaration include
libclc/opencl/lib/amdgcn/mem_fence/fence.cl Removed redundant explicit fence declaration include
libclc/opencl/lib/amdgcn-amdhsa/workitem/*.cl Removed redundant workitem declarations, replaced with opencl-base.h
libclc/opencl/include/clc/opencl/**/*.h Deleted entire header files containing now-redundant OpenCL builtin declarations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@wenju-he wenju-he merged commit 9fc1c49 into llvm:main Dec 9, 2025
12 checks passed
@wenju-he wenju-he deleted the libclc-delete-opencl-headers branch December 9, 2025 03:08
honeygoyal pushed a commit to honeygoyal/llvm-project that referenced this pull request Dec 9, 2025
This is follow-up of comment
llvm#168318 (comment)

libclc OpenCL library is already compiled with flag
`-fdeclare-opencl-builtins -finclude-default-header`.
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.

3 participants