Skip to content

[libclc] Fix ctest failures after 7f3661128b1e: adjust external check and make shuffle helpers static - #160036

Merged
wenju-he merged 2 commits into
llvm:mainfrom
wenju-he:fix-libclc-check_external_calls.sh
Sep 22, 2025
Merged

wenju-he merged 2 commits into
llvm:mainfrom
wenju-he:fix-libclc-check_external_calls.sh

Conversation

@wenju-he

Copy link
Copy Markdown
Contributor
  • Replace call-site check with external declaration scan (grep declare) to avoid false positives for not-inlined _clc* functions.
  • _clc_get_el* helpers are defined as inline in clc_shuffle2.cl, so they have available_externally attribute. When they fail to inline they are deleted by EliminateAvailableExternallyPass and become unresolved in cedar-r600--.bc. Mark them static to resolve the issue.

…make shuffle helpers static

* Replace call-site check with external declaration scan (grep declare)
  to avoid false positives for not-inlined __clc_* functions.
* _clc_get_el* helpers are defined as inline in clc_shuffle2.cl, so they
  have available_externally attribute. When they fail to inline they are
  deleted by EliminateAvailableExternallyPass and become unresolved in
  cedar-r600--.bc. Mark them static to resolve the issue.
@llvmbot llvmbot added the libclc libclc OpenCL library label Sep 22, 2025
@wenju-he
wenju-he requested review from arsenm and mgorny September 22, 2025 06:40

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 fixes ctest failures that occurred after commit 7f36611 by addressing two distinct issues: false positives in external function checking and unresolved function symbols in compiled bytecode.

  • Replaces call-site checking with external declaration scanning to avoid false positives
  • Changes shuffle helper functions from inline to static to prevent elimination during optimization
  • Updates test names and error messages to reflect the new checking approach

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
libclc/cmake/modules/AddLibclc.cmake Updates test name and script reference from "external-calls" to "external-funcs"
libclc/clc/lib/generic/misc/clc_shuffle2.cl Changes _CLC_INLINE to static for shuffle helper functions
libclc/clc/lib/generic/misc/clc_shuffle.cl Changes _CLC_INLINE to static for shuffle helper functions
libclc/check_external_funcs.sh Modifies check logic from call sites to external declarations and updates error messages

Comment on lines +505 to +507
# Add a test for whether or not the libraries contain unresolved functions
# which would usually indicate a build problem. Note that we don't perform
# this test for all libclc targets:

Copilot AI Sep 22, 2025

Copy link

Choose a reason for hiding this comment

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

The comment update should mention that the change from 'calls' to 'functions' reflects a shift from checking call sites to checking external declarations, which provides more accurate detection of unresolved symbols.

Suggested change
# Add a test for whether or not the libraries contain unresolved functions
# which would usually indicate a build problem. Note that we don't perform
# this test for all libclc targets:
# Add a test for whether or not the libraries contain unresolved functions,
# which would usually indicate a build problem. This test now checks for
# unresolved external function declarations (rather than call sites), reflecting
# a shift from checking 'calls' to checking 'functions' for more accurate
# detection of unresolved symbols. Note that we don't perform this test for all
# libclc targets:

Copilot uses AI. Check for mistakes.
Comment thread libclc/check_external_funcs.sh Resolved
@wenju-he
wenju-he merged commit 7d1adab into llvm:main Sep 22, 2025
@wenju-he
wenju-he deleted the fix-libclc-check_external_calls.sh branch September 22, 2025 07:55
@mgorny

mgorny commented Sep 22, 2025

Copy link
Copy Markdown
Member

Thank you. I can confirm that they seem good now.

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.

5 participants