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

2025-08-08 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Sorry for breaking this. LGTM if you've tested it and it works :+1: https://github.com/llvm/llvm-project/pull/152703 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-08-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/141574 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-08-07 Thread Fraser Cormack via cfe-commits
@@ -204,6 +204,13 @@ if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES) endif () endif () +if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS) + message(WARNING "Using LLVM_ENABLE_PROJECTS=libclc is deprecated now, and will " +"become a fatal error in the LLVM 21 release. Please use

[libclc] [llvm] [libclc] Support LLVM_ENABLE_RUNTIMES when building (PR #141574)

2025-08-07 Thread Fraser Cormack via cfe-commits
@@ -204,6 +204,13 @@ if ("flang-rt" IN_LIST LLVM_ENABLE_RUNTIMES) endif () endif () +if ("libclc" IN_LIST LLVM_ENABLE_PROJECTS) + message(WARNING "Using LLVM_ENABLE_PROJECTS=libclc is deprecated now, and will " +"become a fatal error in the LLVM 21 release. Please use

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

2025-08-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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

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

2025-08-07 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > Is there is way to test it based on llvm code base? Not that I'm aware of. We can probably go by the documented ULP both for [CUDA](https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#standard-functions) and [OpenCL](https://registry.khronos.org/OpenCL/specs

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

2025-08-06 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM https://github.com/llvm/llvm-project/pull/152245 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Introduce elementwise ctlz/cttz builtins (PR #131995)

2025-08-05 Thread Fraser Cormack via cfe-commits
@@ -860,3 +860,41 @@ static_assert(__builtin_elementwise_sub_sat(0U, 1U) == 0U); static_assert(__builtin_bit_cast(unsigned, __builtin_elementwise_sub_sat((vector4char){5, 4, 3, 2}, (vector4char){1, 1, 1, 1})) == (LITTLE_END ? 0x01020304 : 0x04030201)); static_assert(__builtin_

[clang] [clang] Introduce elementwise ctlz/cttz builtins (PR #131995)

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

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

2025-08-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From a511265499382c939829040686bcad7cf68023cf Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/8] [libclc] Place libclc files in clang's resource dir --

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

2025-08-04 Thread Fraser Cormack via cfe-commits
@@ -795,6 +795,8 @@ void AMDGPUToolChain::addClangTargetOptions( CC1Args.push_back("-fvisibility=hidden"); CC1Args.push_back("-fapply-global-visibility-to-externs"); } + + addOpenCLBuiltinsLib(getDriver(), DriverArgs, CC1Args); frasercrmck wrote: Su

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

2025-08-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. https://github.com/llvm/llvm-project/pull/151644 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[libclc] [libclc] Add an option to build SPIR-V targets with the LLVM backend (PR #151347)

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

[libclc] [libclc] Add an option to build SPIR-V targets with the LLVM backend (PR #151347)

2025-07-31 Thread Fraser Cormack via cfe-commits
@@ -363,10 +369,17 @@ function(add_libclc_builtin_set) if( ARG_ARCH STREQUAL spirv OR ARG_ARCH STREQUAL spirv64 ) set( obj_suffix ${ARG_ARCH_SUFFIX}.spv ) set( libclc_builtins_lib ${LIBCLC_OUTPUT_LIBRARY_DIR}/${obj_suffix} ) -add_custom_command( OUTPUT ${libclc_bu

[clang] [clang] Introduce elementwise ctlz/cttz builtins (PR #131995)

2025-07-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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

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

2025-07-31 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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

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

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

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

2025-07-31 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > Oh excuse me, there's currently no target-specific behaviour. I missed the > > HasFallback in > > HasFallback only applies to the two-argument form. Oh yes, thank you. I've fixed that now. The behaviour is unconditionally zero-is-undef. > > I don't have a strong opinio

[libclc] [libclc] Add an option to build SPIR-V targets with the LLVM backend (PR #151347)

2025-07-30 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/151347 This removes the dependency on an external tool to build the SPIR-V files. It may be of interest to projects such as Mesa. Note that the option is off by default as using the SPIR-V backend, at least on my

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

2025-07-30 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > > Also does this have the same > > maybe-defined-maybe-not-depending-on-target-preference as __builtin_clz? > > Can you document that explicitly if it is or not? > > I've always hated that behavior and think it's absurd. My main hesitation > > is if we're doing something l

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

2025-07-30 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > Also does this have the same > maybe-defined-maybe-not-depending-on-target-preference as __builtin_clz? Can > you document that explicitly if it is or not? > > I've always hated that behavior and think it's absurd. My main hesitation is > if we're doing something less con

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

2025-07-30 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping 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

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

2025-07-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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] [libclc] Optimize generic CLC fmin/fmax (PR #128506)

2025-07-29 Thread Fraser Cormack via cfe-commits
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { return (y < x) ? y : x; frasercrmck wrote: Makes sense, yeah. If you could take a look at what I've done to that end, that'd be great - thanks. https://github.com/llvm/llvm-project/p

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

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

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

2025-07-29 Thread Fraser Cormack via cfe-commits
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { return (y < x) ? y : x; frasercrmck wrote: It doesn't generate the same IR, because SPIR-V isn't optimized. I wonder if we in fact want to have `half` use `__builtin_fminf16`? We can

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

2025-07-29 Thread Fraser Cormack via cfe-commits
@@ -43,8 +48,10 @@ _CLC_DEF _CLC_OVERLOAD half __clc_fmin(half x, half y) { return (y < x) ? y : x; frasercrmck wrote: Good idea. I'll see if it generates the same IR, which I suspect it will. https://github.com/llvm/llvm-project/pull/128506 _

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

2025-07-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] Fix building top-level 'libclc' target (PR #150972)

2025-07-29 Thread Fraser Cormack 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 ) frasercrmck wrote: Good idea - done. https://github.co

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

2025-07-29 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/150972 >From d08c5dea1b8ee797c27869e436b24b85a2d285bc Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 28 Jul 2025 15:57:11 +0100 Subject: [PATCH 1/2] [libclc] Fix building top-level 'libclc' target With l

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

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

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

2025-07-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/150972 With libclc being a 'runtime', the top-level build assumes that there is a corresopnding 'libclc' target. We previously weren't providing this, leading to a build failure if the user tried to build it. Thi

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

2025-07-28 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: Do we know that these pass the OpenCL CTS? 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

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

2025-07-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] Simplify unary_def_scalarize.inc's use in __clc_erf/erfc/tgamma (PR #150181)

2025-07-28 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. https://github.com/llvm/llvm-project/pull/150181 ___ 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-21 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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-21 Thread Fraser Cormack 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM 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] [NFC][libclc] Delete clc/include/clc/relational/floatn.inc (PR #149252)

2025-07-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. https://github.com/llvm/llvm-project/pull/149252 ___ 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-17 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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

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

2025-07-16 Thread Fraser Cormack via cfe-commits
@@ -847,6 +848,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-07-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/131995 >From 93112f0d5f0a8f6c8b1803a61d549701ba476f20 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 3 Feb 2025 16:54:17 + Subject: [PATCH 1/6] [clang] Introduce elementwise clz/ctz builtins These bu

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

2025-07-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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

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

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

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

2025-07-16 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,10 @@ +//===--===// frasercrmck wrote: It's minor but I'd perhaps suggest naming this file `clc_bitfield_extract_decl.inc` as it's a helper file for differently named declarations, a

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

2025-07-16 Thread Fraser Cormack 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] Add generic implementation of bitfield_insert/extract,bit_reverse (PR #149070)

2025-07-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck commented: Looks good. Just a couple of suggestions. https://github.com/llvm/llvm-project/pull/149070 ___ 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited https://github.com/llvm/llvm-project/pull/149070 ___ 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] [clang] Introduce elementwise clz/ctz builtins (PR #131995)

2025-07-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/131995 >From 93112f0d5f0a8f6c8b1803a61d549701ba476f20 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

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

2025-07-16 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. LGTM, nice find. I think this could optionally do with a comment before explaining what this flag is helping to achieve, but it's not a blocker. https://github.com/llvm/llvm-project/pull/149016 _

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

2025-07-16 Thread Fraser Cormack via cfe-commits
@@ -847,6 +848,14 @@ of different sizes and signs is forbidden in binary and ternary builtins. semantics, see `LangRef

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

2025-07-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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 Fraser Cormack 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 Fraser Cormack 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 frasercrmck wrote: Good idea, thanks. Done https://github.com/l

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

2025-07-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/148815 >From a426ba39c895ac8eed7ee0bc69310d7ccb681560 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 15 Jul 2025 10:44:48 +0100 Subject: [PATCH 1/2] [libclc] Move CMake for prepare_builtins to a subdirec

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

2025-07-15 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/148815 This simply makes things better self-contained. >From a426ba39c895ac8eed7ee0bc69310d7ccb681560 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Tue, 15 Jul 2025 10:44:48 +0100 Subject: [PATCH] [libclc] M

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

2025-07-15 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: ping, thanks. 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

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

2025-07-14 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck commented: Can we do anything about the warnings I'm seeing while building this? They're noisy. ``` In file included from /llvm-project/libclc/clc/lib/generic/atomic/clc_atomic_fetch_min.cl:18: In file included from /llvm-project/libclc/clc/include/clc/math/gent

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

2025-07-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] Change symlinks to copies on Windows (PR #147759)

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

[libclc] [libclc] Change symlinks to copies on Windows (PR #147759)

2025-07-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/147759 This mirrors how other LLVM libraries handle symlinks >From 584407d144611dbee80f84b4dd3128420aebe7fb Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Wed, 9 Jul 2025 15:03:57 +0100 Subject: [PATCH] [libc

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

2025-07-09 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] Remove catch-all opencl/clc.h (PR #147490)

2025-07-08 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] Remove catch-all opencl/clc.h (PR #147490)

2025-07-08 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck edited 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] Remove catch-all opencl/clc.h (PR #147490)

2025-07-08 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck created https://github.com/llvm/llvm-project/pull/147490 This commit finishes the work started in #146840 and #147276. It makes each OpenCL header self-contained and each implementation file include only the header it needs. It removes the need for a catch-all in

[libclc] [libclc] Tighten OpenCL builtin include strategy (PR #147276)

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

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,32 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 +//===--===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Excep

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -215,6 +215,9 @@ void addOpenMPDeviceRTL(const Driver &D, const llvm::opt::ArgList &DriverArgs, StringRef BitcodeSuffix, const llvm::Triple &Triple, const ToolChain &HostTC); +void addOpenCLBuiltinsLib(const Driver &D, const

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/87989 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 01/11] [libclc] Place libclc files in clang's resource dir -

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

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

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -0,0 +1,57 @@ +import os + +import lit.formats +import lit.util + +from lit.llvm import llvm_config +from lit.llvm.subst import ToolSubst +from lit.llvm.subst import FindTool + +# Configuration file for the 'lit' test runner. + +# name: The name of this test suite. +config.name

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -1,3 +1,6 @@ -__kernel void foo(int *i) { +// RUN: %clang -emit-llvm -S -o - %s | FileCheck %s frasercrmck wrote: With #146503, clang does at least know about libclc. I've updated this PR to include that one, just to explore how this might work in CI. I've u

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/87989 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 01/10] [libclc] Place libclc files in clang's resource dir -

[clang] [libclc] [llvm] [libclc] Add initial LIT tests (PR #87989)

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/87989 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/9] [libclc] Place libclc files in clang's resource dir ---

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

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/7] [libclc] Place libclc files in clang's resource dir --

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

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck 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-07-07 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: > Agreed that this should be a resource directory thing, we made the mistake of > not doing that in OpenMP until I moved it to just a normal lib. I've got rid of the checking on LIBRARY_PATH now, thanks for your and @arsenm's input. https://github.com/llvm/llvm-project/pull

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

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -2942,6 +2942,65 @@ void tools::addHIPRuntimeLibArgs(const ToolChain &TC, Compilation &C, } } +void tools::addOpenCLBuiltinsLib(const Driver &D, + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgString

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

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/6] [libclc] Place libclc files in clang's resource dir --

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

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From b41b2032fdb01bd91d32255bf22a94315b58a017 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/5] [libclc] Place libclc files in clang's resource dir --

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

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -2942,6 +2942,65 @@ void tools::addHIPRuntimeLibArgs(const ToolChain &TC, Compilation &C, } } +void tools::addOpenCLBuiltinsLib(const Driver &D, + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgString

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

2025-07-07 Thread Fraser Cormack via cfe-commits
@@ -2942,6 +2942,65 @@ void tools::addHIPRuntimeLibArgs(const ToolChain &TC, Compilation &C, } } +void tools::addOpenCLBuiltinsLib(const Driver &D, + const llvm::opt::ArgList &DriverArgs, + llvm::opt::ArgString

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

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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] Reduce include usage in OpenCL builtins (PR #146840)

2025-07-07 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146840 >From eea3f1a2f5af14ac83c11bfb8da1d4be620d3078 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 3 Jul 2025 10:45:05 +0100 Subject: [PATCH 1/3] [libclc] Reduce include usage in OpenCL builtins This c

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

2025-07-07 Thread Fraser Cormack via cfe-commits
frasercrmck wrote: This isn't `NFC`, though? 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 Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. 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] Rename __CLC_FUNCTION to either FUNCTION or __IMPL_FUNCTION (PR #146999)

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck approved this pull request. Brill, thanks 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-04 Thread Fraser Cormack via cfe-commits
@@ -6,5 +6,12 @@ // //===--===// +#ifndef __CLC_OPENCL_OPENCL_INTEGER_ABS_H__ frasercrmck wrote: Ah it's because I copied it incorrectly from `__CLC_OPENCL_OPENCL_BASE_H__` which does need

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

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146840 >From 185d2fe1bc4a6237b7f42c27bb2c85fe77db3adb Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Thu, 3 Jul 2025 10:45:05 +0100 Subject: [PATCH 1/2] [libclc] Reduce include usage in OpenCL builtins This c

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

2025-07-04 Thread Fraser Cormack via cfe-commits
@@ -6,5 +6,12 @@ // //===--===// +#ifndef __CLC_OPENCL_OPENCL_INTEGER_ABS_H__ frasercrmck wrote: Oh, yes. And of course I'd copy/pasted the mistake to all files... https://github.com/llvm/l

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

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From dab23ab5f4737618fb3f2852738447e66b9b1bff Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/4] [libclc] Place libclc files in clang's resource dir --

[libclc] 222e795 - [libclc] Fix target dependency

2025-07-04 Thread Fraser Cormack via cfe-commits
Author: Fraser Cormack Date: 2025-07-04T11:08:00+01:00 New Revision: 222e795347c14afce49df1540926f3a1ae493de4 URL: https://github.com/llvm/llvm-project/commit/222e795347c14afce49df1540926f3a1ae493de4 DIFF: https://github.com/llvm/llvm-project/commit/222e795347c14afce49df1540926f3a1ae493de4.diff

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

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck updated https://github.com/llvm/llvm-project/pull/146503 >From 40f82d88c4a190fd63a2aff8abc53ea22dce10f5 Mon Sep 17 00:00:00 2001 From: Fraser Cormack Date: Mon, 30 Jun 2025 10:59:02 +0100 Subject: [PATCH 1/4] [libclc] Place libclc files in clang's resource dir --

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

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck 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

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

2025-07-04 Thread Fraser Cormack via cfe-commits
https://github.com/frasercrmck closed 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 Fraser Cormack 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_

  1   2   3   4   5   6   7   8   9   >