[libclc] [libclc] Set OpenCL C version for each target (PR #135733)

2025-04-16 Thread Wenju He via cfe-commits
wenju-he wrote: > Another question would be whether or not we should be advertising a 2.X or > 3.X library if we don't have all the builtins? Is this a degradation? That > might depend on downstream toolchains and if/how they react to versioning > info in the LLVM IR. We can incrementally add

[libclc] [libclc] Fix unguarded use of image types (PR #136871)

2025-04-23 Thread Wenju He via cfe-commits
wenju-he wrote: thanks @frasercrmck https://github.com/llvm/llvm-project/pull/136871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Wenju He via cfe-commits
@@ -420,12 +420,37 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) -D${CLC_TARGET_DEFINE} # All libclc builtin libraries see CLC headers -I${CMAKE_CURRENT_SOURCE_DIR}/clc/include + # Error on undefined macros + -Werror=undef ) if( NOT "${cpu}"

[libclc] [liblc] only check filename part of the source for avoiding duplication (PR #135710)

2025-04-14 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/135710 llvm-diff shows this PR has no changes to amdgcn--amdhsa.bc. Motivation is that in our downstream the same category of target built-ins, e.g. math, are organized in several different folders. For example, in t

[libclc] [libclc] add ctz built-in implementation to clc and generic (PR #135309)

2025-04-15 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135309 >From 31423376e35f34ca032fe3d11998537912ba2c63 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 10 Apr 2025 20:10:41 -0700 Subject: [PATCH 1/2] [libclc] add ctz built-in implementation to clc and generic --

[libclc] [libclc] only check filename part of the source for avoiding duplication (PR #135710)

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > You could just have `cos_fp32.cl` and `cos_fp16.cl`, of course. Yes. To enable overriding generic implementation of `cos.cl`, the names in target folder could be `cos.cl` and `cos_fp16.cl` > I would like to further investigate weak linkage as another means of > overriding sp

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/130755 In libclc, we observe that compiling OpenCL source files to bitcode is executed sequentially on Windows, which increases debug build time by about an hour. add_custom_command may introduce additional implicit d

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/130755 >From 1f8b5bfbfea6b562e9cae088256e8e5dddf0a335 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 11 Mar 2025 04:24:36 -0700 Subject: [PATCH 1/2] [libclc] Fix commands in compile_to_bc are executed sequentiall

[libclc] [libclc] Fix commands in compile_to_bc are executed sequentially (PR #130755)

2025-03-11 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck could you please review? thanks https://github.com/llvm/llvm-project/pull/130755 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Skip opt command if opt_flags is empty (PR #130882)

2025-03-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/130882 When the flag is empty, the opt command won't modify the bitcode; however, the command is slow for large bitcode files in debug mode. >From 1727cb49ebbee324ecad0a766ec341eb1aed082b Mon Sep 17 00:00:00 2001 Fro

[libclc] [libclc] Skip opt command if opt_flags is empty (PR #130882)

2025-03-12 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck could you please review? thanks https://github.com/llvm/llvm-project/pull/130882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] add --only-needed to llvm-link when INTERNALIZE flag is set (PR #130871)

2025-03-12 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck could you please review? thanks https://github.com/llvm/llvm-project/pull/130871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-22 Thread Wenju He via cfe-commits
@@ -211,8 +211,9 @@ endfunction() # * ALIASES ... # List of aliases # * INTERNAL_LINK_DEPENDENCIES ... wenju-he wrote: done https://github.com/llvm/llvm-project/pull/132338 ___ cfe-commits mailing list cfe-

[libclc] [libclc] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-25 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/132338 Currently link_bc command depends on the bitcode file that is associated with custom target builtins.link.clc-arch_suffix. On windows we randomly see following error: ` Generating builtins.link.clc-${ARCH}--.

[libclc] [libclc] Skip opt command if opt_flags is empty (PR #130882)

2025-04-04 Thread Wenju He via cfe-commits
@@ -342,22 +342,32 @@ function(add_libclc_builtin_set) set( builtins_opt_lib_tgt builtins.opt.${ARG_ARCH_SUFFIX} ) - # Add opt target - add_custom_command( OUTPUT ${builtins_opt_lib_tgt}.bc -COMMAND ${opt_exe} ${ARG_OPT_FLAGS} -o ${builtins_opt_lib_tgt}.bc - ${bu

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-14 Thread Wenju He via cfe-commits
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:

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-14 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck please help to review, thanks. https://github.com/llvm/llvm-project/pull/139871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Improving vector code generated from scalar code (PR #140008)

2025-05-15 Thread Wenju He via cfe-commits
wenju-he wrote: > I'd also like to rename those macros at some point as I think they obfuscate > the kind of vectorization (basically, scalarization) going on. LGTM thanks @frasercrmck for the review. Please help to merge, thanks. https://github.com/llvm/llvm-project/pull/140008 _

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-15 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck please help to merge, thanks https://github.com/llvm/llvm-project/pull/139871 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Improving vector code generated from scalar code (PR #140008)

2025-05-14 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/140008 The previous method splits vector data into two halves. shuffle_vector concatenates the two results into a vector data of original size. This PR eliminates the use of shuffle_vector. >From c17e8d57045e32d4602

[libclc] [libclc] Improving vector code generated from scalar code (PR #140008)

2025-05-14 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck please help to review, thanks. https://github.com/llvm/llvm-project/pull/140008 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/140679 >From 5015512439f6ba846223b1d04e71d8cdae36d3fa Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 19 May 2025 22:14:55 -0700 Subject: [PATCH] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration Al

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Wenju He via cfe-commits
wenju-he wrote: > Sorry, just merged #140557 so you'll have to fix the conflicts before merging. done, thanks https://github.com/llvm/llvm-project/pull/140679 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Wenju He via cfe-commits
@@ -6,41 +6,14 @@ // //===--===// -#define _CLC_SHUFFLE2_DECL(TYPE, MASKTYPE, RETTYPE) \ - _CLC_OVERLOAD _CLC_DECL RETTYPE shuffle2(TYPE x, TYPE y, MASKTYPE mask); +#define __CLC_

[clang] [ClangTool] Use CC1Option flag resource-dir in injectResourceDir (PR #140870)

2025-05-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/140870 This PR fixes ClangTool error in -cc1 mode: error: unknown argument: '-resource-dir= >From f5e675f17ea737b0668e626f34d013153368425e Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 21 May 2025 02:08:34 -0700

[clang] [ClangTool] Use CC1Option flag resource-dir in injectResourceDir (PR #140870)

2025-05-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/140870 >From f5e675f17ea737b0668e626f34d013153368425e Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 21 May 2025 02:08:34 -0700 Subject: [PATCH 1/2] [ClangTool] Use CC1Option flag resource-dir in injectResourceDi

[libclc] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration (PR #140679)

2025-05-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/140679 >From 5015512439f6ba846223b1d04e71d8cdae36d3fa Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 19 May 2025 22:14:55 -0700 Subject: [PATCH 1/2] [libclc] Re-use shuffle_decl.inc in OpenCL shuffle2 declaration

[libclc] [libclc] Append file_specific_compile_options after ARG_COMPILE_FLAGS (PR #139871)

2025-05-19 Thread Wenju He via cfe-commits
wenju-he wrote: > Sure, no problem. You can probably request [commit > access](https://llvm.org/docs/DeveloperPolicy.html#obtaining-commit-access) > by now, though. thanks @frasercrmck I've requested at https://github.com/llvm/llvm-project/issues/140521, please help to review, thank you. ht

[clang] [ClangTool] Use CC1Option flag resource-dir in injectResourceDir (PR #140870)

2025-05-26 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/140870 >From f5e675f17ea737b0668e626f34d013153368425e Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 21 May 2025 02:08:34 -0700 Subject: [PATCH 1/3] [ClangTool] Use CC1Option flag resource-dir in injectResourceDi

[clang] [Clang] Add resource_dir_EQ flag to CC1Option group (PR #140870)

2025-05-26 Thread Wenju He via cfe-commits
https://github.com/wenju-he edited https://github.com/llvm/llvm-project/pull/140870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add resource_dir_EQ flag to CC1Option group (PR #140870)

2025-05-26 Thread Wenju He via cfe-commits
https://github.com/wenju-he edited https://github.com/llvm/llvm-project/pull/140870 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add resource_dir_EQ flag to CC1Option group (PR #140870)

2025-05-26 Thread Wenju He via cfe-commits
wenju-he wrote: > do we know why > https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Driver/Options.td#L5894-L5901 > doesn't declare _EQ version for cc1? Git history shows the earliest commit https://github.com/llvm/llvm-project/commit/f3e624ca73b007552554b31358f4abde9eb2d3b7

<    1   2