[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-21 Thread Wenju He via cfe-commits
@@ -132,6 +124,33 @@ function(link_bc) ) endfunction() +# Create a custom target for each bitcode file, which is the output of a custom +# command. This is required for parallel compilation of the custom commands that +# generate the bitcode files when using the CMake MSVC

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/154479 >From 75b5f46b2858b399482082eabd1388167aaa58e4 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 20 Aug 2025 07:57:54 +0200 Subject: [PATCH 1/4] [libclc] Only create a target per each compile command for cmak

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

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

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-20 Thread Wenju He via cfe-commits
@@ -132,6 +124,33 @@ function(link_bc) ) endfunction() +# Create a custom target for each bitcode file, which is the output of a custom +# command. This is required for parallel compilation of the custom commands that +# generate the bitcode files when using the CMake MSVC

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-20 Thread Wenju He via cfe-commits
@@ -335,19 +348,28 @@ function(add_libclc_builtin_set) endif() endforeach() + set( builtins_comp_lib_tgt builtins.comp.${ARG_ARCH_SUFFIX} ) + if ( CMAKE_GENERATOR MATCHES "Visual Studio" ) wenju-he wrote: > Perhaps a comment above this to explain what

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/154479 >From 75b5f46b2858b399482082eabd1388167aaa58e4 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 20 Aug 2025 07:57:54 +0200 Subject: [PATCH 1/3] [libclc] Only create a target per each compile command for cmak

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

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

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

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

[libclc] [libclc] Only create a target per each compile command for cmake MSVC generator (PR #154479)

2025-08-19 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/154479 libclc sequential build issue addressed in commit 0c21d6b4c8ad 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 N

[libclc] [libclc] Implement __clc_get_local_size/__clc_get_max_sub_group_size for amdgcn (PR #153785)

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

[libclc] [libclc] Enable DEPENDS_EXPLICIT_ONLY if cmake version >= 3.27 (PR #154084)

2025-08-18 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/154084 Commit 0c21d6b4c8ad fixed sequential build of libclc on Windows by adding a target for each compile command. This PR conditionally enables DEPENDS_EXPLICIT_ONLY and requires at least cmake version 3.27. DEPEND

[libclc] [NFC][libclc] add missing __CLC_ prefix all internal macros (PR #153523)

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

[libclc] [libclc] Implement __clc_get_local_size/__clc_get_max_sub_group_size for amdgcn (PR #153785)

2025-08-17 Thread Wenju He via cfe-commits
wenju-he wrote: https://github.com/llvm/llvm-project/pull/153785/commits/a8fcf405007d05d123f397f66b4139d53586c1b5 is a minor fix to return 1 for out-of-bound dim https://github.com/llvm/llvm-project/pull/153785 ___ cfe-commits mailing list cfe-commits

[libclc] [libclc] Implement __clc_get_local_size/__clc_get_max_sub_group_size for amdgcn (PR #153785)

2025-08-17 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/153785 >From d0a9e7fa683d294aaabf24ccc34cea54a8a5eb1f Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 15 Aug 2025 12:43:54 +0200 Subject: [PATCH 1/2] [libclc] Implement __clc_get_local_size/__clc_get_max_sub_group

[libclc] [libclc] Fix out-of-bound value for workitem functions according to OpenCL spec (PR #153784)

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

[libclc] [libclc] Implement __clc_get_local_size/__clc_get_max_sub_group_size for amdgcn (PR #153785)

2025-08-15 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/153785 This simplifies downstream refactoring of libspirv workitem function in https://github.com/intel/llvm/tree/sycl/libclc/libspirv/lib/generic >From d0a9e7fa683d294aaabf24ccc34cea54a8a5eb1f Mon Sep 17 00:00:00 20

[libclc] [libclc] Fix out-of-bound value for workitem functions according to OpenCL spec (PR #153784)

2025-08-15 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/153784 None >From c51ac2969099be4831c3d296fffec9e6f4fce780 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 15 Aug 2025 12:37:00 +0200 Subject: [PATCH] [libclc] Fix out-of-bound value for workitem functions accord

[libclc] [libclc] Use __ocml_cos/sin/tan/exp*/lgamma/log*/fmax/fmin/sqrt for AMDGPU (PR #153328)

2025-08-13 Thread Wenju He via cfe-commits
wenju-he wrote: > If you want to use these implementations, I'd rather merge the OCML content > into libclc and migrate over to using it. Tag @frasercrmck The amdgcn implementation probably needs improvement to use llvm elementwise builtin for e.g. half/float exp* https://github.com/llvm/llv

[libclc] [libclc] Enable -ffp-contract=fast compile option for math native_* functions (PR #153137)

2025-08-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/153137 According to OpenCL spec, native_* functions have implementation-defined accuracy and typically have better performance. We can enable floating- point contraction optimizations for them. >From 719a6914321afc0

[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-11 Thread Wenju He via cfe-commits
@@ -0,0 +1,21 @@ +//===--===// +// +// 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] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-11 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/152275 >From c48a94749e7e4ee261895826f2df2e2c48f040ef Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 6 Aug 2025 11:07:15 +0200 Subject: [PATCH 1/3] [libclc] update __clc_mem_fence: add MemorySemantic arg and use

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

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

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

2025-08-10 Thread Wenju He via cfe-commits
wenju-he wrote: > LGTM if you've tested it and it works 👍 Yes, the fix is verified both locally and in our internal CI. I also fixed alias install in https://github.com/llvm/llvm-project/pull/152703/commits/b6cbefcbc06e42d7107723cb5b37749f3b1e0931. @frasercrmck please review this commit again

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

2025-08-10 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/152703 >From be71d635d2de980797be595c4f35f307c703bc96 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 8 Aug 2025 05:59:54 -0700 Subject: [PATCH 1/3] [libclc] Fix libclc install on Windows when MSVC generator is us

[libclc] [libclc] Implement clc_log/sinpi/sqrt with __nv_* functions (PR #150174)

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

[clang] [libclc] [clang] Add the ability to link libclc OpenCL libraries (PR #146503)

2025-08-08 Thread Wenju He via cfe-commits
@@ -92,10 +95,14 @@ else() get_host_tool_path( llvm-link LLVM_LINK llvm-link_exe llvm-link_target ) get_host_tool_path( opt OPT opt_exe opt_target ) endif() -endif() -# Setup the paths where libclc runtimes should be stored. -set( LIBCLC_OUTPUT_LIBRARY_DIR ${CMAKE_C

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

2025-08-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/152703 >From be71d635d2de980797be595c4f35f307c703bc96 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 8 Aug 2025 05:59:54 -0700 Subject: [PATCH 1/2] [libclc] Fix libclc install on Windows when MSVC generator is us

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

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

[libclc] [libclc] Fix libclc install on Windows when MSVC generator is used (PR #152703)

2025-08-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/152703 >From be71d635d2de980797be595c4f35f307c703bc96 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 8 Aug 2025 05:59:54 -0700 Subject: [PATCH] [libclc] Fix libclc install on Windows when MSVC generator is used

[libclc] [libclc] Fix libclc bitcodes install on windows when cmake msvc generator is used (PR #152666)

2025-08-08 Thread Wenju He via cfe-commits
wenju-he wrote: sorry, not working, closing PR https://github.com/llvm/llvm-project/pull/152666 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Fix libclc bitcodes install on windows when cmake msvc generator is used (PR #152666)

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

[clang] [libclc] [clang] Add the ability to link libclc OpenCL libraries (PR #146503)

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

[clang] [libclc] [clang] Add the ability to link libclc OpenCL libraries (PR #146503)

2025-08-08 Thread Wenju He via cfe-commits
@@ -92,10 +95,14 @@ else() get_host_tool_path( llvm-link LLVM_LINK llvm-link_exe llvm-link_target ) get_host_tool_path( opt OPT opt_exe opt_target ) endif() -endif() -# Setup the paths where libclc runtimes should be stored. -set( LIBCLC_OUTPUT_LIBRARY_DIR ${CMAKE_C

[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

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

[libclc] [libclc] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-07 Thread Wenju He via cfe-commits
@@ -0,0 +1,21 @@ +//===--===// +// +// 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] Delete unused clc/shared/binary_decl_with_scalar_second_arg.inc (PR #152463)

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

[libclc] [NFC][libclc] Delete unused clc/shared/binary_decl_with_scalar_second_arg.inc (PR #152463)

2025-08-07 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152463 None >From 10c997f9de3c2a99b2f7bd507523be901d7c6ee7 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 7 Aug 2025 00:47:50 -0700 Subject: [PATCH] [NFC][libclc] Delete unused clc/shared/binary_decl_with_scalar

[libclc] [libclc] Add __attribute__((const)) to functions that don't access memory (PR #152456)

2025-08-07 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152456 Before this PR, PostOrderFunctionAttrsPass in opt run can deduce memory(none) for these functions. This PR explicitly adds the attribute to align with Clang's OpenCL headers and ensures the attribute is prese

[libclc] [libclc] Add missing clc/lib/ptx-nvidiacl/SOURCES to CMAKE_CONFIGURE_DEPENDS (PR #152431)

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

[libclc] [libclc] Implement __clc_rsqrt with __ocml_rsqrt_* functions (PR #152436)

2025-08-06 Thread Wenju He via cfe-commits
wenju-he wrote: @arsenm I'm not sure if the change is an improvement, please review. https://github.com/llvm/llvm-project/pull/152436 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Implement __clc_rsqrt with __ocml_rsqrt_* functions (PR #152436)

2025-08-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152436 Motivation is to upstream use of __ocml_rsqrt_ in https://github.com/intel/llvm/blob/sycl/libclc/libspirv/lib/amdgcn-amdhsa/math/rsqrt.cl llvm-diff shows vectorized calls of llvm.sqrt.v2f32 and fdiv are scalari

[libclc] [libclc] Add missing clc/lib/ptx-nvidiacl/SOURCES to CMAKE_CONFIGURE_DEPENDS (PR #152431)

2025-08-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152431 None >From 73299b736c61a2042aeadf46e62a93e11ca5a890 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 7 Aug 2025 05:03:56 +0200 Subject: [PATCH] [libclc] Add missing clc/lib/ptx-nvidiacl/SOURCES to CMAKE_CON

[libclc] [libclc] Move mem_fence and barrier to clc library (PR #151446)

2025-08-06 Thread Wenju He via cfe-commits
@@ -0,0 +1,37 @@ +//===--===// +// +// 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] update __clc_mem_fence: add MemorySemantic arg and use __builtin_amdgcn_fence for AMDGPU (PR #152275)

2025-08-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152275 It is necessary to add MemorySemantic argument which means the memory or address space to which the memory ordering is applied. The MemorySemantic is also necessary for implementing the SPIR-V MemoryBarrier i

[libclc] [libclc] Set TARGET_FILE property for prepare-${obj_suffix} target (PR #152245)

2025-08-05 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/152245 The target's output bitcode `libclc_builtins_lib` is located in a sub-directory in clang resource directory since df7473673214. Setting TARGET_FILE property can allow targets in non-libclc project to obtain th

[libclc] [libclc] Move mem_fence and barrier to clc library (PR #151446)

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

[libclc] [libclc] Move mem_fence and barrier to clc library (PR #151446)

2025-08-05 Thread Wenju He via cfe-commits
@@ -0,0 +1,37 @@ +//===--===// +// +// 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] Move mem_fence and barrier to clc library (PR #151446)

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

[libclc] [libclc] Move mem_fence and barrier to clc library (PR #151446)

2025-08-05 Thread Wenju He via cfe-commits
@@ -0,0 +1,36 @@ +//===--===// +// +// 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] Move mem_fence and barrier to clc library (PR #151446)

2025-08-05 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/151446 >From eed56d228c0613f563c23f9be23d681ef3d87f2b Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 31 Jul 2025 05:07:23 +0200 Subject: [PATCH 1/3] [libclc] Move mem_fence and barrier to clc library __clc_mem_fe

[libclc] [libclc] Refine id in async_work_group_copy STRIDED_COPY (PR #151644)

2025-07-31 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/151644 Move id first along 0th dimension to achieve coalesced memory access when stride is 1. >From 1fe808b52e11dfe569c489a9dc8f1cdd3fa87afc Mon Sep 17 00:00:00 2001 From: Wenju He Date: Fri, 1 Aug 2025 07:45:50 +02

[libclc] [libclc] Move mem_fence and barrier to clc library (PR #151446)

2025-07-30 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/151446 >From eed56d228c0613f563c23f9be23d681ef3d87f2b Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 31 Jul 2025 05:07:23 +0200 Subject: [PATCH 1/2] [libclc] Move mem_fence and barrier to clc library __clc_mem_fe

[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-29 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM. I think llvm-spirv should be fixed, so that we can also use __builtin_elementwise_max/minimumnum for the target. https://github.com/llvm/llvm-project/pull/128506 ___ cfe-commits mailing lis

[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-29 Thread Wenju He via cfe-commits
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { return (y < x) ? y : x; wenju-he wrote: >I wonder if we in fact want to have `half` use `__builtin_fminf16`? We can >simplify the definitions if all types are using a builtin. What do

[libclc] [libclc] Fix building top-level 'libclc' target (PR #150972)

2025-07-29 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/150972 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-28 Thread Wenju He via cfe-commits
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { return (y < x) ? y : x; wenju-he wrote: can we use this same implementation for float and double? https://github.com/llvm/llvm-project/pull/128506

[libclc] [libclc] Fix building top-level 'libclc' target (PR #150972)

2025-07-28 Thread Wenju He via cfe-commits
@@ -5,6 +5,9 @@ if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) endif() set(LLVM_SUBPROJECT_TITLE "libclc") +# Top level target used to build all Libclc libraries. +add_custom_target( libclc ALL ) wenju-he wrote: can we put this line near line 48~49, o

[libclc] [libclc] Simplify unary_def_scalarize.inc's use in __clc_erf/erfc/tgamma (PR #150181)

2025-07-23 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/150181 Also delete unary_def_via_fp32.inc. There are small changes in amdgcn--amdhsa.bc due to vector conversion is scalarized, e.g. %2 = fpext <4 x half> %0 to <4 x float> %3 = extractelement <4 x float> %2, i64

[libclc] [libclc] Implement clc_log/sinpi/sqrt with __nv_* functions (PR #150174)

2025-07-22 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/150174 This is to upstream implementations in https://github.com/intel/llvm/tree/sycl/libclc/clc/lib/ptx-nvidiacl/math >From d4fcaf56d63efe283240bfc582706e268e30c854 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed

[libclc] [libclc] Add generic native half implementation of __clc_normalize (PR #150165)

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

[libclc] [libclc] Add native half implementation of __clc_normalize (PR #150165)

2025-07-22 Thread Wenju He via cfe-commits
wenju-he wrote: llvm-diff amdgcn--amdhsa.bc.new amdgcn--amdhsa.bc.old ``` in function _Z9normalizeDh: in block %1 / %1: > %2 = fpext half %0 to float %2 = fcmp one half %0, 0xH > %4 = select i1 %3, float 1.00e+00, float 0.00e+00 > %5 = tail call noundef flo

[libclc] [libclc] Add native half implementation of __clc_normalize (PR #150165)

2025-07-22 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/150165 This is ported from https://github.com/intel/llvm/blob/sycl/libclc/libspirv/lib/generic/geometric/normalize.cl and can pass a closed-source OpenCL CTS "test_geometrics geom_normalize --half CL_DEVICE_TYPE_GPU"

[libclc] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-22 Thread Wenju He via cfe-commits
wenju-he wrote: > If the decision is the conformance test continues doing what it has been > doing, it should directly map to llvm.minimumnum/maximumnum. For now, @frasercrmck can we update this PR to use __builtin_elementwise_maximumnum/minimumnum so that OpenCL CTS can pass? https://github.

[clang] [Clang] Add elementwise maximumnum/minimumnum builtin functions (PR #149775)

2025-07-21 Thread Wenju He via cfe-commits
@@ -4108,6 +4108,22 @@ RValue CodeGenFunction::EmitBuiltinExpr(const GlobalDecl GD, unsigned BuiltinID, return RValue::get(Result); } + case Builtin::BI__builtin_elementwise_maximumnum: { +Value *Op0 = EmitScalarExpr(E->getArg(0)); wenju-he wrote:

[clang] [Clang] Add elementwise maximumnum/minimumnum builtin functions (PR #149775)

2025-07-21 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/149775 Addresses https://github.com/llvm/llvm-project/issues/112164. minimumnum and maximumnum intrinsics were added in 5bf81e53dbea. The new built-ins can be used for implementing OpenCL math function fmax and fmin

[libclc] [libclc] Fix installed symlinks to be relative again (PR #149728)

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

[libclc] [libclc] Fix installed symlinks to be relative again (PR #149728)

2025-07-20 Thread Wenju He via cfe-commits
@@ -425,17 +425,21 @@ function(add_libclc_builtin_set) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) endif() - if(CMAKE_HOST_UNIX OR LLVM_USE_SYMLINKS) -set(LIBCLC_LINK_OR_COPY create_symlink) - else() -set(LIBCLC_LINK_OR_COPY copy) - endif() - foreach(

[libclc] [libclc] Fix installed symlinks to be relative again (PR #149728)

2025-07-20 Thread Wenju He via cfe-commits
@@ -425,17 +425,21 @@ function(add_libclc_builtin_set) WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) endif() - if(CMAKE_HOST_UNIX OR LLVM_USE_SYMLINKS) -set(LIBCLC_LINK_OR_COPY create_symlink) - else() -set(LIBCLC_LINK_OR_COPY copy) - endif() - foreach(

[libclc] [libclc] Enable `clang fp reciprocal` in clc_native_divide/recip/rsqrt/tan (PR #149269)

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

[libclc] [libclc] Enable `clang fp reciprocal` in clc_native_divide/recip/rsqrt/tan (PR #149269)

2025-07-17 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/149269 >From 9ac644cb8ed43ac28e0ee715f0a0e6bed4df470a Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 17 Jul 2025 10:02:20 +0200 Subject: [PATCH 1/2] [libclc] Enable `clang fp reciprocal` in clc_native_divide/reci

[libclc] [libclc] Enable `clang fp reciprocal` in clc_native_divide/recip/rsqrt/tan (PR #149269)

2025-07-17 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/149269 The pragma adds `arcp` flag to `fdiv` instruction in these functions. The flag can provide better performance. >From 9ac644cb8ed43ac28e0ee715f0a0e6bed4df470a Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu,

[libclc] [NFC][libclc] Delete clc/include/clc/relational/floatn.inc (PR #149252)

2025-07-16 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/149252 llvm-diff shows no change to amdgcn--amdhsa.bc. >From 91827fa45fbf45936e57241b0bb0c1a215112834 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 17 Jul 2025 07:27:50 +0200 Subject: [PATCH] [NFC][libclc] Delet

[libclc] [libclc] Add generic implementation of bitfield_insert/extract,bit_reverse (PR #149070)

2025-07-16 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/149070 >From 9f8b12e6cf600cd05bab586e3d521e5354789e12 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 16 Jul 2025 12:44:48 +0200 Subject: [PATCH 1/3] [libclc] Add generic implementation of bitfield_insert/extract,

[clang] [SPIR] Set MaxAtomicInlineWidth minimum size to 32 for spir32 and 64 for spir64 (PR #148997)

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

[clang] [SPIR] Set MaxAtomicInlineWidth minimum size to 32 for spir32 and 64 for spir64 (PR #148997)

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

[clang] [SPIR] Set MaxAtomicInlineWidth minimum size to 32 for spir32 and 64 for spir64 (PR #148997)

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

[libclc] [libclc] Add generic implementation of bitfield_insert/extract,bit_reverse (PR #149070)

2025-07-16 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/149070 The implementation is based on reference implementation in OpenCL-CTS/test_integer_ops. The generic implementations pass OpenCL-CTS/test_integer_ops tests on Intel GPU. >From 9f8b12e6cf600cd05bab586e3d521e535

[libclc] [libclc] Enable -fdiscard-value-names build flag to reduce bitcode size (PR #149016)

2025-07-16 Thread Wenju He via cfe-commits
wenju-he wrote: > I think this could optionally do with a comment before explaining what this > flag is helping to achieve, but it's not a blocker. it is explained at https://clang.llvm.org/docs/UsersManual.html#id72 and reducing size and verbosity is what this flag is intended for. I mean the

[libclc] [libclc] Move CMake for prepare_builtins to a subdirectory (PR #148815)

2025-07-15 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/148815 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move CMake for prepare_builtins to a subdirectory (PR #148815)

2025-07-15 Thread Wenju He via cfe-commits
@@ -164,34 +164,14 @@ endif() list( SORT LIBCLC_TARGETS_TO_BUILD ) -# Construct LLVM version define -set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" ) - # This needs to be set before any target that needs it # We need to use LLVM_INCLUD

[libclc] [libclc] Move CMake for prepare_builtins to a subdirectory (PR #148815)

2025-07-15 Thread Wenju He via cfe-commits
@@ -0,0 +1,24 @@ +# Construct LLVM version define +set( LLVM_VERSION_DEFINE "-DHAVE_LLVM=0x${LLVM_VERSION_MAJOR}0${LLVM_VERSION_MINOR}" ) + +# Setup prepare_builtins tools +set(LLVM_LINK_COMPONENTS wenju-he wrote: add a space after `(` to align with the style in

[libclc] [libclc] Add generic implementation of some atomic functions in OpenCL spec section 6.15.12.7 (PR #146814)

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

[libclc] [libclc] Add generic implementation of some atomic functions in OpenCL spec section 6.15.12.7 (PR #146814)

2025-07-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] Add generic implementation of some atomic functions in OpenCL spec section 6.15.12.7 (PR #146814)

2025-07-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] Remove catch-all opencl/clc.h (PR #147490)

2025-07-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/147490 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Declare workitem built-ins in clc, move ptx-nvidiacl workitem built-ins into clc (PR #144333)

2025-07-07 Thread Wenju He via cfe-commits
wenju-he wrote: > > > Perhaps we need a stripped down OpenCL header, like > > > `clc/opencl/opencl-base.h` which includes just the types and macro defs? > > > > > > See #146840 for an example of this approach. > > thanks @frasercrmck I'll update OpenCL headers of this PR after #146840 is > l

[libclc] [libclc] Fix typo in OpenCL header math/sincos.h (PR #147244)

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

[libclc] [libclc] Fix typo in OpenCL header math/sincos.h (PR #147244)

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

[libclc] [libclc] Fix typo in OpenCL header math/sincos.h (PR #147244)

2025-07-07 Thread Wenju He via cfe-commits
wenju-he wrote: > This isn't `NFC`, though? Removed `NFC`. I was not seeing changes in OpenCL bitcode files. https://github.com/llvm/llvm-project/pull/147244 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[libclc] [libclc] Fix typo in OpenCL header math/sincos.h (PR #147244)

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

[libclc] [NFC][libclc] Fix typo in OpenCL header math/sincos.h (PR #147244)

2025-07-07 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/147244 None >From c839f41508410f0fba1206d4b1cf34e52b92fa65 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Mon, 7 Jul 2025 09:07:45 +0200 Subject: [PATCH] [NFC][libclc] Fix typo in OpenCL header math/sincos.h --- lib

[libclc] [libclc] Add generic implementation of some atomic functions in OpenCL spec section 6.15.12.7 (PR #146814)

2025-07-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/146814 >From 6429b5538dcfcd9de262f6f0a49d8283db8f5db9 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 2 Jul 2025 17:11:56 -0700 Subject: [PATCH 1/2] [libclc] Add generic implementation of some atomic functions in

[libclc] [NFC][libclc] Rename __CLC_FUNCTION to either FUNCTION or __IMPL_FUNCTION (PR #146999)

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

[libclc] [libclc] Reduce include usage in OpenCL builtins (PR #146840)

2025-07-06 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146840 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Add generic implementation of some atomic functions in OpenCL spec section 6.15.12.7 (PR #146814)

2025-07-03 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/146814 >From 6429b5538dcfcd9de262f6f0a49d8283db8f5db9 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 2 Jul 2025 17:11:56 -0700 Subject: [PATCH 1/2] [libclc] Add generic implementation of some atomic functions in

[libclc] [libclc] Declare workitem built-ins in clc, move ptx-nvidiacl workitem built-ins into clc (PR #144333)

2025-07-03 Thread Wenju He via cfe-commits
wenju-he wrote: > > Perhaps we need a stripped down OpenCL header, like > > `clc/opencl/opencl-base.h` which includes just the types and macro defs? > > See #146840 for an example of this approach. thanks @frasercrmck I'll update OpenCL headers of this PR after #146840 is landed. https://git

[libclc] [libclc] Reduce include usage in OpenCL builtins (PR #146840)

2025-07-03 Thread Wenju He via cfe-commits
@@ -6,5 +6,12 @@ // //===--===// +#ifndef __CLC_OPENCL_OPENCL_INTEGER_ABS_H__ wenju-he wrote: ```suggestion #ifndef __CLC_OPENCL_INTEGER_ABS_H__ ``` one OPENCL should be sufficient, right?

[libclc] [libclc] Make library output directories explicit (PR #146833)

2025-07-03 Thread Wenju He via cfe-commits
https://github.com/wenju-he approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/146833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Make library output directories explicit (PR #146833)

2025-07-03 Thread Wenju He via cfe-commits
@@ -120,14 +120,15 @@ function(link_bc) endif() add_custom_command( -OUTPUT ${ARG_TARGET}.bc -COMMAND ${llvm-link_exe} ${link_flags} -o ${ARG_TARGET}.bc ${LINK_INPUT_ARG} +OUTPUT ${LIBCLC_ARCH_OBJFILE_DIR}/${ARG_TARGET}.bc +COMMAND ${llvm-link_exe} ${link_

[clang] [clang][SPIRV] Remove volatile variants of GenericCastToPtr* built-ins (PR #146298)

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

  1   2   3   >