[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -240,3 +240,49 @@ LLVM_DUMP_METHOD void FPOptionsOverride::dump() { #include "clang/Basic/FPOptions.def" llvm::errs() << "\n"; } + +AtomicOptionsOverride +AtomicOptions::getChangesSlow(const AtomicOptions &Base) const { + AtomicOptions::storage_type OverrideMask = 0; +#de

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Mostly drive-by comments. Don't have strong opinion on either the attributes > themselves nor how the values get parsed. > > One thing that's missing is the documentation for the attributes. Their > format and meaning are far from obvious and should be documented along with

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu edited https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -3292,6 +3292,8 @@ def err_invalid_branch_protection_spec : Error< "invalid or misplaced branch protection specification '%0'">; def warn_unsupported_branch_protection_spec : Warning< "unsupported branch protection specification '%0'">, InGroup; +def err_attribute_inval

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-31 Thread Yaxun Liu via cfe-commits
@@ -623,6 +623,10 @@ class LangOptions : public LangOptionsBase { // WebAssembly target. bool NoWasmOpt = false; + /// The default atomic codegen options specified by command line in the + /// format of key:{on|off}. + std::vector AtomicOptionsAsWritten; ---

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -2355,6 +2355,14 @@ def fsymbol_partition_EQ : Joined<["-"], "fsymbol-partition=">, Group, Visibility<[ClangOption, CC1Option]>, MarshallingInfoString>; +def fatomic_EQ : CommaJoined<["-"], "fatomic=">, Group, + Visibility<[ClangOption, CC1Option]>, + HelpText<"Speci

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-30 Thread Yaxun Liu via cfe-commits
@@ -305,6 +305,13 @@ def err_drv_invalid_int_value : Error<"invalid integral value '%1' in '%0'">; def err_drv_invalid_value_with_suggestion : Error< "invalid value '%1' in '%0', expected one of: %2">; def err_drv_alignment_not_power_of_two : Error<"alignment is not a powe

[clang] [clang][CodeGen][SPIRV] Translate `amdgpu_flat_work_group_size` into `reqd_work_group_size`. (PR #116820)

2024-11-21 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: reqd_work_group_size is for OpenCL reqd_work_group_size attribute and it sets exact block size. amdgpu-flat-work-group-size sets a (min, max) range for block size. HIP launch bounds sets a block size range (1, bound). It cannot be represented by reqd_work_group_size. https:/

[clang] [HIP] Fix tests broken by #117074 / 689c532 (PR #117361)

2024-11-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/117361 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA] pass -fno-threadsafe-statics to GPU sub-compilations. (PR #117074)

2024-11-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM. Thanks! https://github.com/llvm/llvm-project/pull/117074 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
@@ -1309,6 +1309,16 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old, return Ovl_Overload; } +template static bool hasExplicitAttr(const FunctionDecl *D) { + if (!D) +return false; + if (auto *A = D->getAttr()) +return !A->isImplicit();

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/121986 >From ae55b59e9e7d944b02ce0059f879718fd733c301 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 7 Jan 2025 13:52:09 -0500 Subject: [PATCH] [CUDA][HIP] Fix overriding of constexpr virtual function In

[clang] [CUDA][HIP] improve error message for missing cmath (PR #122155)

2025-01-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/122155 One common error seen in CUDA/HIP compilation is: fatal error: 'cmath' file not found which is due to inproper installation of standard C++ libraries. Since it happens with #include_next, users may feel confu

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

2025-01-08 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > I am afraid this will break all existing CUDA/HIP programs since they > > expect to be able to parse the builtins for both host and device targets. > > In the spirit of single source, the compiler sees the entire code for all > > targets, including host target and all device

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
@@ -1595,8 +1606,21 @@ static bool IsOverloadOrOverrideImpl(Sema &SemaRef, FunctionDecl *New, // Allow overloading of functions with same signature and different CUDA // target attributes. -if (NewTarget != OldTarget) +if (NewTarget != OldTarg

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/121986 >From fa0df07b80b0f704f4e10fa1ec468fa6ed02291a Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 7 Jan 2025 13:52:09 -0500 Subject: [PATCH] [CUDA][HIP] Fix overriding of constexpr virtual function In

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > This needs a release note added https://github.com/llvm/llvm-project/pull/121986 ___ 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-08 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I am afraid this will break all existing CUDA/HIP programs since they expect to be able to parse the builtins for both host and device targets. In the spirit of single source, the compiler sees the entire code for all targets, including host target and all device targets. It is

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-08 Thread Yaxun Liu via cfe-commits
@@ -1309,6 +1309,16 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old, return Ovl_Overload; } +template static bool hasExplicitAttr(const FunctionDecl *D) { + if (!D) +return false; yxsamliu wrote: will do https://github.co

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I've never been a fan of this type of implicit behavior, since it will change > spuriously depending on what the user wants. > > I also wonder if we couldn't do something similar with ELF compression so we > don't need to manually do all this stuff. Linux only supports compr

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/122307 >From a067566b7422f84323b6f44df41918fe503fcb84 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 9 Jan 2025 09:19:35 -0500 Subject: [PATCH] [OffloadBundler] Compress bundles over 4GB Added initial su

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/122307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HIP] Support managed variables using the new driver (PR #123437)

2025-01-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/123437 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)

2025-01-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/111885 >From 5fe838d468f341df6f11a34b489d182f80c097f1 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 25 Sep 2024 14:31:54 -0400 Subject: [PATCH] Reland "[HIP] Use original file path for CUID" (#108771) T

[clang] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)

2025-01-22 Thread Yaxun Liu via cfe-commits
@@ -1,13 +1,15 @@ // Check CUID generated by hash. // The same CUID is generated for the same file with the same options. +// RUN: cd %S + // RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \ // RUN: --offload-arch=gfx906 -c -nogpuinc -no

[clang] e87b843 - Reland [OffloadBundler] Compress bundles over 4GB (#122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2025-01-20T21:17:21-05:00 New Revision: e87b843811e147db8d1edd7fe2dd52bb90be6ebc URL: https://github.com/llvm/llvm-project/commit/e87b843811e147db8d1edd7fe2dd52bb90be6ebc DIFF: https://github.com/llvm/llvm-project/commit/e87b843811e147db8d1edd7fe2dd52bb90be6ebc.dif

[clang] 72c560d - Revert "[OffloadBundler] Compress bundles over 4GB (#122307)"

2025-01-20 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2025-01-20T20:58:05-05:00 New Revision: 72c560da4b923b42114490093794e585144879f4 URL: https://github.com/llvm/llvm-project/commit/72c560da4b923b42114490093794e585144879f4 DIFF: https://github.com/llvm/llvm-project/commit/72c560da4b923b42114490093794e585144879f4.dif

[clang] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)

2025-01-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/111885 >From 6a3a200019f7d0973f35a83d735a2f517d636e3e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 25 Sep 2024 14:31:54 -0400 Subject: [PATCH] Reland "[HIP] Use original file path for CUID" (#108771) T

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/122307 >From eb980d1e6f3919ab3ee86ff5ac8ea0805dd8afe1 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 9 Jan 2025 09:19:35 -0500 Subject: [PATCH] [OffloadBundler] Compress bundles over 4GB Added initial su

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/122307 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > Seems fine. What's required to move HIP over to using the binary format > > > natively by the way? Guessing we'd need to update a bunch of tools in the > > > fork. > > > > > > need to teach comgr to load the new offload binary > > Should be easy enough, since there's a

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Seems fine. What's required to move HIP over to using the binary format > natively by the way? Guessing we'd need to update a bunch of tools in the > fork. need to teach comgr to load the new offload binary https://github.com/llvm/llvm-project/pull/122307 ___

[clang] [Driver][ASan] Refactor Clang-Driver "Sanitizer Bitcode" linking. (PR #123922)

2025-01-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/123922 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-01-28 Thread Yaxun Liu via cfe-commits
@@ -37,6 +37,16 @@ AMDGPUOpenMPToolChain::AMDGPUOpenMPToolChain(const Driver &D, // Lookup binaries into the driver directory, this is used to // discover the 'amdgpu-arch' executable. getProgramPaths().push_back(getDriver().Dir); + // Diagnose unsupported sanitizer opti

[clang] Add clang atomic control options and attribute (PR #114841)

2025-01-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/114841 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OpenMP][ASan] Enable ASan Instrumentation for AMDGPUOpenMPToolChain. (PR #124754)

2025-01-28 Thread Yaxun Liu via cfe-commits
@@ -37,6 +37,16 @@ AMDGPUOpenMPToolChain::AMDGPUOpenMPToolChain(const Driver &D, // Lookup binaries into the driver directory, this is used to // discover the 'amdgpu-arch' executable. getProgramPaths().push_back(getDriver().Dir); + // Diagnose unsupported sanitizer opti

[clang] [NFC][docs][HIP] Update HIP docs around `hipstdpar` and SPIR-V (PR #124803)

2025-01-28 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/124803 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [HIP] Support managed variables using the new driver (PR #123437)

2025-01-21 Thread Yaxun Liu via cfe-commits
@@ -353,6 +353,16 @@ Function *createRegisterGlobalsFunction(Module &M, bool IsHIP, FunctionCallee RegVar = M.getOrInsertFunction( IsHIP ? "__hipRegisterVar" : "__cudaRegisterVar", RegVarTy); + // Get the __cudaRegisterSurface function declaration. y

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-01-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: Did you try this patch with internal PSDB? Does it break any existing HIP apps or libraries? https://github.com/llvm/llvm-project/pull/122629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailma

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/122859 CUID is needed by CUDA/HIP for supporting accessing static device variables in host function. Currently CUID is only supported by the old driver for CUDA/HIP. The new driver does not support it, which causes

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I thought the new driver just got some entropy from the current source file's > `inode` entry? I'm not opposed, since I guess it would make sense to give the > user a way to override it. Sorry I did not quite get your question. Do you suggest that we need some option to over

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > I thought the new driver just got some entropy from the current source > > > file's `inode` entry? I'm not opposed, since I guess it would make sense > > > to give the user a way to override it. > > > > > > Sorry I did not quite get your question. Do you suggest that we

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > Yeah, that's fine, but we should just default to the inode method if the > argument isn't present I think. That way it works without needing this extra > argument passed to both the compile phases. That would break rccl. We should use CUID's that work in general, including

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-14 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/122859 >From 38939c7ecd5b29d92cffcb4fa3911159bd37d0e5 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 13 Jan 2025 14:12:52 -0500 Subject: [PATCH] [CUDA][HIP] Support CUID in new driver CUID is needed by C

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Can we get a new test showing CUDA? CUDA uses the new driver by default so > cuid stuff will be missing there. Added. https://github.com/llvm/llvm-project/pull/122859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-07 Thread Yaxun Liu via cfe-commits
@@ -1595,8 +1606,21 @@ static bool IsOverloadOrOverrideImpl(Sema &SemaRef, FunctionDecl *New, // Allow overloading of functions with same signature and different CUDA // target attributes. -if (NewTarget != OldTarget) +if (NewTarget != OldTarg

[clang] [OffloadBundler] Compress bundles over 4GB (PR #122307)

2025-01-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/122307 Added initial support for version 3 of the compressed offload bundle format, which uses 64-bit fields for Total File Size and Uncompressed Binary Size. This enables support for files larger than 4GB. The suppo

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/121986 >From 21485f0f77e335736cebd125c6c9a4d33b7e36e0 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 7 Jan 2025 13:52:09 -0500 Subject: [PATCH] [CUDA][HIP] Fix overriding of constexpr virtual function In

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-09 Thread Yaxun Liu via cfe-commits
@@ -1309,6 +1309,13 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old, return Ovl_Overload; } +template static bool hasExplicitAttr(const FunctionDecl *D) { + assert(D && "function delc should not be null"); yxsamliu wrote: fixe

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-09 Thread Yaxun Liu via cfe-commits
@@ -1309,6 +1309,16 @@ Sema::CheckOverload(Scope *S, FunctionDecl *New, const LookupResult &Old, return Ovl_Overload; } +template static bool hasExplicitAttr(const FunctionDecl *D) { + if (!D) +return false; + if (auto *A = D->getAttr()) +return !A->isImplicit();

[clang] [CUDA][HIP] improve error message for missing cmath (PR #122155)

2025-01-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/122155 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix overriding of constexpr virtual function (PR #121986)

2025-01-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/121986 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Support CUID in new driver (PR #122859)

2025-01-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/122859 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-02-13 Thread Yaxun Liu via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-02-13 Thread Yaxun Liu via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-02-13 Thread Yaxun Liu via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-02-13 Thread Yaxun Liu via cfe-commits
@@ -31,16 +44,118 @@ typedef hipError_t (*hipGetDeviceCount_t)(int *); typedef hipError_t (*hipDeviceGet_t)(int *, int); typedef hipError_t (*hipGetDeviceProperties_t)(hipDeviceProp_t *, int); -int printGPUsByHIP() { +extern cl::opt Verbose; + #ifdef _WIN32 - constexpr const

[clang] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-02-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/101350 >From 649aba6ed5caee1632901238ed932e2c50214df7 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 31 Jul 2024 09:23:05 -0400 Subject: [PATCH] Fix amdgpu-arch for dll name on Windows Recently HIP runti

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-24 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/132869 Currently HIP still uses offload bundler for non-rdc mode for the new offload driver. This patch switches to use offload wrapper for non-device-only non-rdc mode when new offload driver is enabled. This make

[clang] [clang-tools-extra] [CudaSPIRV] Allow using integral non-type template parameters as attribute args (PR #131546)

2025-03-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,34 @@ +// RUN: %clang_cc1 -triple spirv64 -aux-triple x86_64-unknown-linux-gnu \ +// RUN: -fcuda-is-device -verify -fsyntax-only %s + yxsamliu wrote: need tests for non-contstant int variable, zero, negative integer https://github.com/llvm/llvm-pro

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM. Thanks https://github.com/llvm/llvm-project/pull/122629 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang] Permit `-Xarch_` to be used with `--offload-arch` (PR #131884)

2025-03-19 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/131884 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [LinkerWrapper] Remove special handling for archives (PR #114843)

2025-03-19 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/114843 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-04-05 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/132869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Use size_t to compare with npos (PR #132868)

2025-03-25 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu commented: Thanks for fixing this. https://github.com/llvm/llvm-project/pull/132868 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/132869 >From a7b74b80018d15a3c2c30bbc363b73e691ece269 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 21 Mar 2025 14:16:44 -0400 Subject: [PATCH] [HIP] use offload wrapper for non-device-only non-rdc Curr

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/132869 >From 987007b668991ab8027a569f2aaafb5237dfc194 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 21 Mar 2025 14:16:44 -0400 Subject: [PATCH] [HIP] use offload wrapper for non-device-only non-rdc Curr

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
@@ -9348,11 +9348,22 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, // Add the linker arguments to be forwarded by the wrapper. CmdArgs.push_back(Args.MakeArgString(Twine("--linker-path=") + LinkCommand->getE

[clang] [AMDGPU] Remove detection of hip runtime for Spack (PR #133263)

2025-03-27 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I'm going to wager that we can't just rip this out without the world > exploding, and these issues need to be addressed and not just drop the whole > thing. [haampie](https://github.com/haampie) is the maintainer of the HIP spack package. I assume it is safe to remove them b

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
@@ -9348,11 +9348,22 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, // Add the linker arguments to be forwarded by the wrapper. CmdArgs.push_back(Args.MakeArgString(Twine("--linker-path=") + LinkCommand->getE

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
@@ -4502,6 +4506,16 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args, InputArg)) break; + // For HIP non-rdc non-device-only compilation, create a linker wrapper yxs

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-27 Thread Yaxun Liu via cfe-commits
@@ -4945,12 +4959,15 @@ Action *Driver::BuildOffloadingActions(Compilation &C, } } -// Compiling HIP in non-RDC mode requires linking each action individually. +// Compiling HIP in device-only non-RDC mode requires linking each action +// individually.

[clang] [AMDGPU] Remove detection of hip runtime for Spack (PR #133263)

2025-03-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM. Thanks https://github.com/llvm/llvm-project/pull/133263 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][AMDGPU] Accept builtins in lambda declarations (PR #135027)

2025-04-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: LGTM. Pls address other comments https://github.com/llvm/llvm-project/pull/135027 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-04-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/132869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Clang][OpenCL][AMDGPU] Allow a kernel to call another kernel (PR #115821)

2025-04-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @lalaniket8 @arsenm I don't have a strong opinion, but shouldn't this > transformation be done during lowering to the target? Current version of the > patch brings odd behavior for LLVM IR to SPIR-V lowering for OpenCL kernels. > SPIR-V don't allow one EntryPoint to refer ano

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-04-09 Thread Yaxun Liu via cfe-commits
@@ -43,6 +43,33 @@ using namespace clang; using namespace CodeGen; using namespace llvm; +/// Some builtins do not have library implementation on some targets and +/// are instead emitted as LLVM IRs by some target builtin emitters. +/// FIXME: Remove this when library support

[clang] [Clang] Unify 'nvptx-arch' and 'amdgpu-arch' into 'offload-arch' (PR #134713)

2025-04-10 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,78 @@ +//===- OffloadArch.cpp - list available GPUs *- 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] [Clang] add option --offload-jobs=N (PR #135229)

2025-04-10 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/135229 for specifying number of threads for clang-linker-wrapper. By default it uses half of hardware threads. >From aaa6b0b3fbcff1c2f6bc8983c7c0abee1e63eb6a Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Th

[clang] [HIP] use offload wrapper for non-device-only non-rdc (PR #132869)

2025-03-28 Thread Yaxun Liu via cfe-commits
@@ -9332,11 +9332,22 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, // Add the linker arguments to be forwarded by the wrapper. CmdArgs.push_back(Args.MakeArgString(Twine("--linker-path=") + LinkCommand->getE

[clang] [HIP] Claim `--offload-compress` for `-M` (PR #133456)

2025-03-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Why does this only cause warnings when it makes dependency files? Because `--offloading-compress` is parsed by offload bundler and offload wrapper actions when creating job actions. There is no action to parse them in the compilation that only generates dependency files. > I

[clang] [HIP] Claim `--offload-compress` for `-M` (PR #133456)

2025-03-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > Why does this only cause warnings when it makes dependency files? > > > > > > Because `--offloading-compress` is parsed by offload bundler and offload > > wrapper actions when creating job actions. There is no action to parse them > > in the compilation that only generat

[clang] Reland [HIP] fix host min/max in header (PR #133590)

2025-03-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/133590 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Yaxun Liu via cfe-commits
@@ -266,15 +266,14 @@ without differentiation based on offload kind. The target triple of the code object. See `Target Triple `_. -The bundler accepts target triples with or without the optional envir

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Yaxun Liu via cfe-commits
@@ -520,32 +520,32 @@ // Check archive unbundling // // Create few code object bundles and archive them to create an input archive -// RUN: clang-offload-bundler -type=o -targets=host-%itanium_abi_triple,openmp-amdgcn-amd-amdhsa-gfx906,openmp-amdgcn-amd-amdhsa--gfx908 -input=

[clang] [llvm] [OffloadBundler] Rework the ctor of `OffloadTargetInfo` to support AMDGPU's generic target (PR #122629)

2025-03-17 Thread Yaxun Liu via cfe-commits
@@ -84,31 +84,27 @@ OffloadTargetInfo::OffloadTargetInfo(const StringRef Target, : BundlerConfig(BC) { // TODO: Add error checking from ClangOffloadBundler.cpp - auto TargetFeatures = Target.split(':'); - auto TripleOrGPU = TargetFeatures.first.rsplit('-'); - - if (cl

[clang] [AMDGPU][Clang] Add builtins for gfx12 ray tracing intrinsics (PR #135224)

2025-04-11 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/135224 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [clang][Sema][SYCL] Fix MSVC STL usage on AMDGPU (PR #135979)

2025-04-17 Thread Yaxun Liu via cfe-commits
@@ -5522,6 +5522,11 @@ bool Sema::CheckCallingConvAttr(const ParsedAttr &Attrs, CallingConv &CC, A = HostTI->checkCallingConvention(CC); if (A == TargetInfo::CCCR_OK && CheckDevice && DeviceTI) A = DeviceTI->checkCallingConvention(CC); + } else if (LangOpts.SY

[clang] [Clang] add option --offload-jobs=N (PR #135229)

2025-04-14 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/135229 >From 6aae774e5729779b1e9fd8fee792c06cbc00f29a Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 10 Apr 2025 14:14:47 -0400 Subject: [PATCH] [Clang] add option --offload-jobs=N for specifying number

[clang] [Clang] add option --offload-jobs=N (PR #135229)

2025-04-14 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu edited https://github.com/llvm/llvm-project/pull/135229 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-21 Thread Yaxun Liu via cfe-commits
@@ -14706,6 +14706,8 @@ ExprResult Sema::BuildOverloadedCallExpr(Scope *S, Expr *Fn, // the UnresolvedLookupExpr was type-dependent. if (OverloadResult == OR_Success) { const FunctionDecl *FDecl = Best->Function; +if (LangOpts.CUDA) yxsamliu wrote:

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-21 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/136645 In a lambda function, a call of a function may resolve to host and device functions with different signatures. Especially, a constexpr local variable may be passed by value by the device function and passed by r

[clang] [clang][Sema][SYCL] Fix MSVC STL usage on AMDGPU (PR #135979)

2025-04-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/135979 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU][clang] provide device implementation for __builtin_logb and … (PR #129347)

2025-04-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: can we add a llvm-test-suite test for these builtin functions? we can compare their value with host results for typical and corner inputs, like the test added in this PR https://github.com/llvm/llvm-test-suite/pull/230 . This will give us some confidence that the clang codegen

[clang] clang/HIP: Add tests that shows fpmath metadata ends up on sqrt calls (PR #136413)

2025-04-24 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/136413 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-23 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/136645 >From 834f1eed2ffde0b15209fca6560191911151c9f6 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 16 Apr 2025 11:09:16 -0400 Subject: [PATCH] [CUDA][HIP] capture possible ODR-used var In a lambda func

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-23 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/136645 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] capture possible ODR-used var (PR #136645)

2025-04-23 Thread Yaxun Liu via cfe-commits
@@ -1100,3 +1101,49 @@ std::string SemaCUDA::getConfigureFuncName() const { // Legacy CUDA kernel configuration call return "cudaConfigureCall"; } + +// Record any local constexpr variables that are passed one way on the host +// and another on the device. +void SemaCUDA::r

[clang] [Clang][OpenCL][AMDGPU] OpenCL Kernel stubs should be assigned alwaysinline attribute (PR #137769)

2025-04-30 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/137769 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

<    10   11   12   13   14   15   16   17   >