[clang] [llvm] [AMDGPU] Refactor insertWaveSizeFeature (PR #154850)

2025-08-25 Thread Yaxun Liu via cfe-commits
@@ -197,7 +197,7 @@ bool AMDGPUTargetInfo::initFeatureMap( const std::vector &FeatureVec) const { using namespace llvm::AMDGPU; - fillAMDGPUFeatureMap(CPU, getTriple(), Features); + yxsamliu wrote: I am a bit concerned moving fillAMDGPUFeatureMap from

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-25 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 926ac906473352823e12059322abc6d963890324 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sat, 23 Aug 2025 14:55:50 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-23 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 926ac906473352823e12059322abc6d963890324 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sat, 23 Aug 2025 14:55:50 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-23 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 1b3f03dfcb03975dc75fb56d929538826716fa06 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sat, 23 Aug 2025 14:55:50 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

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

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-23 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From ed45edfdf6b027e9d2fa873e2242e4f3ff60157c Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sat, 23 Aug 2025 14:55:50 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-23 Thread Yaxun Liu via cfe-commits
@@ -61,3 +61,111 @@ Predefined Macros - Defined if FP64 instruction is available (deprecated). Please note that the specific architecture and feature names will vary depending on the GPU. Also, some macros are deprecated and may be removed in future releases. + +AMDGPU

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-23 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Add some tests with complex and pointers? will do https://github.com/llvm/llvm-project/pull/153501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-21 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 8fef1b8dd9d91513c705c460e868ac5507eb4aea Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 13 Aug 2025 09:18:36 -0400 Subject: [PATCH 1/7] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument

[clang] [Driver][Gnu] Auto-link libstdc++fs for GCC versions in [5.3, 9.2) (PR #154826)

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

[clang] [Driver][Gnu] Auto-link libstdc++fs for GCC versions in [5.3, 9.2) (PR #154826)

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

[clang] [Driver][Gnu] Auto-link libstdc++fs for GCC < 9.2 (PR #154826)

2025-08-21 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/154826 >From 7e93842c711d077e187a54bdc6ca7565fc1eaff9 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 21 Aug 2025 15:12:43 -0400 Subject: [PATCH] [Driver][Gnu] Auto-link libstdc++fs for GCC versions in [5.

[clang] [Driver][Gnu] Auto-link libstdc++fs for GCC < 9.2 (PR #154826)

2025-08-21 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > What about an even older GCC where std::filesystem didn't exist? The oldest GCC that has -libstdc++fs is 5.3 (https://godbolt.org/z/sroE5zvE7). I can put another boundary on it there. https://github.com/llvm/llvm-project/pull/154826 ___

[clang] [llvm] [Driver][HIP][HIPSTDPAR][Windows] Link the HIP RT even when `-nostdlib` (PR #154630)

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

[clang] [llvm] [AMDGPU] Error out in clang if wavefront64 is used on gfx1250 (PR #153693)

2025-08-19 Thread Yaxun Liu via cfe-commits
@@ -774,6 +774,18 @@ static bool isWave32Capable(StringRef GPU, const Triple &T) { return IsWave32Capable; } +static bool isWave64Capable(StringRef GPU, const Triple &T) { + if (T.isAMDGCN()) { yxsamliu wrote: I agree with Matt. We already have fillAMDGPU

[clang] [llvm] [LLVM] Introduce 'llvm-offload-wrapper' tool (PR #153504)

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

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 8fef1b8dd9d91513c705c460e868ac5507eb4aea Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 13 Aug 2025 09:18:36 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
@@ -159,6 +159,119 @@ Value *EmitAMDGPUGridSize(CodeGenFunction &CGF, unsigned Index) { llvm::MDNode::get(CGF.getLLVMContext(), {})); return LD; } +// Lowers __builtin_amdgcn_ds_bpermute to the corresponding LLVM intrinsic with +// careful bit-level coercio

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
@@ -18,6 +18,132 @@ #include "llvm/Support/AtomicOrdering.h" #include +namespace { + +using llvm::StringRef; +using namespace clang; + +/// Attempts to apply a user-defined conversion on Arg at ArgIndex to a +/// 32-bit-compatible type. If successful, updates TheCall's argume

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
@@ -159,6 +159,119 @@ Value *EmitAMDGPUGridSize(CodeGenFunction &CGF, unsigned Index) { llvm::MDNode::get(CGF.getLLVMContext(), {})); return LD; } +// Lowers __builtin_amdgcn_ds_bpermute to the corresponding LLVM intrinsic with +// careful bit-level coercio

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/153501 >From 6619a7102e0c36d005487062cfd9a9071bad3c34 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 13 Aug 2025 09:18:36 -0400 Subject: [PATCH] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types

[clang] [llvm] [AMDGPU] Extend __builtin_amdgcn_ds_bpermute argument types (PR #153501)

2025-08-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/153501 This patch enhances the __builtin_amdgcn_ds_bpermute builtin to support a wider variety of argument types, improving its usability and flexibility. Previously, the builtin was restricted to int(int, int), forc

[clang] [HIP][SPIRV] Implicit `new`/`delete` should be `cdecl` on host (PR #152023)

2025-08-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM for now. If we encounter similar situation in future may consider a more generic approach. https://github.com/llvm/llvm-project/pull/152023 ___ cfe-commits mailing list cfe-commits@lists.llv

[clang] [HIP] compressed bundle format defaults to v3 (PR #152600)

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

[clang] [HIP] compressed bundle format defaults to v3 (PR #152600)

2025-08-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Random question, what would compression look like for the offload binaries? > I'm wondering how difficult it would be to switch HIP to using those instead > of the bundles for its binary format. There has been efforts to compress arbitrary ELF sections (https://maskray.me/bl

[clang] [HIP] compressed bundle format defaults to v3 (PR #152600)

2025-08-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/152600 HIP runtime support for compressed bundle format v3 is in place, therefore switch the default compressed bundle format to v3 in compiler. This allows both compressed and decompressed fat binary size to exceed

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-08-05 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping. any further comments or concerns? thanks https://github.com/llvm/llvm-project/pull/145131 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] AMDGPU: Allow readonly features to be written to IR when there is no target (PR #148141)

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

[clang] HIPSPV: Unbundle SDL (PR #136412)

2025-07-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @svenvh @yxsamliu > > ping sorry for the delay. could you please rebase your branch? It is out of date. thanks https://github.com/llvm/llvm-project/pull/136412 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.l

[clang] [HIP][Clang][Driver] Move BC preference logic into ROCm detection (PR #149294)

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

[clang] [HIP][Clang][Driver] Move BC preference logic into ROCm detection (PR #149294)

2025-07-19 Thread Yaxun Liu via cfe-commits
@@ -77,6 +79,82 @@ class RocmInstallationDetector { SPACKReleaseStr(SPACKReleaseStr.str()) {} }; + struct CommonBitcodeLibsPreferences { +CommonBitcodeLibsPreferences(const Driver &D, + const llvm::opt::ArgList &DriverArgs, +

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/145131 >From 36843916f3bc97b5f7d167222e41a9d4ddd5bf0f Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 17 Jun 2025 17:01:07 -0400 Subject: [PATCH] [Clang][Driver] Add jobserver support for --offload-jobs T

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,257 @@ +//===- llvm/Support/Jobserver.cpp - Jobserver Client Implementation ---===// +// +// 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,257 @@ +//===- llvm/Support/Jobserver.cpp - Jobserver Client Implementation ---===// +// +// 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,257 @@ +//===- llvm/Support/Jobserver.cpp - Jobserver Client Implementation ---===// +// +// 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,257 @@ +//===- llvm/Support/Jobserver.cpp - Jobserver Client Implementation ---===// +// +// 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,257 @@ +//===- llvm/Support/Jobserver.cpp - Jobserver Client Implementation ---===// +// +// 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,141 @@ +//===- llvm/Support/Jobserver.h - Jobserver Client --*- 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-18 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,141 @@ +//===- llvm/Support/Jobserver.h - Jobserver Client --*- 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-17 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,141 @@ +//===- llvm/Support/Jobserver.h - Jobserver Client --*- 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-17 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,141 @@ +//===- llvm/Support/Jobserver.h - Jobserver Client --*- 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: Ap

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-17 Thread Yaxun Liu via cfe-commits
@@ -1420,12 +1420,18 @@ int main(int Argc, char **Argv) { parallel::strategy = hardware_concurrency(1); if (auto *Arg = Args.getLastArg(OPT_wrapper_jobs)) { -unsigned Threads = 0; -if (!llvm::to_integer(Arg->getValue(), Threads) || Threads == 0) - reportError(

[clang] [HIP] Add warning for -mwavefrontsize64 on gfx10+ architectures (PR #140185)

2025-07-17 Thread Yaxun Liu via cfe-commits
@@ -67,6 +67,12 @@ // DUP-NOT: "-target-feature" "{{.*}}wavefrontsize64" // DUP: {{.*}}lld{{.*}} "-plugin-opt=-mattr=+cumode" +// RUN: %clang -### --target=x86_64-linux-gnu -fgpu-rdc -nogpulib \ +// RUN: -nogpuinc --offload-arch=gfx1010 --no-offload-new-driver %s \ +// RUN:

[clang] AMDGPU: Remove "gws" from the “read-only” target feature list (PR #148141)

2025-07-14 Thread Yaxun Liu via cfe-commits
@@ -816,12 +816,12 @@ kernel void test_target_features_kernel(global int *i) { // NOCPU: attributes #[[ATTR10]] = { convergent nounwind } //. // GFX900: attributes #[[ATTR0:[0-9]+]] = { "objc_arc_inert" } -// GFX900: attributes #[[ATTR1]] = { convergent norecurse nounwind "den

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

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

[clang] [HIP] Add warning for -mwavefrontsize64 on gfx10+ architectures (PR #140185)

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

[clang] [Clang] Respect MS layout attributes during CUDA/HIP device compilation (PR #146620)

2025-07-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > This broke the LLDB CI: > > ``` > > 13:02:41 > > /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:834:59: > > error: too few arguments to function call, expected 3, have 2 > > 13:02:41

[clang] [Clang] Respect MS layout attributes during CUDA/HIP device compilation (PR #146620)

2025-07-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > This broke the LLDB CI: > > ``` > 13:02:41 > /Users/ec2-user/jenkins/workspace/llvm.org/as-lldb-cmake/llvm-project/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp:834:59: > error: too few arguments to function call, expected 3, have 2 > 13:02:41

[clang] [Clang] Respect MS layout attributes during CUDA/HIP device compilation (PR #146620)

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

[clang] [HIP] Add warning for -mwavefrontsize64 on gfx10+ architectures (PR #140185)

2025-07-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I removed the new option and changed the error into a warning. Clang will only emit a warning about wave64 for gfx10+. I will ask HIP runtime to add an option -Werror=unsupported-wave64 in cmake config files since HIP runtime does not support wave64 on gfx10+. https://github.c

[clang] [HIP] Add warning for -mwavefrontsize64 on gfx10+ architectures (PR #140185)

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

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

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

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

2025-07-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/140185 >From 1d8a6ceb3eb3f9e899efde6bf6e86d23dfdfc430 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 16 May 2025 00:04:12 -0400 Subject: [PATCH] [HIP] Add warning for -mwavefrontsize64 on gfx10+ architec

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-06 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/145131 >From 0492b8d9db17c8a59390938033b6d6c8d12946e1 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 17 Jun 2025 17:01:07 -0400 Subject: [PATCH] [Clang][Driver] Add jobserver support for --offload-jobs T

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-05 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/145131 >From de90c70113945cbbe0f0ea6bd4c9f977ad500262 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 17 Jun 2025 17:01:07 -0400 Subject: [PATCH] [Clang][Driver] Add jobserver support for --offload-jobs T

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-05 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/145131 >From 2e891be4a591acbea3214453a423e98eb70b42ad Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 17 Jun 2025 17:01:07 -0400 Subject: [PATCH] [Clang][Driver] Add jobserver support for --offload-jobs T

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-04 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/145131 >From 5b5953d2df2bf2aae652625d2a566bc923a8dbfe Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 17 Jun 2025 17:01:07 -0400 Subject: [PATCH] [Clang][Driver] Add jobserver support for --offload-jobs T

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-04 Thread Yaxun Liu via cfe-commits
@@ -133,6 +140,85 @@ void StdThreadPool::processTasks(ThreadPoolTaskGroup *WaitingForGroup) { } } +/// Main loop for worker threads when using a jobserver. +/// This function uses a two-level queue; it first acquires a job slot from the +/// external jobserver, then retriev

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-04 Thread Yaxun Liu via cfe-commits
@@ -79,7 +86,7 @@ void StdThreadPool::processTasks(ThreadPoolTaskGroup *WaitingForGroup) { // Yeah, we have a task, grab it and release the lock on the queue // We first need to signal that we are active before popping the queue - // in order for wait() to pr

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-04 Thread Yaxun Liu via cfe-commits
@@ -133,6 +140,85 @@ void StdThreadPool::processTasks(ThreadPoolTaskGroup *WaitingForGroup) { } } +/// Main loop for worker threads when using a jobserver. +/// This function uses a two-level queue; it first acquires a job slot from the +/// external jobserver, then retriev

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-07-04 Thread Yaxun Liu via cfe-commits
@@ -119,7 +130,25 @@ class ThreadPoolExecutor : public Executor { auto Task = std::move(WorkStack.back()); WorkStack.pop_back(); Lock.unlock(); - Task(); + + if (TheJobserver) { +JobSlot Slot = TheJobserver->tryAcquire(); +if (Slot.is

[clang] [Clang][OpenCL] Declare cl_amd_media_ops/cl_amd_media_ops2 builtins with -fdeclare-opencl-builtins (PR #143507)

2025-07-02 Thread Yaxun Liu via cfe-commits
Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= , Juan Manuel Martinez =?utf-8?q?Caama=C3=B1o?= Message-ID: In-Reply-To: https://github.com/yxsamliu appr

[clang] [Clang] Properly use `CommaJoined` for `--offload-arch` (PR #146687)

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

[clang] HIPSPV: Unbundle SDL (PR #136412)

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

[clang] [WIP][AMDGPU] Support for type inferring image load/store builtins for AMDGPU (PR #140210)

2025-06-30 Thread Yaxun Liu via cfe-commits
@@ -635,5 +635,66 @@ TARGET_BUILTIN(__builtin_amdgcn_bitop3_b16, "IUi", "nc", "bitop3-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_bf16_f32, "V2yV2yfUiIb", "nc", "f32-to-f16bf16-cvt-sr-insts") TARGET_BUILTIN(__builtin_amdgcn_cvt_sr_f16_f32, "V2hV2hfUiIb", "nc", "f32-to-

[clang] [llvm] [LLVM] Add GNU make jobserver support (PR #145131)

2025-06-23 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: opened RFC ant LLVM discourse: https://discourse.llvm.org/t/rfc-adding-gnu-make-jobserver-support-to-llvm-for-coordinated-parallelism/87034 https://github.com/llvm/llvm-project/pull/145131 ___ cfe-commits mailing list cfe-commits@lists

[clang] [CUDA][HIP] add options `--[no-]offload-inc` (PR #140106)

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

[clang] [llvm] [Clang][Driver] Add jobserver support for --offload-jobs (PR #145131)

2025-06-20 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/145131 This patch introduces support for the jobserver protocol to control parallelism for device offloading tasks. When running a parallel build with a modern build system like `make -jN` or `ninja -jN`, each Clang

[clang] [HIP] Remove dots in HIP runtime path (PR #143792)

2025-06-19 Thread Yaxun Liu via cfe-commits
@@ -743,9 +743,11 @@ void Linux::AddHIPRuntimeLibArgs(const ArgList &Args, Args.MakeArgString(StringRef("-L") + RocmInstallation->getLibPath())); if (Args.hasFlag(options::OPT_frtlib_add_rpath, - options::OPT_fno_rtlib_add_rpath, false)) -CmdArgs.

[clang] [HIP] Remove dots in HIP runtime path (PR #143792)

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

[clang] [HIP] Remove dots in HIP runtime path (PR #143792)

2025-06-18 Thread Yaxun Liu via cfe-commits
@@ -743,9 +743,12 @@ void Linux::AddHIPRuntimeLibArgs(const ArgList &Args, Args.MakeArgString(StringRef("-L") + RocmInstallation->getLibPath())); if (Args.hasFlag(options::OPT_frtlib_add_rpath, - options::OPT_fno_rtlib_add_rpath, false)) +

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

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

[clang] 7232c07 - Reland [HIP] use offload wrapper for non-device-only non-rdc (#143964)

2025-06-12 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2025-06-12T21:41:41-04:00 New Revision: 7232c07eb97d5c21d47a661c9cca8981c7f91698 URL: https://github.com/llvm/llvm-project/commit/7232c07eb97d5c21d47a661c9cca8981c7f91698 DIFF: https://github.com/llvm/llvm-project/commit/7232c07eb97d5c21d47a661c9cca8981c7f91698.dif

[clang] 8890706 - Revert "Reland [HIP] use offload wrapper for non-device-only non-rdc (#132869) (#143964)"

2025-06-12 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2025-06-12T21:33:05-04:00 New Revision: 8890706db67384a423773cc921302dd63d950ef5 URL: https://github.com/llvm/llvm-project/commit/8890706db67384a423773cc921302dd63d950ef5 DIFF: https://github.com/llvm/llvm-project/commit/8890706db67384a423773cc921302dd63d950ef5.dif

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

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

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

2025-06-12 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/143964 >From ff3a9dd0765e499573d8d0049aca1d4568ac586f Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 11 Jun 2025 14:02:59 -0400 Subject: [PATCH 1/3] Revert "Revert "[HIP] use offload wrapper for non-devi

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

2025-06-12 Thread Yaxun Liu via cfe-commits
@@ -9249,8 +9249,20 @@ 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->getEx

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

2025-06-12 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/143964 >From 5f3cc287ff2c3c84ba840ebaa0931773341a02b2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 11 Jun 2025 14:02:59 -0400 Subject: [PATCH 1/3] Revert "Revert "[HIP] use offload wrapper for non-devi

[clang] [llvm] [mlir] [NFC][AMDGPU] Fix stale links to ROCm repositories (PR #143949)

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

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

2025-06-12 Thread Yaxun Liu via cfe-commits
@@ -310,8 +310,8 @@ Error relocateOffloadSection(const ArgList &Args, StringRef Output) { // Remove the old .llvm.offloading section to prevent further linking. ObjcopyArgs.emplace_back("--remove-section"); ObjcopyArgs.emplace_back(".llvm.offloading"); - for (StringRef

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

2025-06-12 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I split it into 3 commits for ease of reviewing: the original change and the two fixes. https://github.com/llvm/llvm-project/pull/143964 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/lis

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

2025-06-12 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/143964 Fixed two issues: 1. assertion with -flto. the linker wrapper action is missing for wrapping the device binary. Added it for -flto. 2. when there are two HIP files, the kernels in the second file were not fo

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

2025-06-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. thanks. I will take a look https://github.com/llvm/llvm-project/pull/143432 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA] Disallow use of address_space(N) on CUDA device variables. (PR #142857)

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

[clang] [AMDGPU] fix amdgpu_max_num_work_groups in templates (PR #141633)

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

[clang] [AMDGPU] fix amdgpu_max_num_work_groups in templates (PR #141633)

2025-05-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/141633 >From e8692fee660df71b8a7f277d1c85b925a2d678f1 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 27 May 2025 13:03:32 -0400 Subject: [PATCH] [AMDGPU] fix amdgpu_max_num_work_groups in templates Clang

[clang] [HIP] disable sanitizer for `__hip_cuid` (PR #141581)

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

[clang] [AMDGPU] fix amdgpu_max_num_work_groups in templates (PR #141633)

2025-05-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/141633 Clang does not instantiate amdgpu_max_num_work_groups attribute with one template argument, causing assertion codegen. Fixes: https://github.com/llvm/llvm-project/issues/139570 >From f4849e095e750195d072484cb

[clang] [HIP] disable sanitizer for `__hip_cuid` (PR #141581)

2025-05-27 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/141581 Global variable `__hip_cuid_*` is for identifying purpose and does not need sanitization, therefore disable it for sanitizers. >From 503ee3dd5144b4cc2dd83488b2194900605217fd Mon Sep 17 00:00:00 2001 From: "Yax

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

2025-05-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > I am not ok with this being an error by default. > > > > > > I think compilation must fail when an unsupported and untested option is > > specified. And that includes when the target is SPIR-V. > > I would call it a supported and used option. The unsupported and untested

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

2025-05-16 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > I don't think we should be introducing an additional option that behaves > > > identically to another option just differing by a warning. This also > > > isn't really a problem with the language, but the library support. The > > > actual codegen should work just fine. Is

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

2025-05-16 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I don't think we should be introducing an additional option that behaves > identically to another option just differing by a warning. This also isn't > really a problem with the language, but the library support. The actual > codegen should work just fine. Is there some other

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

2025-05-16 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] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-16 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Being able to override a flag is a good thing to have, IMO. There are builds > where the owner of the leaf targets do not have much control over which > options are set by the "default" compilation, so they need to rely on being > able to override preceding options. > > The

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-16 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I thought we already added a generic -stdinc/nostdinc for this there is only -nostdinc but there is no -stdinc https://github.com/llvm/llvm-project/pull/140106 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[clang] [HIP] diagnose -mwavefrontsize64 for gfx10+ (PR #140185)

2025-05-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/140185 wavefront size 64 is not fully supported for HIP on gfx10+ and it is not tested. As such, currently HIP header contains an pragma error to diagnose such use case by detecting predefined macro `__AMDGCN_WAVEFRO

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > but there is other comgr user expecting comgr to have -nogpuinc by default. > > changing that will cause regressions. > > If `comgr` can have custom flags then you could just pass the 'do not pass > `-nogpuinc` by default' flag presumably. As I said, I think this is just o

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > Hmm, in what cases is `-nogpuinc` added when we don't actually want it? I > > > think we should avoid adding `-nogpuinc` if it's not needed, if possible. > > > > > > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by default. > > However, some users of co

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by default. > > However, some users of comgr need to override that so that comgr enables > > the wrapper headers. We cannot simply let comgr stop using -nogpuinc by > > default since it will break existing comg

[clang] [CUDA][HIP] add option -gpuinc (PR #140106)

2025-05-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > > > Hmm, in what cases is `-nogpuinc` added when we don't actually want > > > > > it? I think we should avoid adding `-nogpuinc` if it's not needed, if > > > > > possible. > > > > > > > > > > > > comgr is the JIT compiler for HIP on ROCm. comgr uses -nogpuinc by > > > >

  1   2   3   4   5   6   7   8   9   10   >