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

2025-04-10 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck commented: Thanks. It seems like a guard mistake in a header has crept into the new headers. Other than that, LGTM. https://github.com/llvm/llvm-project/pull/134489 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2025-04-10 Thread Fraser Cormack 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 Fraser Cormack 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 Fraser Cormack 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 Fraser Cormack via cfe-commits
@@ -239,54 +239,22 @@ #include #include -/* cl_khr_global_int32_base_atomics Extension Functions */ -#include -#include -#include -#include -#include -#include - -/* cl_khr_global_int32_extended_atomics Extension Functions */ -#include -#include -#include -#include

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

2025-04-10 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck 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] Introduce elementwise clz/ctz builtins (PR #131995)

2025-04-10 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Friendly ping https://github.com/llvm/llvm-project/pull/131995 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move shuffle/shuffle2 to the CLC library (PR #135000)

2025-04-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/135000 This commit moves the shuffle and shuffle2 builtins to the CLC library. In so doing it makes the headers simpler and re-usable for other builtin layers to hook into the CLC functions, if they wish. An addi

[libclc] libclc: frexp: fix implementation regarding denormals (PR #134823)

2025-04-10 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/134823 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move several 'native' builtins to CLC library (PR #129679)

2025-03-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/129679 >From aabdf579b3d88e59f8604943573c9beeafb4cf66 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 4 Mar 2025 10:03:00 + Subject: [PATCH 1/3] [libclc] Move several 'native' builtins to CLC library

[libclc] c1efd8b - [libclc][NFC] Delete two unused headers

2025-04-01 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-01T14:54:50+01:00 New Revision: c1efd8b663b7db3c717fae8a1991dcc4b8304c8f URL: https://github.com/llvm/llvm-project/commit/c1efd8b663b7db3c717fae8a1991dcc4b8304c8f DIFF: https://github.com/llvm/llvm-project/commit/c1efd8b663b7db3c717fae8a1991dcc4b8304c8f.diff

[libclc] 00e6d4f - [libclc][NFC] Delete three unused .inc files

2025-04-01 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-01T17:36:01+01:00 New Revision: 00e6d4fe064bb48e16c1eda018e6ed5e9f99cba9 URL: https://github.com/llvm/llvm-project/commit/00e6d4fe064bb48e16c1eda018e6ed5e9f99cba9 DIFF: https://github.com/llvm/llvm-project/commit/00e6d4fe064bb48e16c1eda018e6ed5e9f99cba9.diff

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-03-17 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping, thanks https://github.com/llvm/llvm-project/pull/128506 ___ 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-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck 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-09 Thread Fraser Cormack via cfe-commits
@@ -6,6 +6,17 @@ // //===--===// +// cl_khr_global_int32_base_atomics frasercrmck wrote: Sorry to go back to this but I think really these should all be `#if` guarded with the appropriate e

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

2025-04-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck commented: LGTM other than the last nit. I can confirm there are no codegen changes to any target that I can observe. Thanks again. https://github.com/llvm/llvm-project/pull/134489 ___ cfe-commits mailing list cfe-commit

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

2025-04-09 Thread Fraser Cormack via cfe-commits
@@ -6,7 +6,28 @@ // //===--===// -#include +#include +#include + +// cl_khr_global_int32_base_atomics +#define IMPL(TYPE) \ frasercrmck wrote: Oh nice one, yeah. That explains why it isn'

[libclc] 949bf51 - [libclc][NFC] Fix up inconsistent copyright headers

2025-04-09 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-09T12:00:08+01:00 New Revision: 949bf518fcc04285f40aa96a1c123bf0141fafd4 URL: https://github.com/llvm/llvm-project/commit/949bf518fcc04285f40aa96a1c123bf0141fafd4 DIFF: https://github.com/llvm/llvm-project/commit/949bf518fcc04285f40aa96a1c123bf0141fafd4.diff

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

2025-04-16 Thread Fraser Cormack 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 Fraser Cormack 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 Fraser Cormack 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 Fraser Cormack 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck 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-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck commented: Yes I think on reflection it's probably okay to compile for the highest supported OpenCL C version. I believe they're supersets of one another, so a 3.0 builtins library would still contain all of the 1.2 builtins? I might be missing some of the nitty

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

2025-04-16 Thread Fraser Cormack 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 version to 3.0 (PR #135733)

2025-04-15 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I don't think we want to unconditionally do this - we probably want a mechanism whereby targets can opt for a specific version. We should definitely add this capability, though. Targets may even want to compile libclc for multiple different versions? That might introduce ex

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

2025-04-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] [libclc] Set OpenCL C version for each target (PR #135733)

2025-04-21 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > LGTM. That means we compile for the last OpenCL version, which is 3.0, and > enable all OpenCL extensions/features, right? libclc is implemented using > functions supported by clang, so it is unlikely a target has libclc build > error in generic libclc files that are share

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

2025-04-21 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I don't mind this. Given the current naming scheme, files are named after specific builtins so you're unlikely to want to include two `cos.cl`, for instance. I don't think the directory name is or should be significant in deciding what to override. I suppose you could curre

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

2025-04-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] [libclc] Build for OpenCL 3.0 and enable all extensions and features (PR #135733)

2025-04-22 Thread Fraser Cormack 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

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Fraser Cormack via cfe-commits
@@ -155,3 +155,11 @@ #endif #pragma OPENCL EXTENSION cl_amd_media_ops2: enable +#if (__OPENCL_C_VERSION__ >= 300) frasercrmck wrote: My reading of the specification is that OpenCL 2.0 has the "generic address space" capability available by default, but not t

[libclc] [libclc][NFC] Remove unary_builtin.inc (PR #137656)

2025-04-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137656 We had two ways of achieving the same thing. This commit removes unary_builtin.inc in favour of the approach combining gentype.inc with unary_def.inc. There is no change to the codegen for any target. >Fr

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Fraser Cormack via cfe-commits
@@ -146,3 +146,8 @@ #pragma OPENCL EXTENSION cl_khr_subgroups: enable // expected-warning@-1{{unsupported OpenCL extension 'cl_khr_subgroups' - ignoring}} +#ifdef __opencl_c_generic_address_space +#error "Incorrect __opencl_c_generic_address_space define" fra

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

2025-04-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @wenju-he https://github.com/llvm/llvm-project/pull/137183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137183 This commit provides definitions of builtins with the generic address space. It is assumed that all current libclc targets can support the generic address space. One concept to consider is the difference b

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137181 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Remove (vload|vstore)_half helpers (PR #137181)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137181 These were only being used when compiling with versions of clang older than clang 6. As such they were essentially unsuppored and untested. This somewhat simplifies the codebase, producing fewer helper func

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

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] Fix unguarded use of image types (PR #136871)

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/136871 Commit 8292e05 which switched the OpenCL C version to 3.0 exposed this issue, which wasn't caught in pre-commit CI. >From 7c9285f52dde14c1d795c2100c10848876c899d9 Mon Sep 17 00:00:00 2001 From: Fraser Corma

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

2025-04-23 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: See #136871 for a fix for the CI issues. 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] Re-enable compiler warning (PR #136872)

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/136872 libclc is now clean of code that triggers the bitwise-conditional-parentheses warning, so we can finally remove the workaround. >From 1811e6ee0fb4c3af60a245418816b1e5a63163b2 Mon Sep 17 00:00:00 2001 From:

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

2025-04-23 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @wenju-he 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] Fix unguarded use of image types (PR #136871)

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] Re-enable compiler warning (PR #136872)

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/136872 ___ 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] Move fmin & fmax to CLC library (PR #134218)

2025-04-23 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping https://github.com/llvm/llvm-project/pull/134218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137959 >From ef6433ffa32a8f4ced865382bfd45de61f5aef53 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 13:48:16 +0100 Subject: [PATCH 1/2] [libclc] Clean up unnecessary #undef __CLC_BODYs This

[libclc] [libclc] Move minmag & maxmag to the CLC library (PR #137982)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137982 None >From d2eea7bc2f2332d4c8b7d28f3512ab67a03f6360 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 16:59:06 +0100 Subject: [PATCH] [libclc] Move minmag & maxmag to the CLC library ---

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

2025-04-30 Thread Fraser Cormack 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 frasercrmck wrote: We probably don't need to `undef` and re-`define` here, when `local/global` isn'

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

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Thanks. We could probably come up with some kind of combined `gentype.inc` that does them both at once (though both currently `undef` `__CLC_BODY` after they finish so we'd need to be able to stop that, or preserve `__CLC_BODY` across

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

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM. I see there's a note in the spec: `async_work_group_copy and async_work_group_strided_copy for 3-component vector types behave as async_work_group_copy and async_work_group_strided_copy respectively for 4-component vector types.

[clang] [NVPTX] Support the OpenCL generic addrspace feature by default (PR #137940)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137940 As best as I can see, all NVPTX architectures support the generic address space. I note there's a FIXME in the target's address space map about 'generic' still having to be added to the target but we haven'

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137959 This macro is automatically undefined by the various gentype-like helpers. >From ef6433ffa32a8f4ced865382bfd45de61f5aef53 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 30 Apr 2025 13:48:16 +0100

[libclc] [libclc] Clean up unnecessary #undef __CLC_BODYs (PR #137959)

2025-04-30 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: CC @wenju-he https://github.com/llvm/llvm-project/pull/137959 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-04-30 Thread Fraser Cormack via cfe-commits
@@ -23,4 +23,20 @@ #define _CLC_DEF __attribute__((always_inline)) #endif +#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 || \ +(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ + defined(__opencl_c_generic_addr

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

2025-04-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] 1180740 - [libclc][NFC] Remove unused integer-gentype.inc

2025-04-30 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-30T13:39:23+01:00 New Revision: 1180740ced0218865577a09c9245f035e443a6f0 URL: https://github.com/llvm/llvm-project/commit/1180740ced0218865577a09c9245f035e443a6f0 DIFF: https://github.com/llvm/llvm-project/commit/1180740ced0218865577a09c9245f035e443a6f0.diff

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

2025-04-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] 4cb1803 - [libclc][NFC] Fix typo in comment

2025-04-14 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-14T14:38:58+01:00 New Revision: 4cb1803ff9d052f1b75d90d5be87345e54aebf92 URL: https://github.com/llvm/llvm-project/commit/4cb1803ff9d052f1b75d90d5be87345e54aebf92 DIFF: https://github.com/llvm/llvm-project/commit/4cb1803ff9d052f1b75d90d5be87345e54aebf92.diff

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

2025-04-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] only check filename part of the source for avoiding duplication (PR #135710)

2025-04-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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] [NFC][libclc] Refine clz to use __builtin_clzg (PR #135301)

2025-04-14 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Note I'm in the process of introducing elementwise clz/ctz builtins which would accomplish this and achieve vector intrinsics. See https://github.com/llvm/llvm-project/pull/131995. It might be worth waiting for that change instead? https://github.com/llvm/llvm-project/pull/

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

2025-04-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM, 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] [libclc] add ctz built-in implementation to clc and generic (PR #135309)

2025-04-14 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,15 @@ +//===--===// +// +// 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 minmag & maxmag to the CLC library (PR #137982)

2025-05-01 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137982 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move minmag & maxmag to the CLC library (PR #137982)

2025-05-01 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,18 @@ +//===--===// +// +// 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] c5b750f - [libclc] Move log2/log10 tables to CLC tables impl

2025-05-01 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-05-01T10:23:28+01:00 New Revision: c5b750f5af72fadd4c00c120c9c585240da466b4 URL: https://github.com/llvm/llvm-project/commit/c5b750f5af72fadd4c00c120c9c585240da466b4 DIFF: https://github.com/llvm/llvm-project/commit/c5b750f5af72fadd4c00c120c9c585240da466b4.diff

[libclc] [libclc] Remove unnecessary clcmacros.h (PR #137149)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137149 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Remove unnecessary clcmacros.h (PR #137149)

2025-04-24 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137149 The macros defined by this file (not to be confused with clcmacro.h) don't appear necessary for building libclc. The language version macros should be handled by clang, and there are no uses of NULL or ker

[libclc] 2edade2 - [libclc][NFC] Clang-format vload/vstore code

2025-04-24 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-04-24T11:42:18+01:00 New Revision: 2edade28245b1fc2b7cb0b39804894f8fdcfb7ff URL: https://github.com/llvm/llvm-project/commit/2edade28245b1fc2b7cb0b39804894f8fdcfb7ff DIFF: https://github.com/llvm/llvm-project/commit/2edade28245b1fc2b7cb0b39804894f8fdcfb7ff.diff

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

2025-04-23 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > I would like to further investigate weak linkage as another means of > > overriding specific builtins down to a finer granularity. That approach > > might warrant another method of file discovery. > > It would bring unnecessary builds and may increase build time. Filenam

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

2025-04-23 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] [libclc] Support the generic address space (PR #137183)

2025-04-24 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > There is a clang bug if there is different mangling. The itanium mangling > should be coming from the source type / original address space, not whatever > IR address space value that happens to map to Yeah, that would be nice but this is what's happening, I'm afraid. It i

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

2025-04-10 Thread Fraser Cormack 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] Reduce bithacking in CLC frexp (PR #129871)

2025-04-10 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > I still have a few things to investigate to make sure of what is happening, > but in the meantime would you guys approve to land this patch to make the > implementation more stable whether the device supports denorm or not? > > ``` > - __CLC_INTN is_inf_nan_or_zero = > -

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

2025-04-15 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,15 @@ +//===--===// +// +// 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

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-04-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/131995 >From d8bae11f1e156b83de9a41ceb479d348d7d168b1 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 3 Feb 2025 16:54:17 + Subject: [PATCH 1/4] [clang] Introduce elementwise clz/ctz builtins These bu

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-04-15 Thread Fraser Cormack via cfe-commits
@@ -831,6 +832,14 @@ of different sizes and signs is forbidden in binary and ternary builtins. semantics, see `LangRef

[clang] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-04-15 Thread Fraser Cormack via cfe-commits
@@ -831,6 +832,14 @@ of different sizes and signs is forbidden in binary and ternary builtins. semantics, see `LangRef

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

2025-04-15 Thread Fraser Cormack 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] add ctz built-in implementation to clc and generic (PR #135309)

2025-04-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM. I note that this uses `__OPENCL_C_VERSION__` which *technically* isn't available for OpenCL 1.0 or 1.1. However, clang defines this macro even for those versions, so we have a consistent version checking mechanism. See [here](ht

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137636 This feature should be supported on AMDGCN architectures with flat addressing. >From bfaf6b32f88c0439b5f70a5fa78fc0927307ecce Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 28 Apr 2025 15:06:58 +0

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137636 >From bfaf6b32f88c0439b5f70a5fa78fc0927307ecce Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 28 Apr 2025 15:06:58 +0100 Subject: [PATCH 1/2] [AMDGPU] Support the OpenCL generic addrspace feature b

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

2025-04-28 Thread Fraser Cormack via cfe-commits
@@ -23,4 +23,20 @@ #define _CLC_DEF __attribute__((always_inline)) #endif +#if __OPENCL_C_VERSION__ == CL_VERSION_2_0 || \ +(__OPENCL_C_VERSION__ >= CL_VERSION_3_0 && \ + defined(__opencl_c_generic_addr

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

2025-04-28 Thread Fraser Cormack 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] Support the generic address space (PR #137183)

2025-04-28 Thread Fraser Cormack via cfe-commits
@@ -12,3 +12,7 @@ _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x, local __CLC_INTN *iptr); _CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x,

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

2025-04-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137183 >From 3519e1c571375802d77937e765d551607ed5bdde Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 24 Apr 2025 11:24:30 +0100 Subject: [PATCH 1/2] [libclc] Support the generic address space This commit

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/134218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move fmin & fmax to CLC library (PR #134218)

2025-04-29 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: I'll merge this as it's just a code move and there's no change to codegen. https://github.com/llvm/llvm-project/pull/134218 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-c

[libclc] [libclc] Move fract to the CLC library (PR #137785)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137785 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] Support the OpenCL generic addrspace feature by default (PR #137636)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137636 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc][NFC] Remove unary_builtin.inc (PR #137656)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed https://github.com/llvm/llvm-project/pull/137656 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Move fract to the CLC library (PR #137785)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/137785 >From f9a265e0d9bcecb80d25b97c394d7b9aa68d27ea Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr 2025 11:43:00 +0100 Subject: [PATCH 1/2] [libclc] Move fract to the CLC library The builtin was

[libclc] [libclc] Move fract to the CLC library (PR #137785)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137785 The builtin was already vectorized so there's no difference to codegen for non-SPIR-V targets. >From f9a265e0d9bcecb80d25b97c394d7b9aa68d27ea Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 29 Apr

[libclc] [libclc] Move fdim to CLC library; simplify (PR #137811)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/137811 This commit moves the fdim builtin to the CLC library. It simultaneously simplifies the codegen, unifying it between scalar and vector and avoiding bithacking for vector types. >From a20d00150430c7e5c24b69

[libclc] [libclc] Move fmin/fmax to the CLC library (PR #128506)

2025-04-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/128506 >From 5c367b8c87bf07f851778f391e5130a0fd0b193b Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 24 Feb 2025 12:25:22 + Subject: [PATCH] [libclc] Optimize generic CLC fmin/fmax The CLC fmin/fmax

<    1   2   3   4   5   6   7   8   >