https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/139871
This enables file_specific_compile_options to take precedence over ARG_COMPILE_FLAGS. For example, if we add -fno-slp-vectorize to COMPILE_OPTIONS of a file, the behavior changes as follows: * Before this PR: -fno-slp-vectorize is overwritten by -O3, resulting in SLP vectorizer remaining enabled. * After this PR: -fno-slp-vectorize overwrites -O3, effectively disabling SLP vectorizer. >From f1d805ed5467d6ca3b8162e4cc5baddf2961f26d Mon Sep 17 00:00:00 2001 From: Wenju He <wenju...@intel.com> Date: Wed, 14 May 2025 02:58:35 -0700 Subject: [PATCH] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS This enables file_specific_compile_options to take precedence over ARG_COMPILE_FLAGS. For example, if we add -fno-slp-vectorize to COMPILE_OPTIONS of a file, the behavior changes as follows: * Before this PR: -fno-slp-vectorize is overwritten by -O3, resulting in SLP vectorizer remaining enabled. * After this PR: -fno-slp-vectorize overwrites -O3, effectively disabling SLP vectorizer. --- libclc/cmake/modules/AddLibclc.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libclc/cmake/modules/AddLibclc.cmake b/libclc/cmake/modules/AddLibclc.cmake index 3be2bf231eb30..d00b16a899664 100644 --- a/libclc/cmake/modules/AddLibclc.cmake +++ b/libclc/cmake/modules/AddLibclc.cmake @@ -284,8 +284,9 @@ function(add_libclc_builtin_set) TRIPLE ${ARG_TRIPLE} INPUT ${input_file} OUTPUT ${output_file} - EXTRA_OPTS -fno-builtin -nostdlib "${file_specific_compile_options}" - "${ARG_COMPILE_FLAGS}" -I${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} + EXTRA_OPTS -fno-builtin -nostdlib "${ARG_COMPILE_FLAGS}" + "${file_specific_compile_options}" + -I${CMAKE_CURRENT_SOURCE_DIR}/${file_dir} DEPENDENCIES ${input_file_dep} ) list( APPEND compile_tgts ${tgt} ) _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits