[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/126801 running ci >From 2aca2724050b3b4d521c224bbe2f3197244ac2f3 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 11 Feb 2025 13:05:21 -0800 Subject: [PATCH] [OpenMP][OpenMPIRBuilder] Support SPIR-V device vari

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available (PR #126756)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126756 >From a758efe88d1e58a5b53dd7a4b7da6e174f645356 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 11 Feb 2025 07:57:11 -0800 Subject: [PATCH 1/2] [clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/2] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/5] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/6] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126324 >From 46cce74568bca5a3e80e50def4348bc734448362 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Fri, 7 Feb 2025 14:57:12 -0800 Subject: [PATCH 1/8] [Clang] Add __has_target_builtin macro Signed-off-by: Sarnie

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,16 +1803,18 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { + } else if (

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -357,6 +357,7 @@ void Preprocessor::RegisterBuiltinMacros() { Ident__has_builtin = RegisterBuiltinMacro("__has_builtin"); Ident__has_constexpr_builtin = RegisterBuiltinMacro("__has_constexpr_builtin"); + Ident__has_target_builtin = RegisterBuiltinMacro("__has_targ

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,27 @@ +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not="{{BAD|DOESNT}}" %s + +// RUN: %clang_cc1 -fopenmp -triple=nvptx64 -fopenmp-is-target-device \ +// RUN: -aux-t

[clang] [Offload] Treat an empty packager architecture as 'generic' (PR #126655)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex approved this pull request. https://github.com/llvm/llvm-project/pull/126655 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-11 Thread Nick Sarnie via cfe-commits
@@ -1797,55 +1798,62 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { diag::err_feature_check_malformed); return II && HasExtension(*this, II->getName()); }); - } else if (II == Ident__has_builtin) { --

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -1067,7 +1067,8 @@ class CodeGenModule : public CodeGenTypeCache { bool shouldEmitRTTI(bool ForEH = false) { return (ForEH || getLangOpts().RTTI) && !getLangOpts().CUDAIsDevice && !(getLangOpts().OpenMP && getLangOpts().OpenMPIsTargetDevice && -

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/126801 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -1067,7 +1067,8 @@ class CodeGenModule : public CodeGenTypeCache { bool shouldEmitRTTI(bool ForEH = false) { return (ForEH || getLangOpts().RTTI) && !getLangOpts().CUDAIsDevice && !(getLangOpts().OpenMP && getLangOpts().OpenMPIsTargetDevice && -

[clang] [llvm] [OpenMP][OpenMPIRBuilder] Support SPIR-V device variant matches (PR #126801)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -1067,7 +1067,8 @@ class CodeGenModule : public CodeGenTypeCache { bool shouldEmitRTTI(bool ForEH = false) { return (ForEH || getLangOpts().RTTI) && !getLangOpts().CUDAIsDevice && !(getLangOpts().OpenMP && getLangOpts().OpenMPIsTargetDevice && -

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
@@ -96,6 +100,47 @@ the header file to conditionally make a function constexpr whenever the constant evaluation of the corresponding builtin (for example, ``std::fmax`` calls ``__builtin_fmax``) is supported in Clang. +``__has_target_builtin`` + +

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Add __has_target_builtin macro (PR #126324)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/126324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-16 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/120145 This is the first of a series of patches to add support for OpenMP offloading to SPIR-V through liboffload with the first intended target being Intel GPUs. This patch implements the basic driver and `clang-linke

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-16 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/120145 >From e1b9b503b1e9b8ebf5a9c94dcefd0c47ab009019 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 16 Dec 2024 09:25:44 -0800 Subject: [PATCH 1/2] [Driver][clang-linker-wrapper] Add initial support for Open

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-16 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-16 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-16 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/120145 >From e1b9b503b1e9b8ebf5a9c94dcefd0c47ab009019 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 16 Dec 2024 09:25:44 -0800 Subject: [PATCH 1/3] [Driver][clang-linker-wrapper] Add initial support for Open

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,38 @@ +//==- SPIRVOpenMP.cpp - SPIR-V OpenMP Tool Implementations *- C++ -*==// +// +// 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

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -735,11 +736,15 @@ wrapDeviceImages(ArrayRef> Buffers, } Expected>> -bundleOpenMP(ArrayRef Images) { +bundleOpenMP(SmallVectorImpl &Images) { sarnex wrote: It's mutable because we modify it inside `bundleOpenMP` if the vendor is `Intel`, where we call `c

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -2829,10 +2829,13 @@ void tools::addOpenMPDeviceRTL(const Driver &D, LibraryPaths.emplace_back(LibPath); OptSpecifier LibomptargetBCPathOpt = - Triple.isAMDGCN() ? options::OPT_libomptarget_amdgpu_bc_path_EQ -: options::OPT_libomptarget_nv

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -4256,6 +4256,7 @@ bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, if (TT.getArch() == llvm::Triple::UnknownArch || !(TT.getArch() == llvm::Triple::aarch64 || TT.isPPC() || +TT.getArch() == llvm::Triple::spirv64 || -

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -28,8 +28,11 @@ void SPIRV::constructTranslateCommand(Compilation &C, const Tool &T, if (Input.getType() == types::TY_PP_Asm) CmdArgs.push_back("-to-binary"); + + // The text output from spirv-dis is not in the format expected + // by llvm-spirv, so use the text ou

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -2829,10 +2829,13 @@ void tools::addOpenMPDeviceRTL(const Driver &D, LibraryPaths.emplace_back(LibPath); OptSpecifier LibomptargetBCPathOpt = - Triple.isAMDGCN() ? options::OPT_libomptarget_amdgpu_bc_path_EQ -: options::OPT_libomptarget_nv

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -735,11 +736,15 @@ wrapDeviceImages(ArrayRef> Buffers, } Expected>> -bundleOpenMP(ArrayRef Images) { +bundleOpenMP(SmallVectorImpl &Images) { sarnex wrote: Somehow I convinced myself it might be more performant to do it this way, but I'm not so sure that

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -133,6 +133,11 @@ Error getAMDGPUMetaDataFromImage(MemoryBufferRef MemBuffer, StringMap &KernelInfoMap, uint16_t &ELFABIVersion); } // namespace amdgpu +namespace intel { +/// Containerizes an offloading imag

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
sarnex wrote: Would also appreciate a review from @jhuber6! https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -595,6 +595,7 @@ Expected linkDevice(ArrayRef InputFiles, case Triple::aarch64_be: case Triple::ppc64: case Triple::ppc64le: + case Triple::spirv64: sarnex wrote: Will do, thanks https://github.com/llvm/llvm-project/pull/120145

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/120145 >From e1b9b503b1e9b8ebf5a9c94dcefd0c47ab009019 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 16 Dec 2024 09:25:44 -0800 Subject: [PATCH 1/9] [Driver][clang-linker-wrapper] Add initial support for Open

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -922,6 +947,8 @@ void Driver::CreateOffloadingDeviceToolChains(Compilation &C, IsAMDOffloadArch(StringToOffloadArch( getProcessorFromTargetID(*AMDTriple, Arch { DerivedArchs[AMDTriple->getTriple()].insert(Arch); +

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2024-12-17 Thread Nick Sarnie via cfe-commits
@@ -193,7 +193,8 @@ class Triple { Mesa, SUSE, OpenEmbedded, -LastVendorType = OpenEmbedded +Intel, sarnex wrote: Will do in https://github.com/llvm/llvm-project/pull/120250, also my bad I noticed I didn't even add a unit tests for this he

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2024-12-17 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/120266 Currently we produce SPIR-V text with `spirv-dis` but assemble it with `llvm-spirv`. The SPIR-V text format is different between the tools so the assemble fails. We need to use the same tool for both, and since

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-08 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/120266 >From 998827f68bb2f9c1ca43f1132e109406db842880 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 17 Dec 2024 08:52:49 -0800 Subject: [PATCH 1/2] [Driver][SPIR-V] Use consistent tools to convert between te

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-08 Thread Nick Sarnie via cfe-commits
sarnex wrote: I just reworked this to use `spirv-as`, please take a look :) https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-08 Thread Nick Sarnie via cfe-commits
sarnex wrote: Thanks for the review, let me use `spirv-as` so we rely on the SPIR-V tools format. https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-08 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/121839 >From 997373350540448d91f9884b98cbdc0df058a7a3 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 6 Jan 2025 11:48:07 -0800 Subject: [PATCH 1/3] [Clang] __has_builtin should return false for aux triple bui

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-08 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,12 @@ +// REQUIRES: spirv-registered-target +// REQUIRES: x86-registered-target + +// RUN: %clang_cc1 -fopenmp -triple=spirv64 -fopenmp-is-target-device \ +// RUN: -aux-triple x86_64-linux-unknown -E %s | FileCheck -implicit-check-not=BAD %s sarnex wro

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-08 Thread Nick Sarnie via cfe-commits
@@ -0,0 +1,12 @@ +// REQUIRES: spirv-registered-target +// REQUIRES: x86-registered-target + sarnex wrote: fixed in https://github.com/llvm/llvm-project/pull/121839/commits/3ce51118035f1f84ad02898858c95021ff6420d9, thx https://github.com/llvm/llvm-project/pull

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-08 Thread Nick Sarnie via cfe-commits
@@ -1818,8 +1819,21 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: +// We may get here because of aux builtins which may not be +

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-08 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/121839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-22 Thread Nick Sarnie via cfe-commits
@@ -1818,8 +1819,21 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: +// We may get here because of aux builtins which may not be +

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-22 Thread Nick Sarnie via cfe-commits
@@ -1818,8 +1819,21 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: +// We may get here because of aux builtins which may not be +

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-22 Thread Nick Sarnie via cfe-commits
@@ -1818,8 +1819,21 @@ void Preprocessor::ExpandBuiltinMacro(Token &Tok) { // usual allocation and deallocation functions. Required by libc++ return 201802; default: +// We may get here because of aux builtins which may not be +

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
@@ -3,7 +3,10 @@ // RUN: %clang_cc1 %s -ffreestanding -fms-extensions -fms-compatibility \ // RUN: -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o - // %clang_cc1 %s -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o - -

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
@@ -3,7 +3,10 @@ // RUN: %clang_cc1 %s -ffreestanding -fms-extensions -fms-compatibility \ // RUN: -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o - // %clang_cc1 %s -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o - -

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/121839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/121839 >From 997373350540448d91f9884b98cbdc0df058a7a3 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 6 Jan 2025 11:48:07 -0800 Subject: [PATCH 1/5] [Clang] __has_builtin should return false for aux triple bui

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
@@ -3,7 +3,10 @@ // RUN: %clang_cc1 %s -ffreestanding -fms-extensions -fms-compatibility \ // RUN: -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o - // %clang_cc1 %s -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o - -

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
@@ -3,7 +3,10 @@ // RUN: %clang_cc1 %s -ffreestanding -fms-extensions -fms-compatibility \ // RUN: -fms-compatibility-version=19.00 -triple x86_64-pc-windows-msvc -emit-llvm -o - // %clang_cc1 %s -ffreestanding -triple x86_64-w64-windows-gnu -fms-extensions -emit-llvm -o - -

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-23 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex deleted https://github.com/llvm/llvm-project/pull/121839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] __has_builtin should return false for aux triple builtins (#121839) (PR #124626)

2025-01-27 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/124626 This reverts commit 1c28b9237382b093f477479c993c80181922ca6a. Breaks CUDA on ARM. >From 287dcf646d4c7520c8637a798d677168e100b515 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Mon, 27 Jan 2025 13:00:28 -08

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-27 Thread Nick Sarnie via cfe-commits
sarnex wrote: Yeah seems there's no easy fix here. Revert PR here https://github.com/llvm/llvm-project/pull/124626 https://github.com/llvm/llvm-project/pull/121839 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/

[clang] Revert "[Clang] __has_builtin should return false for aux triple builtins (#121839) (PR #124626)

2025-01-27 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/124626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] __has_builtin should return false for aux triple builtins (#121839) (PR #124626)

2025-01-27 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/124626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Revert "[Clang] __has_builtin should return false for aux triple builtins (#121839) (PR #124626)

2025-01-27 Thread Nick Sarnie via cfe-commits
sarnex wrote: Yeah I was thinking maybe we could add a new macro or a new argument or something to control the behavior https://github.com/llvm/llvm-project/pull/124626 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-13 Thread Nick Sarnie via cfe-commits
sarnex wrote: > I believe the conclusion was that we should emit the builtin functions, but > `__has_builtin` should return false for builtins only present in the aux > triple. For the one test that complicates this behavior, I don't think the > use-case is completely well-formed but was hopin

[clang] [Clang] __has_builtin should return false for aux triple builtins (PR #121839)

2025-01-13 Thread Nick Sarnie via cfe-commits
sarnex wrote: Sorry, I kind of got lost in the above discussion. Are additional changes required in Clang to parse builtins unsupported on the current target to make sure we don't break anything or is only changing the result of `__has_builtin` acceptable? https://github.com/llvm/llvm-project

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2025-01-02 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver][SPIR-V] Make tool names consistent (PR #122343)

2025-01-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/122343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver][SPIR-V] Make tool names consistent (PR #122343)

2025-01-10 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/122343 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-09 Thread Nick Sarnie via cfe-commits
sarnex wrote: Yep already working on it, integration issue with another change from me, my bad https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix SPIR-V OpenMP test assembler check (PR #122310)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/122310 Integration issue with the SPIR-V OpenMP change and the SPIR-V change adding the assembler job. I notice there is a consistency issue in the binding name "SPIRV" vs "SPIR-V", I will fix that in a separate commi

[clang] [clang] Fix SPIR-V OpenMP test assembler check (PR #122310)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/122310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-09 Thread Nick Sarnie via cfe-commits
sarnex wrote: Fix https://github.com/llvm/llvm-project/pull/122310 https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang] Fix SPIR-V OpenMP test assembler check (PR #122310)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex edited https://github.com/llvm/llvm-project/pull/122310 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Driver][SPIR-V] Make tool names consistent (PR #122343)

2025-01-09 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/122343 Some use `SPIRV` and some use `SPIR-V`, just use `SPIR-V` which is what we use normally. >From 6fe5690d4b5051391dbb7d2f760c437376bf9a7e Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Thu, 9 Jan 2025 11:06:

[clang] [Driver][SPIR-V] Use consistent tools to convert between text and binary form (PR #120266)

2025-01-02 Thread Nick Sarnie via cfe-commits
sarnex wrote: Ping on this one @llvm/pr-subscribers-backend-spir-v @llvm/pr-subscribers-clang-driver Thx! https://github.com/llvm/llvm-project/pull/120266 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [llvm] [Driver][clang-linker-wrapper] Add initial support for OpenMP offloading to generic SPIR-V (PR #120145)

2025-01-02 Thread Nick Sarnie via cfe-commits
sarnex wrote: @jhuber6 Thanks, if you don't think we need any more reviews do you mind merging? I still don't have push (working on it). If not, could you please ping other reviewers? Thx https://github.com/llvm/llvm-project/pull/120145 ___ cfe-commit

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-12 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex created https://github.com/llvm/llvm-project/pull/126956 running ci >From 967dec47f3d369effa0defdc0d39547a173aca67 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 12 Feb 2025 11:03:34 -0800 Subject: [PATCH] [LLVM][Triple][NFCI] Add function to test for GPU of

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-13 Thread Nick Sarnie via cfe-commits
@@ -2624,9 +2624,8 @@ void CGOpenMPRuntime::emitDistributeStaticInit( emitUpdateLocation(CGF, Loc, OMP_IDENT_WORK_DISTRIBUTE); llvm::Value *ThreadId = getThreadID(CGF, Loc); llvm::FunctionCallee StaticInitFunction; - bool isGPUDistribute = - CGM.getLangOpts().Op

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-13 Thread Nick Sarnie via cfe-commits
@@ -1109,6 +1109,11 @@ class Triple { Env == llvm::Triple::EABIHF; } + /// Tests if the target represents a GPU which can be offloaded to. + bool isOffloadingTargetGPU() const { sarnex wrote: sure, thats good point. i think doing that will reso

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-13 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126956 >From 967dec47f3d369effa0defdc0d39547a173aca67 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 12 Feb 2025 11:03:34 -0800 Subject: [PATCH 1/2] [LLVM][Triple][NFCI] Add function to test for GPU offloadin

[clang] [llvm] [LLVM][Triple][NFCI] Add function to test for GPU offloading triples (PR #126956)

2025-02-13 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126956 >From 967dec47f3d369effa0defdc0d39547a173aca67 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Wed, 12 Feb 2025 11:03:34 -0800 Subject: [PATCH 1/3] [LLVM][Triple][NFCI] Add function to test for GPU offloadin

[clang] [clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available (PR #126756)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex ready_for_review https://github.com/llvm/llvm-project/pull/126756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang-linker-wrapper][lit] Fix SPIR-V ELF test when spirv-tools feature is available (PR #126756)

2025-02-11 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex closed https://github.com/llvm/llvm-project/pull/126756 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Headers] Implement spirvamdgcnintrin.h (PR #131164)

2025-03-18 Thread Nick Sarnie via cfe-commits
sarnex wrote: > @sarnex I'm assuming you're somewhat familiar with SPIR-V and the backend. We > really need a way to call SPIR-V builtins directly, i.e. some way to get > clang to lower something like __builtin_spirv_ballot() to > OpGroupNonUniformBallot. I don't know how much SPIR-V exposes f

[clang] [flang] [llvm] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

2025-03-21 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126956 >From 044158c176316e6c9f44ce1487ff631c8a0d15c4 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 4 Mar 2025 11:16:34 -0800 Subject: [PATCH 1/2] [clang] Add isOffloadingTarget function to LangOpts Signed-o

[clang] [flang] [llvm] [clang] Add isOffloadingTarget function to LangOpts (PR #126956)

2025-03-21 Thread Nick Sarnie via cfe-commits
https://github.com/sarnex updated https://github.com/llvm/llvm-project/pull/126956 >From 044158c176316e6c9f44ce1487ff631c8a0d15c4 Mon Sep 17 00:00:00 2001 From: "Sarnie, Nick" Date: Tue, 4 Mar 2025 11:16:34 -0800 Subject: [PATCH 1/2] [clang] Add isOffloadingTarget function to LangOpts Signed-o

<    1   2   3   4   5   >