[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

[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

[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_

[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] 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
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] 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

[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-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] 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] 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] 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] 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] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Wenju He via cfe-commits
wenju-he wrote: > We could probably come up with some kind of combined `gentype.inc` that does > them both at once good idea. https://github.com/llvm/llvm-project/pull/137932 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Wenju He via cfe-commits
@@ -9,15 +9,31 @@ #define __CLC_DST_ADDR_SPACE local #define __CLC_SRC_ADDR_SPACE global #define __CLC_BODY -#include +#include +#undef __CLC_DST_ADDR_SPACE wenju-he wrote: done, thanks for the suggestion https://github.com/llvm/llvm-project/pull/137932 __

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/137932 >From cafb374de8d77c82fa450b732a122663090f6e34 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 30 Apr 2025 00:44:50 -0700 Subject: [PATCH 1/3] [libclc] Add v3 variants of async_work_group_copy/async_work_gr

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

2025-04-30 Thread Wenju He via cfe-commits
https://github.com/wenju-he closed 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] Skip opt command if opt_flags is empty (PR #130882)

2025-04-30 Thread Wenju He via cfe-commits
wenju-he wrote: close this PR. Original intention of disabling opt -O3 on downstream project was changed. https://github.com/llvm/llvm-project/pull/130882 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/l

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

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

[libclc] [libclc] Add v3 variants of async_work_group_copy/async_work_group_strided_copy/prefetch (PR #137932)

2025-04-30 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/137932 3-component vector type is supported for them per OpenCL spec. >From cafb374de8d77c82fa450b732a122663090f6e34 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 30 Apr 2025 00:44:50 -0700 Subject: [PATCH] [lib

[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] [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] Build for OpenCL 3.0 (PR #135733)

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

[libclc] [libclc] Build for OpenCL 3.0 (PR #135733)

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

[libclc] [libclc] Build for OpenCL 3.0 (PR #135733)

2025-04-23 Thread Wenju He via cfe-commits
@@ -429,7 +411,9 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" ) file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} ) -list( APPEND build_flags -cl-std=${opencl_lang_std} ) +# Build for OpenCL 3.0 an

[libclc] [libclc] Build for OpenCL 3.0 (PR #135733)

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

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

2025-04-23 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135733 >From 64d7bfdceb5a0a6fbf34bb15cd7d6cbeb9214881 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 14 Apr 2025 19:20:25 -0700 Subject: [PATCH 1/6] [libclc] Set OpenCL version to 3.0 This PR is cherry-pick of ht

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

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

[libclc] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

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

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

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > > LGTM. That means we compile for the last OpenCL version, which is 3.0, and > > enable all OpenCL extensions/features, right? > > Yes. Otherwise you have to still write the code to work with the lowest > common denominator. done in commit https://github.com/llvm/llvm-proje

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

2025-04-21 Thread Wenju He via cfe-commits
wenju-he wrote: > An OpenCL 1.2 module could still call a builtin that makes internal use of > CLC `ctz`, for example. Yes, you're right. https://github.com/llvm/llvm-project/pull/135733 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https

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

2025-04-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135733 >From 64d7bfdceb5a0a6fbf34bb15cd7d6cbeb9214881 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 14 Apr 2025 19:20:25 -0700 Subject: [PATCH 1/5] [libclc] Set OpenCL version to 3.0 This PR is cherry-pick of ht

[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] Set OpenCL C version for each target (PR #135733)

2025-04-18 Thread Wenju He via cfe-commits
@@ -387,21 +387,39 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) message( STATUS " device: ${d} ( ${${d}_aliases} )" ) -if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) +# 1.2 is Clang's default OpenCL C language standard to compile for. +set( opencl_lang_std

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

2025-04-17 Thread Wenju He via cfe-commits
wenju-he wrote: > I'd expect the libclc build (or any other runtime support library) to > consistently use the same language version independent of the target. If the > target doesn't support that version (which IIRC isn't actually a hard error > anywhere) and fails to compile on some feature,

[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] Set OpenCL C version for each target (PR #135733)

2025-04-16 Thread Wenju He via cfe-commits
wenju-he wrote: > Yes I think on reflection it's probably okay to compile for the highest > supported OpenCL C version. Yeah I think libclc should compile for the version that target claims supporting. > I believe they're supersets of one another, so a 3.0 builtins library would > still con

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

2025-04-16 Thread Wenju He via cfe-commits
@@ -387,21 +387,39 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) message( STATUS " device: ${d} ( ${${d}_aliases} )" ) -if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) +# 1.2 is Clang's default OpenCL C language standard to compile for. +set( opencl_lang_std

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

2025-04-16 Thread Wenju He via cfe-commits
@@ -387,21 +387,39 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) message( STATUS " device: ${d} ( ${${d}_aliases} )" ) -if ( ARCH STREQUAL spirv OR ARCH STREQUAL spirv64 ) +# 1.2 is Clang's default OpenCL C language standard to compile for. +set( opencl_lang_std

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

2025-04-16 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135733 >From 64d7bfdceb5a0a6fbf34bb15cd7d6cbeb9214881 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 14 Apr 2025 19:20:25 -0700 Subject: [PATCH 1/4] [libclc] Set OpenCL version to 3.0 This PR is cherry-pick of ht

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

2025-04-15 Thread Wenju He via cfe-commits
wenju-he wrote: > Targets may even want to compile libclc for multiple different versions? That > might introduce extra complexity (we'd need "an extra loop", more compilation > time, new naming/versioning schemes for the build artifacts). An application may compile using different -cl-std ver

[libclc] [libclc] Set OpenCL version to 3.0 (PR #135733)

2025-04-15 Thread Wenju He via cfe-commits
@@ -411,6 +411,16 @@ foreach( t ${LIBCLC_TARGETS_TO_BUILD} ) set( LIBCLC_ARCH_OBJFILE_DIR "${LIBCLC_OBJFILE_DIR}/${arch_suffix}" ) file( MAKE_DIRECTORY ${LIBCLC_ARCH_OBJFILE_DIR} ) +# OpenCL 3.0 extensions +string(CONCAT CL_3_0_EXTENSIONS + "-cl-ext=" +

[libclc] [libclc] Set OpenCL version to 3.0 (PR #135733)

2025-04-15 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135733 >From 64d7bfdceb5a0a6fbf34bb15cd7d6cbeb9214881 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 14 Apr 2025 19:20:25 -0700 Subject: [PATCH 1/2] [libclc] Set OpenCL version to 3.0 This PR is cherry-pick of ht

[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] [liblc] only check filename part of the source for avoiding duplication (PR #135710)

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

[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] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

2025-04-14 Thread Wenju He via cfe-commits
wenju-he wrote: > Note I'm in the process of introducing elementwise clz/ctz builtins which > would accomplish this and achieve vector intrinsics. See #131995. It might be > worth waiting for that change instead? thanks @frasercrmck LGTM. Please refactor clz after #131995 close this PR. http

[libclc] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

2025-04-14 Thread Wenju He via cfe-commits
https://github.com/wenju-he closed https://github.com/llvm/llvm-project/pull/135301 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[libclc] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

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

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

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

[libclc] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

2025-04-10 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/135301 >From 5992cc83e904ce047598a1987e2f8ce1926b9292 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 10 Apr 2025 19:34:50 -0700 Subject: [PATCH 1/2] [NFC][libclc] Refine clz to use __builtin_clzg It looks simpler

[libclc] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

2025-04-10 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/135301 It looks simpler to use __builtin_clzg for all unsigned types. >From 5992cc83e904ce047598a1987e2f8ce1926b9292 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 10 Apr 2025 19:34:50 -0700 Subject: [PATCH] [NFC

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

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

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-10 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-10 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

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

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

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

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-10 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-10 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-10 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apac

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

2025-04-10 Thread Wenju He via cfe-commits
@@ -63,13 +65,15 @@ function(compile_to_bc) ${ARG_DEPENDENCIES} DEPFILE ${ARG_OUTPUT}.d ) + add_custom_target( ${ARG_TARGET} DEPENDS ${ARG_OUTPUT}${TMP_SUFFIX} ) wenju-he wrote: > This is still better than what we've got so maybe we can keep an ey

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

2025-04-10 Thread Wenju He via cfe-commits
wenju-he wrote: > On my build this increases the number of targets `ninja -t targets` from 19K > to 28K. That's building all targets. I'm not sure what else we could do about > that and whether it's a problem. yes, the number of targets increase significantly with this approach. But as far as

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-10 Thread Wenju He via cfe-commits
wenju-he wrote: @owenca could you please help me to merge? Thanks. I don't have commit permission. https://github.com/llvm/llvm-project/pull/134529 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo

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

2025-04-10 Thread Wenju He via cfe-commits
@@ -63,13 +65,15 @@ function(compile_to_bc) ${ARG_DEPENDENCIES} DEPFILE ${ARG_OUTPUT}.d ) + add_custom_target( ${ARG_TARGET} DEPENDS ${ARG_OUTPUT}${TMP_SUFFIX} ) wenju-he wrote: I have simplified the code by removing ${ARG_TARGET}-as The issue we

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

2025-04-10 Thread Wenju He via cfe-commits
@@ -283,7 +294,7 @@ function(add_libclc_builtin_set) set( builtins_comp_lib_tgt builtins.comp.${ARG_ARCH_SUFFIX} ) add_custom_target( ${builtins_comp_lib_tgt} -DEPENDS ${bytecode_files} +DEPENDS ${compile_tgts} wenju-he wrote: done, added back ${b

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

2025-04-10 Thread Wenju He via cfe-commits
@@ -256,19 +261,25 @@ function(add_libclc_builtin_set) get_filename_component( file_dir ${file} DIRECTORY ) +string( REPLACE "/" "-" replaced ${file} ) +set( tgt compile_tgt-${ARG_ARCH_SUFFIX}${replaced}) + compile_to_bc( + TARGET ${tgt} TRIPLE ${

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

2025-04-10 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/5] [libclc] Fix commands in compile_to_bc are executed sequentiall

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-09 Thread Wenju He via cfe-commits
@@ -6,6 +6,17 @@ // //===--===// +// cl_khr_global_int32_base_atomics wenju-he wrote: done, you're right that they should be all guarded since they are extensions. Thanks. https://github.c

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

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

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/134529 >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH 1/4] [clang-format] Add 'cl' to enable OpenCL kernel file formatting

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-08 Thread Wenju He via cfe-commits
@@ -126,6 +126,7 @@ def main(): "pb.txt", "textproto", "asciipb", # TextProto +"cl", # OpenCL wenju-he wrote: done, moved after line 108. > Do we want to add "clcpp", # OpenCL C++? I actually don't know about

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/134529 >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH 1/4] [clang-format] Add 'cl' to enable OpenCL kernel file formatting

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-07 Thread Wenju He via cfe-commits
wenju-he wrote: > > > I feel like there are more places where this needs to be addressed if we > > > are going to add it. > > > > > > I added support in language detection for OpenCL in > > [88c1174](https://github.com/llvm/llvm-project/commit/88c11747fcc8db1921dfd8f73c9330c662f7fd91). > > I

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-07 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/134529 >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH 1/3] [clang-format] Add 'cl' to enable OpenCL kernel file formatting

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

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

[clang] [clang-format] Add 'cl' to enable OpenCL kernel file formatting (PR #134529)

2025-04-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/134529 None >From ac389b8b92fbb77c8884515d8f7293b4af17dfa5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Sun, 6 Apr 2025 18:30:42 +0800 Subject: [PATCH] [clang-format] Add 'cl' to enable OpenCL kernel file formattin

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

2025-04-05 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/4] [libclc] Fix commands in compile_to_bc are executed sequentiall

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

2025-04-05 Thread Wenju He via cfe-commits
@@ -283,7 +294,7 @@ function(add_libclc_builtin_set) set( builtins_comp_lib_tgt builtins.comp.${ARG_ARCH_SUFFIX} ) add_custom_target( ${builtins_comp_lib_tgt} -DEPENDS ${bytecode_files} +DEPENDS ${compile_tgts} wenju-he wrote: thanks, I'll add ${b

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

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

[libclc] [NFC][libclc] Merge atomic extension built-ins with identical name into a single file (PR #134489)

2025-04-05 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/134489 Similar to how cl_khr_fp64 and cl_khr_fp16 implementations are put in a same file for math built-ins, this PR do the same to atom_* built-ins. The main motivation is to prevent that two files with same base na

[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] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-26 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/132338 >From 6ce54aa767f8cdff2f938cdce8656e495a1346f0 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 20 Mar 2025 22:01:55 -0700 Subject: [PATCH 1/3] [libclc] link_bc target should depends on target builtins.link.

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

2025-03-26 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck should we check CMAKE_VERSION and use DEPENDS_EXPLICIT_ONLY if the version is 3.27 or higher? I suppose DEPENDS_EXPLICIT_ONLY would be more light-weighted. And we need to keep both DEPENDS_EXPLICIT_ONLY and adding new target path, until llvm uplifts cmake version t

[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-03-24 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck please help to merge, thanks. I don't have merge access. 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] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-23 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/132338 >From 6ce54aa767f8cdff2f938cdce8656e495a1346f0 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 20 Mar 2025 22:01:55 -0700 Subject: [PATCH 1/2] [libclc] link_bc target should depends on target builtins.link.

[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
@@ -313,8 +314,8 @@ function(add_libclc_builtin_set) INTERNALIZE TARGET ${builtins_link_lib_tgt} INPUTS $ -${ARG_INTERNAL_LINK_DEPENDENCIES} - DEPENDENCIES ${builtins_link_lib_tmp_tgt} +$ wenju-he wrote: thanks, changed t

[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] Skip opt command if opt_flags is empty (PR #130882)

2025-03-21 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] link_bc target should depends on target builtins.link.clc-arch_suffix (PR #132338)

2025-03-21 Thread Wenju He via cfe-commits
wenju-he wrote: I've tested on Windows for half a day, it seems this PR can fix the issue. https://github.com/llvm/llvm-project/pull/132338 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-comm

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

2025-03-20 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck could you please review? thanks https://github.com/llvm/llvm-project/pull/132338 ___ 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-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/132338 >From 6ce54aa767f8cdff2f938cdce8656e495a1346f0 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 20 Mar 2025 22:01:55 -0700 Subject: [PATCH] [libclc] link_bc target should depends on target builtins.link.clc-

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

2025-03-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he edited https://github.com/llvm/llvm-project/pull/132338 ___ 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-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/130882 >From 1727cb49ebbee324ecad0a766ec341eb1aed082b Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 11 Mar 2025 19:05:25 -0700 Subject: [PATCH 1/6] [libclc] Skip opt command if opt_flags is empty When the flag i

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

2025-03-20 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] add --only-needed to llvm-link when INTERNALIZE flag is set (PR #130871)

2025-03-20 Thread Wenju He via cfe-commits
wenju-he wrote: @frasercrmck could you please try this PR on https://github.com/intel/llvm repo? My experiment: clang --version clang version 21.0.0git (https://github.com/llvm/llvm-project f5ee10538b68835112323c241ca7db67ca78bf62) before PR: find . -name "builtins.link*.bc" -printf "%s\n" |

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

2025-03-19 Thread Wenju He via cfe-commits
wenju-he wrote: > Another option would be to unconditionally have builtin.opt targets but if no > flags are passed, just make them empty targets that rely only on builtin.link > targets. Thanks for the suggestion. Done. Please review again. https://github.com/llvm/llvm-project/pull/130882 __

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

2025-03-18 Thread Wenju He via cfe-commits
https://github.com/wenju-he edited 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-18 Thread Wenju He via cfe-commits
@@ -342,21 +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

  1   2   >