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

2025-04-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > In practice this should be a single use of an internal function and should > > not require this hint. Is this papering over a different issue? > > Why do you think it is an internal function? I thought it's an externally > callable stub. Agree. OpenCL allows calling an ext

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

2025-04-10 Thread Yaxun Liu via cfe-commits
@@ -1233,6 +1233,10 @@ def offload_compression_level_EQ : Joined<["--"], "offload-compression-level=">, Flags<[HelpHidden]>, HelpText<"Compression level for offload device binaries (HIP only)">; +def offload_jobs_EQ : Joined<["--"], "offload-jobs=">, + HelpText<"Set the

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

2025-04-10 Thread Yaxun Liu via cfe-commits
@@ -9360,6 +9362,19 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA, CmdArgs.push_back(LinkArg); addOffloadCompressArgs(Args, CmdArgs); + + // Default to half of hardware threads if users do not specify it. + if (Arg *A = Args.getLastArg(opti

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

2025-04-10 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/135229 >From 8d66eac07fa9b4d052b821f1f33783a3e5a1af34 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-10 Thread Yaxun Liu via cfe-commits
@@ -1233,6 +1233,10 @@ def offload_compression_level_EQ : Joined<["--"], "offload-compression-level=">, Flags<[HelpHidden]>, HelpText<"Compression level for offload device binaries (HIP only)">; +def offload_jobs_EQ : Joined<["--"], "offload-jobs=">, + HelpText<"Set the

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

2025-04-14 Thread Yaxun Liu via cfe-commits
@@ -1234,6 +1234,10 @@ def offload_compression_level_EQ : Joined<["--"], "offload-compression-level=">, Flags<[HelpHidden]>, HelpText<"Compression level for offload device binaries (HIP only)">; +def offload_jobs_EQ : Joined<["--"], "offload-jobs=">, + HelpText<"Specify

[clang] [CUDA][HIP] Add a __device__ version of std::__glibcxx_assert_fail() (PR #136133)

2025-04-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > This patch is cruelly missing some tests. Is there a place for tests of this > kind? I haven't found an obvious one for other headers. You may consider adding a test here https://github.com/llvm/llvm-test-suite/tree/main/External/HIP. If possible, I would be happy to see std

[clang] [CUDA][HIP] Add a __device__ version of std::__glibcxx_assert_fail() (PR #136133)

2025-04-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: LGTM. The addition of the device version of std::__glibcxx_assert_fail() seems reasonable and straightforward. WDYT @Artem-B https://github.com/llvm/llvm-project/pull/136133 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[clang] [NFC][clang-offload-bundler] Simplify main function (PR #138555)

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

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

2025-05-01 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/138162 >From 7b139b3a06e45f7429e1e0f15eb16d0c3aed5718 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 1 May 2025 12:08:05 -0400 Subject: [PATCH] [CUDA][HIP] Fix implicit attribute of builtin When a builti

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

2025-05-01 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/138162 When a builtin function with generic pointer parameter is passed a pointer with address space, clang creates an overloaded builtin function but does not make it implicit. This causes error when the builtin is

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

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

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

2025-04-14 Thread Yaxun Liu via cfe-commits
@@ -57,6 +57,7 @@ #include "llvm/Support/FileSystem.h" #include "llvm/Support/Path.h" #include "llvm/Support/Process.h" +#include "llvm/Support/ThreadPool.h" yxsamliu wrote: will remove https://github.com/llvm/llvm-project/pull/135229

[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 5c2283b01ac6a58e41df4260aecc01bcf463a0a9 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-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed 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] Fix implicit attribute of builtin (PR #138162)

2025-05-02 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,23 @@ +// expected-no-diagnostics + +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -aux-triple amdgcn-amd-amdhsa -fsyntax-only -verify -xhip %s +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -fsyntax-only -fcuda-is-device -verify -xhip %s + +#include "Inputs/cuda

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

2025-05-02 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/138162 Rate limit ยท GitHub body { background-color: #f6f8fa; color: #24292e; font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Helvetica,Arial,sans-

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

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

[clang] [CUDA][HIP] Fix implicit attribute of builtin (PR #138162)

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

[clang] [CUDA][HIP] Fix host/device attribute of builtin (PR #138162)

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

[clang] [CUDA][HIP] Fix host/device attribute of builtin (PR #138162)

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

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Yaxun Liu via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

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

2025-03-06 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] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)

2025-03-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/111885 ___ 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-03-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/101350 >From aba3005a829cecdeb13c1bc4118cbc5ad959affe 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] Fix amdgpu-arch for dll name on Windows (PR #101350)

2025-03-06 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-03-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/101350 ___ 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-03-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: [AMD Official Use Only - AMD Internal Distribution Only] I will revert it. Sam From: Vladimir Vereschaka ***@***.***> Sent: Friday, March 7, 2025 3:34 PM To: llvm/llvm-project ***@***.***> Cc: Liu, Yaxun (Sam) ***@***.***>; Mention ***@***.***> Subject: Re: [llvm/llvm-project]

[clang] 5ff4355 - Revert "Fix amdgpu-arch for dll name on Windows (#101350)"

2025-03-07 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2025-03-07T15:54:50-05:00 New Revision: 5ff43550fa2aa3b93aa7310b8e435ba9e1338486 URL: https://github.com/llvm/llvm-project/commit/5ff43550fa2aa3b93aa7310b8e435ba9e1338486 DIFF: https://github.com/llvm/llvm-project/commit/5ff43550fa2aa3b93aa7310b8e435ba9e1338486.dif

[clang] clang: Do not implicitly addrspacecast in EmitAggExprToLValue (PR #129837)

2025-03-05 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I have some doubt whether this will work for CUDA/HIP since their AST is not aware of address space. When translated to IR, any pointer is expected to pointing to default addr space. That is why alloca is immediately casted to generic pointer and used as generic pointer to matc

[clang] clang: Hack around opencl enqueue_block using wrong ABI for aggregrate (PR #130011)

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

[clang] [OpenCL] Allow -fno-offload-uniform-block for 1.2 (PR #79026)

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

[clang] [OpenCL] Allow -fno-offload-uniform-block for 1.2 (PR #79026)

2025-03-11 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: close this for now since it seems no longer needed https://github.com/llvm/llvm-project/pull/79026 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

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

[clang] Add SPIRV support to HIPAMD toolchain (PR #75357)

2025-03-11 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: close this since it is superseded by other PRs https://github.com/llvm/llvm-project/pull/75357 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2025-03-11 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/130624 Reload aba3005a after fixing build failure. Recently HIP runtime changed dll name to amdhip64_n.dll on Windows, where n is ROCm major version number. Fix amdgpu-arch to search for amdhip64_n.dll on Windows.

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-27 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Would it make sense to separate into separate patches deferred diag fix > (1a/1b on your list) from inference of destructor attributes? > > Deferred diags fix is straightforward, but destructor attribute inference may > need a longer discussion. split the deferred diag chang

[clang] [CUDA][HIP] check dtor in deferred diag (PR #129117)

2025-02-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/129117 Currently the deferred diag fails to diagnose calling of host function in host device function in device compilation triggered by destructors. This can be further divided into two issuse: 1. the deferred diag

[clang] [CUDA][HIP] check dtor in deferred diag (PR #129117)

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

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/128926 >From 30bde986afda876d877d63212d8e4a34d2927aad Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 26 Feb 2025 11:43:28 -0500 Subject: [PATCH] [CUDA][HIP] fix virtual dtor host/device attr Currently if

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

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

[clang] [CUDA][HIP] check dtor in deferred diag (PR #129117)

2025-02-28 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/129117 >From 6089ec549a2456b6edf716cecf8f77d1ad0923b0 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 26 Feb 2025 11:43:28 -0500 Subject: [PATCH] [CUDA][HIP] check dtor in deferred diag Currently the defe

[clang] [CUDA][HIP] check dtor in deferred diag (PR #129117)

2025-02-28 Thread Yaxun Liu via cfe-commits
@@ -1798,6 +1798,62 @@ class DeferredDiagnosticsEmitter Inherited::visitUsedDecl(Loc, D); } + // Visitor member and parent dtors called by this dtor. + void VisitCalledDestructors(CXXDestructorDecl *DD) { +const CXXRecordDecl *RD = DD->getParent(); + +// Visi

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-28 Thread Yaxun Liu via cfe-commits
@@ -32,22 +32,24 @@ public: template class B; } -// The implicit host/device attrs of virtual dtor B::~B() is inferred to -// have implicit device attr since dtors of its members and parent classes can -// be executed on device. This causes a diagnostic since B::~B() must -//

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -132,6 +132,12 @@ Attribute Changes in Clang This forces the global to be considered small or large in regards to the x86-64 code model, regardless of the code model specified for the compilation. +- Introduced a new statement attribute ``[[clang::atomic]]`` that enabl

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -5442,6 +5442,155 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed 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] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-27 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Would it make sense to separate into separate patches deferred diag fix > (1a/1b on your list) from inference of destructor attributes? > > Deferred diags fix is straightforward, but destructor attribute inference may > need a longer discussion. will separate the deferred di

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

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

[clang] Honor pragmas with -ffp-contract=fast, depecate fast-honor-pragmas (PR #105746)

2025-03-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: LGTM for HIP https://github.com/llvm/llvm-project/pull/105746 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [OffloadBundler] Expose function to parse compressed bundle headers (PR #130284)

2025-03-12 Thread Yaxun Liu via cfe-commits
@@ -1121,13 +1122,116 @@ CompressedOffloadBundle::compress(llvm::compression::Params P, llvm::StringRef(FinalBuffer.data(), FinalBuffer.size())); } +// Use packed structs to avoid padding, such that the structs map the serialized +// format. +LLVM_PACKED_START +union R

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

2025-02-13 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] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)

2025-02-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/111885 >From 2b90f311fef72514783d2d0840f76493c36a5d39 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] Add clang atomic control options and attribute (PR #114841)

2025-02-12 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] [CUDA] Increment VTable index for device thunks (PR #124989)

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

[clang] [NFC][Clang] Precommit test for VTable codegen (PR #124983)

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

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -350,13 +353,105 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_TextWithCRLF); - if (EC) { -Diags.Report(diag::err_fe_error_opening) << OutputFile

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -350,13 +353,105 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_TextWithCRLF); - if (EC) { -Diags.Report(diag::err_fe_error_opening) << OutputFile

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -350,13 +353,105 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_TextWithCRLF); - if (EC) { -Diags.Report(diag::err_fe_error_opening) << OutputFile

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -350,13 +353,105 @@ void DependencyFileGenerator::outputDependencyFile(DiagnosticsEngine &Diags) { } std::error_code EC; - llvm::raw_fd_ostream OS(OutputFile, EC, llvm::sys::fs::OF_TextWithCRLF); - if (EC) { -Diags.Report(diag::err_fe_error_opening) << OutputFile

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -1056,8 +1056,20 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, DepFile = getDependencyFileName(Args, Inputs); C.addFailureResultFile(DepFile, &JA); } - CmdArgs.push_back("-dependency-file"); - CmdArgs.push_back(D

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

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -313,6 +313,8 @@ EXTENSION(datasizeof, LangOpts.CPlusPlus) FEATURE(cxx_abi_relative_vtable, LangOpts.CPlusPlus && LangOpts.RelativeCXXABIVTables) +FEATURE(atomic_attributes, true) yxsamliu wrote: will change https://github.com/llvm/llvm-project/pull/114

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

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -5400,6 +5400,151 @@ third argument, can only occur at file scope. a = b[i] * c[i] + e; } +Extensions for controlling atomic code generation += + +The ``[[clang::atomic]]`` statement attribute enables users to control ho

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

2025-02-21 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

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

2025-02-22 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -4979,3 +4979,16 @@ def NoTrivialAutoVarInit: InheritableAttr { let Documentation = [NoTrivialAutoVarInitDocs]; let SimpleHandler = 1; } + +def Atomic : StmtAttr { + let Spellings = [Clang<"atomic">]; + let Args = [VariadicStringArgument<"Options">]; y

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -3101,6 +3101,11 @@ class Parser : public CodeCompletionHandler { std::optional ParseAvailabilitySpec(); ExprResult ParseAvailabilityCheckExpr(SourceLocation StartLoc); + void ParseAtomicAttribute(IdentifierInfo &AttrName, yxsamliu wrote: will use Var

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

2025-02-23 Thread Yaxun Liu via cfe-commits
@@ -1101,6 +1107,187 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -798,6 +798,8 @@ def MD : Flag<["-"], "MD">, Group, HelpText<"Write a depfile containing user and system headers">; def MMD : Flag<["-"], "MMD">, Group, HelpText<"Write a depfile containing user headers">; +def MMMD : Flag<["-"], "MMMD">, Group, yxsa

[clang] clang/HIP: Remove some unused ocml function declarations (PR #128022)

2025-02-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: what if some HIP apps use them? Should we add deprecated attribute to them then remove them in the next release? https://github.com/llvm/llvm-project/pull/128022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [Feature]: merge host and kernel dependencies for heterogeneous compilation (PR #119513)

2025-02-20 Thread Yaxun Liu via cfe-commits
@@ -1056,8 +1056,20 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, DepFile = getDependencyFileName(Args, Inputs); C.addFailureResultFile(DepFile, &JA); } - CmdArgs.push_back("-dependency-file"); - CmdArgs.push_back(D

[clang] [CUDA][HIP] fix virtual dtor host/device attr (PR #128926)

2025-02-26 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/128926 Currently if CUDA/HIP users use template class with virtual dtor and std::string data member with C++20 and MSVC. When the template class is explicitly instantiated, they encounter unresolved symbols in linker

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -625,6 +625,43 @@ static Attr *handleHLSLControlFlowHint(Sema &S, Stmt *St, const ParsedAttr &A, return ::new (S.Context) HLSLControlFlowHintAttr(S.Context, A); } +static Attr *handleAtomicAttr(Sema &S, Stmt *St, const ParsedAttr &A, + Source

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -1107,6 +1113,66 @@ inline void FPOptions::applyChanges(FPOptionsOverride FPO) { *this = FPO.applyOverrides(*this); } +// The three atomic code-generation options. +// The canonical (positive) names are: +// "remote_memory", "fine_grained_memory", and "ignore_denormal_

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

2025-02-26 Thread Yaxun Liu via cfe-commits
@@ -3286,6 +3286,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] Reland [HIP] fix host min/max in header (PR #133590)

2025-03-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/133590 >From 3f533ad3a54b199e96a14e91f01b9714c30f52c2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sun, 25 Feb 2024 11:13:40 -0500 Subject: [PATCH] [HIP] fix host min/max in header CUDA defines min/max func

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

2025-03-28 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/133456 Cmake automatically generates dependency files with all compilation options provided by users. When users use `--offload-compress` for HIP compilation, it causes warnings when cmake generates dependency files.

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

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

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

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

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

2025-03-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/133590 CUDA defines min/max functions for host in global namespace. HIP header needs to define them too to be compatible. Currently only min/max(int, int) is defined. This causes wrong result for arguments that are o

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

2025-03-29 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: This is an effort to reland https://github.com/llvm/llvm-project/pull/82956 Since we kept encountering regressions, we plan to add the change conditionally under a macro so that we can deliver the fix to intended users without causing regressions. Then we will try making the ch

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

2025-03-28 Thread Yaxun Liu via cfe-commits
@@ -1026,6 +1026,12 @@ void Clang::AddPreprocessingOptions(Compilation &C, const JobAction &JA, CmdArgs.push_back("-dependency-file"); CmdArgs.push_back(DepFile); } +// Cmake generates dependency files using all compilation options specified +// by user

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

2025-03-28 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/132869 >From 205999ed91d9ed65dcfb73377f853ae7e35a7bda 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] Claim `--offload-compress` for `-M` (PR #133456)

2025-04-02 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/133456 >From be4ea80f2431bff0c017df3aef9f260dddfa9ccc Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 28 Mar 2025 11:30:39 -0400 Subject: [PATCH] [HIP] Claim --offloading-compress for -M Cmake automatical

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-04-02 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,64 @@ +// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --check-globals all --version 5 +// RUN: %clang_cc1 -triple amdgcn-amd-amdhsa -target-cpu gfx900 -emit-llvm %s -o - | FileCheck --check-prefix=AMDGCN-GFX900 %s +// RUN: %cla

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

2025-04-03 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu closed https://github.com/llvm/llvm-project/pull/133456 ___ 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-03 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM. Thanks https://github.com/llvm/llvm-project/pull/115821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-04-02 Thread Yaxun Liu via cfe-commits
@@ -4920,6 +4920,116 @@ If no address spaces names are provided, all address spaces are fenced. __builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup", "local") __builtin_amdgcn_fence(__ATOMIC_SEQ_CST, "workgroup", "local", "global") +__builtin_amdgcn_processor_is and __bui

[clang] [WIP][Clang] Allow floating point fixed vectors with atomic builtins (PR #129495)

2025-04-03 Thread Yaxun Liu via cfe-commits
@@ -2312,6 +2312,17 @@ bool Type::isRealType() const { return isBitIntType(); } +bool Type::isFPAtomicCompatibleType() const { yxsamliu wrote: LGTM. It does not depend on other factors. https://github.com/llvm/llvm-project/pull/129495 _

[clang] [llvm] [AMDGPU][clang][CodeGen][opt] Add late-resolved feature identifying predicates (PR #134016)

2025-04-02 Thread Yaxun Liu via cfe-commits
@@ -585,6 +597,23 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, llvm::Value *Env = EmitScalarExpr(E->getArg(0)); return Builder.CreateCall(F, {Env}); } + case AMDGPU::BI__builtin_amdgcn_processor_is: { +assert(CGM.getTriple().isSPIRV() &&

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

2025-04-04 Thread Yaxun Liu via cfe-commits
@@ -242,3 +242,9 @@ // NO-WARN-ATOMIC: clang{{.*}} "-triple" "amdgcn-amd-amdhsa" {{.*}} "-Werror=atomic-alignment" {{.*}} "-Wno-error=atomic-alignment" // NO-WARN-ATOMIC-NOT: clang{{.*}} "-triple" "x86_64-unknown-linux-gnu" {{.*}} "-Werror=atomic-alignment" // NO-WARN-ATOMIC-

[clang] [HIP] fix bundle ID for amdgcnspirv (PR #139112)

2025-05-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/139112 Currently ROCm 6.4.0 only recognize spirv64-amd-amdhsa- in bundle ID. spirv64-amd-amdhsa-unknown causes all HIP apps compiled for amdgcnspirv to fail. Previously we fixed a similar issue for amdgcn-amd-amdhsa-

[clang] clang: Remove dest LangAS argument from performAddrSpaceCast (PR #138866)

2025-05-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I don't think this PR should be merged. Since John is the code owner of clang codegen. https://github.com/llvm/llvm-project/pull/138866 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/list

<    11   12   13   14   15   16   17   >