Skip to content

Conversation

wenju-he
Copy link
Contributor

@wenju-he wenju-he commented Sep 4, 2025

Our downstream libclc add a few more targets that customizes build_flags and opt_flags. Then in each customization block, MACRO_ARCH is defined to be ${ARCH}.
Hoisting MACRO_ARCH definition out of if-else-end block avoids code duplication. This also avoids potential error when MACRO_ARCH definition is forgotten, e.g. in intel/llvm#19971.

Our downstream libclc add a few more targets that customizes build_flags
and opt_flags. Then in each customization block, MACRO_ARCH is defined
to be ${ARCH}.
Hoisting MACRO_ARCH definition out of if-else-end block avoids code
duplication. This also avoids potential error when MACRO_ARCH definition
is forgotten, e.g. in intel/llvm#19971.
@wenju-he wenju-he requested a review from frasercrmck September 4, 2025 02:51
@llvmbot llvmbot added the libclc libclc OpenCL library label Sep 4, 2025
@wenju-he wenju-he requested a review from arsenm September 4, 2025 02:57
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.

LGTM. I don't like set repetition in if/else either. Not least because it's worse for downstreams.

@wenju-he wenju-he merged commit fb5626f into llvm:main Sep 4, 2025
11 checks passed
@wenju-he wenju-he deleted the refine-MACRO_ARCH branch September 4, 2025 23:35
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