[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

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

2025-07-03 Thread Wenju He via cfe-commits
@@ -93,16 +73,6 @@ __SPIRV_BUILTIN_ALIAS(__builtin_spirv_generic_cast_to_ptr_explicit) __private const void * __spirv_GenericCastToPtrExplicit_ToPrivate(__generic const void *, int) __SPIRV_NOEXCEPT; -extern __SPIRV_overloadable -__SP

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

2025-07-02 Thread Wenju He via cfe-commits
wenju-he wrote: > I am seeing unresolved CLC functions in `nvptx--.bc` and `nvptx64--.bc`. I > think it's because we're now building things like `get_num_groups` for > `nvptx`/`nvptx64`, whereas previously they were not being built for those > targets. We're also not building `__clc_get_num_gr

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

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

[libclc] [libclc] Add missing clc_lgamma_r with generic address space pointer arg (PR #146495)

2025-07-01 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/146495 None >From a13dff8a3dbff76836ca31e71fe4265dc078a2be Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 1 Jul 2025 10:58:21 +0200 Subject: [PATCH] [libclc] Add missing clc_lgamma_r with generic address space p

[libclc] [libclc] Add missing clc_lgamma_r with generic address space pointer arg (PR #146495)

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

[libclc] [libclc] Add __clc_nan implementation with signed nancode argument (PR #146485)

2025-07-01 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/146485 In OpenCL Extended Instruction Set Specificatio, nancode can be signed integer or vector of signed integers values. This PR has no change to amdgcn--amdhsa.bc and nvptx64--nvidiacl.bc because the newly added c

[libclc] [NFC][libclc] Refactor _CLC_*_VECTORIZE macros to functions in .inc files (PR #145678)

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

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

2025-06-30 Thread Wenju He via cfe-commits
@@ -115,16 +85,6 @@ __spirv_GenericCastToPtr_ToGlobal(__generic const void *p, int) __SPIRV_NOEXCEPT { return (__global const void *)p; } -static __SPIRV_overloadable __SPIRV_inline __global volatile void * wenju-he wrote: s

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

2025-06-30 Thread Wenju He via cfe-commits
@@ -93,16 +73,6 @@ __SPIRV_BUILTIN_ALIAS(__builtin_spirv_generic_cast_to_ptr_explicit) __private const void * __spirv_GenericCastToPtrExplicit_ToPrivate(__generic const void *, int) __SPIRV_NOEXCEPT; -extern __SPIRV_overloadable -__SP

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

2025-06-29 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/146298 They are generally implemented with pointer comparison. Volatile is not needed because memory pointed to by the pointer isn't accessed. >From f77e5b48204609cb9b0c1c4dd6684de013be5008 Mon Sep 17 00:00:00 2001 F

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

2025-06-29 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

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

2025-06-29 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

[libclc] [NFC][libclc] Refactor _CLC_*_VECTORIZE macros to functions in .inc files (PR #145678)

2025-06-25 Thread Wenju He via cfe-commits
@@ -0,0 +1,121 @@ +//===--===// +// +// 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: Apa

[libclc] [NFC][libclc] Refactor _CLC_*_VECTORIZE macros to functions in .inc files (PR #145678)

2025-06-25 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/145678 With this PR, if we have customized implementation for scalar or vector length = 2, we don't need to write new macros, e.g. https://github.com/intel/llvm/blob/fb18321705f6/libclc/clc/include/clc/clcmacro.h#L15

[libclc] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

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

[libclc] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

2025-06-24 Thread Wenju He via cfe-commits
@@ -0,0 +1,17 @@ +//===--===// +// +// 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] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

2025-06-24 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/145458 >From 0cbf5c96077bce977168497670e3ffae9e70e5d5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 24 Jun 2025 06:59:27 +0200 Subject: [PATCH 1/2] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNA

[libclc] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

2025-06-24 Thread Wenju He via cfe-commits
@@ -0,0 +1,17 @@ +//===--===// +// +// 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] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

2025-06-24 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/145458 >From 0cbf5c96077bce977168497670e3ffae9e70e5d5 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 24 Jun 2025 06:59:27 +0200 Subject: [PATCH 1/3] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNA

[libclc] [NFC][libclc] Replace and delete _CLC_DEFINE_UNARY/BINARY/TERNARY_BUILTIN macros (PR #145458)

2025-06-23 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/145458 Also delete unused _CLC_DEFINE_BINARY_BUILTIN_WITH_SCALAR_SECOND_ARG, _CLC_DEFINE_UNARY_BUILTIN_FP16 and _CLC_DEFINE_BINARY_BUILTIN_FP16. llvm-diff shows no change to nvptx64--nvidiacl.bc and amdgcn--amdhsa.bc

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-22 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/144686 >From b5c9a4834accbac18664f1431acc5204c0527fa8 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 18 Jun 2025 14:21:09 +0200 Subject: [PATCH 1/7] [InstCombine] Don't folder select to or if value argument is us

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-22 Thread Wenju He via cfe-commits
@@ -0,0 +1,25 @@ +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 5 +; RUN: opt -S -mtriple=amdgcn-amd-amdhsa -passes=instcombine %s | FileCheck %s + +; Check that `select B, true, C` isn't optimized to `or B, C`, +; because the inval

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/144686 >From b5c9a4834accbac18664f1431acc5204c0527fa8 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 18 Jun 2025 14:21:09 +0200 Subject: [PATCH 1/6] [InstCombine] Don't folder select to or if value argument is us

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Wenju He via cfe-commits
wenju-he wrote: > For the purposes of this PR, I think you should only change > canCreateUndefOrPoison to return true and just eat the regressions. done. Please let me know if we should add FIXME for the regression in clang/test/CodeGenOpenCL/amdgcn-buffer-rsrc-type.cl and llvm/test/Transfor

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/144686 >From b5c9a4834accbac18664f1431acc5204c0527fa8 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 18 Jun 2025 14:21:09 +0200 Subject: [PATCH 1/5] [InstCombine] Don't folder select to or if value argument is us

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Wenju He via cfe-commits
wenju-he wrote: > For the purposes of this PR, I think you should only change > canCreateUndefOrPoison to return true and just eat the regressions. We can > follow up with using isValidAddrSpaceCast() in a followup, because it will be > less straightforward. I'm not willing to accept direct us

[clang] [llvm] [ValueTracking] Return true for AddrSpaceCast in canCreateUndefOrPoison (PR #144686)

2025-06-20 Thread Wenju He via cfe-commits
https://github.com/wenju-he updated https://github.com/llvm/llvm-project/pull/144686 >From b5c9a4834accbac18664f1431acc5204c0527fa8 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Wed, 18 Jun 2025 14:21:09 +0200 Subject: [PATCH 1/4] [InstCombine] Don't folder select to or if value argument is us

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

2025-06-19 Thread Wenju He via cfe-commits
wenju-he wrote: > Is an issue here perhaps that downstream users may have implemented (e.g.) > `get_global_offset` in their toolchains, but after this change they'll > suddenly see a definition of this function that they're not expecting? > > I suppose they would have to implement CLC function

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

2025-06-16 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/144333 Changes in this PR: * Declare all workitem functions in clc and opencl folders. * Call clc workitem function in corresponding OpenCL workitem function. * Move ptx-nvidiacl workitem built-in implementations into

[clang] [NVPTX] Enable OpenCL 3d_image_writes support (PR #143331)

2025-06-08 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/143331 NV supports opencl_3d_image_writes according https://developer.nvidia.com/blog/nvidia-is-now-opencl-3-0-conformant/ This PR allows removing explicit enabling of image extensions via -cl-ext command line option

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

2025-06-06 Thread Wenju He via cfe-commits
wenju-he wrote: thank you @nathanchance for the review. https://github.com/llvm/llvm-project/pull/142509 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

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

[libclc] [NFC][libclc] Simplify clc_dot and dot implementation (PR #142922)

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

[libclc] [NFC][libclc] Simplify clc_dot and dot implementation (PR #142922)

2025-06-05 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/142922 llvm-diff shows no change to amdgcn--amdhsa.bc >From 42c4efab1a163624d7a3b327742d7e38bb7197b3 Mon Sep 17 00:00:00 2001 From: Wenju He Date: Thu, 5 Jun 2025 01:14:38 -0700 Subject: [PATCH] [NFC][libclc] Simplif

[libclc] [libclc] Move prefetch to clc library (PR #141721)

2025-05-27 Thread Wenju He via cfe-commits
https://github.com/wenju-he created https://github.com/llvm/llvm-project/pull/141721 llvm-diff shows no change to amdgcn--amdhsa.bc >From 72d456f335d78b8ae7e1d25a0229e9f9f89a466b Mon Sep 17 00:00:00 2001 From: Wenju He Date: Tue, 27 May 2025 23:50:32 -0700 Subject: [PATCH] [libclc] Move prefet

[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

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

  1   2   >