Skip to content

Conversation

@wenju-he
Copy link
Contributor

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

libclc sequential build issue addressed in commit 0c21d6b is
specific to cmake MSVC generator. Therefore, this PR avoids creating a
large number of targets when a non-MSVC generator is used, such as the
Ninja generator, which is used in pre-merge CI on Windows in
llvm-project repo. We plan to migrate from MSVC generator to Ninja
generator in our downstream CI to fix flaky cmake bug Cannot restore timestamp, which might be related to the large number of targets.

… generator

libclc sequential build issue addressed in commit 0c21d6b is
specific to cmake MSVC generator. Therefore, this PR avoids creating a
large number of targets when a non-MSVC generator is used, such as the
Ninja generator, which is used in pre-merge CI on Windows in
llvm-project and our downstream repos.
@wenju-he wenju-he requested a review from frasercrmck August 20, 2025 06:08
@llvmbot llvmbot added the libclc libclc OpenCL library label Aug 20, 2025
Copy link
Contributor

@frasercrmck frasercrmck left a comment

Choose a reason for hiding this comment

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

Thanks for addressing this

# * FILES <string> ...
# List of bitcode files
function(create_compile_targets compile_tgts)
cmake_parse_arguments( ARG "" "ARCH_SUFFIX" "FILES" ${ARGN} )
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should error if ARCH_SUFFIX is empty? Just thinking that compile--* looks unintentional. Maybe an empty FILES is okay, maybe not.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

there is already such check at

if( NOT ARG_ARCH OR NOT ARG_ARCH_SUFFIX OR NOT ARG_TRIPLE )
message( FATAL_ERROR "Must provide ARCH, ARCH_SUFFIX, and TRIPLE" )
endif()
, which is before create_compile_targets is called.

Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's best if functions are self-contained, but it's not a blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it's best if functions are self-contained, but it's not a blocker.

done, checked both ARCH_SUFFIX and FILES in a8d7ec9

@wenju-he wenju-he requested a review from frasercrmck August 21, 2025 01:07
# * FILES <string> ...
# List of bitcode files
function(create_compile_targets compile_tgts)
cmake_parse_arguments( ARG "" "ARCH_SUFFIX" "FILES" ${ARGN} )
Copy link
Contributor

Choose a reason for hiding this comment

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

I think it's best if functions are self-contained, but it's not a blocker.

@wenju-he wenju-he merged commit e6d095e into llvm:main Aug 21, 2025
9 checks passed
@wenju-he wenju-he deleted the libclc-only-create-targets-MSVC-generator branch August 21, 2025 23:45
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