[clang] [CUDA][HIP] Exclude external variables from constant promotion. (PR #73549)

2023-12-07 Thread Yaxun Liu via cfe-commits
@@ -104,3 +106,14 @@ void fun() { (void) b; (void) var_host_only; } + +extern __global__ void external_func(); +extern void* const external_dep[] = { yxsamliu wrote: It seems nvcc allows non-array type const var to be used in device code but not array typ

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2023-12-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/74737 Add a function attribute "amdgpu-lib-fun" to indicate that the function needs special handling in backend. Basically it will not be internalized so that it will not be removed by DCE after internalization. This

[llvm] [clang] [CUDA][HIP] Improve variable registration with the new driver (PR #73177)

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

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2023-12-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/74737 >From b4a30a6c89e59f11368fb71040539d24cacccbfc Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 7 Dec 2023 11:45:14 -0500 Subject: [PATCH] [AMDGPU] add function attrbute amdgpu-lib-fun Add a function

[clang] [compiler-rt] [llvm] [HIP] support 128 bit int division (PR #71978)

2023-12-07 Thread Yaxun Liu via cfe-commits
@@ -3630,10 +3631,17 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI, std::vector Ops; Ops.push_back(Chain); + bool AddTargetGlobalAddr = true; + // Try to find the callee in the current module. + if (isa(Callee)) { +Callee = DAG.getSymbolFunctionGloba

[compiler-rt] [clang] [HIP] support 128 bit int division (PR #71978)

2023-12-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/71978 >From f2a6e4e2bb2554d55243385ddbae9cceebd081c9 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 7 Dec 2023 17:10:23 -0500 Subject: [PATCH] [HIP] support 128 bit int division Currently nvcc supports 1

[compiler-rt] [clang] [HIP] support 128 bit int division (PR #71978)

2023-12-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Would it be feasible to consider switching to the new offloading driver mode > and really link with the library instead? It may be a conveniently isolated > use case with little/no existing users that would disrupt. It is needed by an important HIP app for which the new drive

[compiler-rt] [clang] [HIP] support 128 bit int division (PR #71978)

2023-12-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > Would it be feasible to consider switching to the new offloading driver > > mode and really link with the library instead? It may be a conveniently > > isolated use case with little/no existing users that would disrupt. > > I've thought a reasonable amount about a `compiler

[clang] Fix tests clang-offload-bundler-zlib/zstd.c (PR #74504)

2023-12-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > I got this fail just now after doing a pull. > > ``` > FAIL: Clang :: Driver/hip-offload-compress-zstd.hip (477 of 1078) > TEST 'Clang :: Driver/hip-offload-compress-zstd.hip' > FAILED > Exit Code: 1 > > Command Output (stderr): > --

[clang] Fix tests hip-offload-compress-zlib/zstd.hip (PR #74783)

2023-12-07 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/74783 Use %t in output file name as %T is non-unique. >From d95bc5d805a5ee267959ee342bc40b02c5fa4c22 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 7 Dec 2023 18:25:33 -0500 Subject: [PATCH] Fix tests hi

[clang] Fix tests clang-offload-bundler-zlib/zstd.c (PR #74504)

2023-12-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: fix another two tests by https://github.com/llvm/llvm-project/pull/74783 https://github.com/llvm/llvm-project/pull/74504 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [driver] Respect the mode the driver is in for autocomplete (PR #74770)

2023-12-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: It seems reasonable. You may consider adding test to clang/test/Driver/autocomplete.c https://github.com/llvm/llvm-project/pull/74770 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listin

[clang] Fix tests hip-offload-compress-zlib/zstd.hip (PR #74783)

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

[clang] Fix tests hip-offload-compress-zlib/zstd.hip (PR #74783)

2023-12-08 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > %T is deprecated in lit. You may want to migrate other `%T` related to AMDGPU. Thanks. I will try cleaning them up. https://github.com/llvm/llvm-project/pull/74783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists

[clang] Fix test rocm-detect.hip (PR #74872)

2023-12-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/74872 Replace %T with %t since %T is deprecated. >From 91160285c17ef9ba2b35e6e8c4a8eb433ec5ad8a Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 8 Dec 2023 12:24:19 -0500 Subject: [PATCH] Fix test rocm-det

[clang] Fix test rocm-detect.hip (PR #74872)

2023-12-08 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: It seems that is the only HIP test that still uses %T. https://github.com/llvm/llvm-project/pull/74872 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] Fix test rocm-detect.hip (PR #74872)

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

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/72394 Make trivial ctor/dtor implicitly host device functions so that they can be used to initialize file-scope device variables to match nvcc behavior. Fixes: https://github.com/llvm/llvm-project/issues/72261 Fixes

[clang] [Clang] Introduce scoped variants of GNU atomic functions (PR #72280)

2023-11-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: Overall I think it is the right way to go. Memory scope has been used by different offloading languages and the atomic clang builtins are essentially the same. Adding a generic clang atomic builtins with memory scope allows code sharing among offloading languages. https://gith

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
@@ -772,6 +772,26 @@ void Sema::maybeAddCUDAHostDeviceAttrs(FunctionDecl *NewD, NewD->addAttr(CUDADeviceAttr::CreateImplicit(Context)); } +// If a trivial ctor/dtor has no host/device +// attributes, make it implicitly host device function. +void Sema::maybeAddCUDAHostDevice

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
@@ -12,7 +12,7 @@ extern "C" void host_fn() {} struct Dummy {}; struct S { - S() {} + S() { x = 1; } yxsamliu wrote: will do https://github.com/llvm/llvm-project/pull/72394 ___ cfe-commits mailing list cfe-commit

[clang] [CUDA][HIP] Fix deduction guide (PR #69366)

2023-11-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > @ldionne - Can you take a look if that would have unintended consequences > > for libc++? > > Honestly, I don't know. I don't know CUDA nearly well enough to understand > all the implications here. All I know is that this seems to be a pretty > significant "fork" of C++ in

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/72394 >From 0efce26340ce058cd2477f5dccbb6ab35cb1c2a0 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Tue, 14 Nov 2023 22:08:45 -0500 Subject: [PATCH] [CUDA][HIP] make trivial ctor/dtor host device Make trivial

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

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

[llvm] [clang] [LinkerWrapper] Support device binaries in multiple link jobs (PR #72442)

2023-11-16 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: the error msg is not generated by offload wrapper itself, right? is it from some program called by the offload wrapper? https://github.com/llvm/llvm-project/pull/72442 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[clang] [HIP] fix stack marking for -fgpu-rdc (PR #72782)

2023-11-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/72782 HIP toolchain uses llvm-mc to generate a host object embedding device binary for -fgpu-rdc. Due to lack of .note.GNU-stack section, the generated relocatable has executable stack marking, which disables protect

[clang] [HIP] fix stack marking for -fgpu-rdc (PR #72782)

2023-11-18 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/72782 >From b49127f7787b3f5943a879c0f30e26f0f3ac7ab6 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 17 Nov 2023 18:35:36 -0500 Subject: [PATCH] [HIP] fix stack marking for -fgpu-rdc HIP toolchain uses ll

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-19 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > We've found a problem with the patch. https://godbolt.org/z/jcKo34vzG > > ``` > template > class C { > explicit C() {}; > }; > > template <> C::C() {}; > ``` > > ``` > :6:21: error: __host__ function 'C' cannot overload __host__ > __device__ function 'C' > 6 | templ

[clang] [CUDA][HIP] ignore implicit host/device attr for override (PR #72815)

2023-11-19 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/72815 When deciding whether a previous function declaration is an overload or override, implicit host/device attrs should not be considered. This fixes the failure for the following code: `template class C { ex

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-19 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > We've found a problem with the patch. https://godbolt.org/z/jcKo34vzG > > ``` > > template > > class C { > > explicit C() {}; > > }; > > > > template <> C::C() {}; > > ``` > > > > > > > > > > > > > > > > > > > > > > > > ``` > > :6

[clang] [CUDA][HIP] ignore implicit host/device attr for override (PR #72815)

2023-11-19 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/72815 >From 27f1873abd9707107c714eb3432b31ffa56235e3 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sun, 19 Nov 2023 19:34:35 -0500 Subject: [PATCH] [CUDA][HIP] ignore implicit host/device attr for override W

[clang] [CUDA][HIP] ignore implicit host/device attr for override (PR #72815)

2023-11-20 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/72815 >From 1f48a0eb04df6ccc2d8117ebd6b68cc45484a0f3 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Sun, 19 Nov 2023 19:34:35 -0500 Subject: [PATCH] [CUDA][HIP] ignore implicit host/device attr for override W

[clang] [CUDA][HIP] ignore implicit host/device attr for override (PR #72815)

2023-11-20 Thread Yaxun Liu via cfe-commits
@@ -1000,13 +1000,9 @@ void Sema::checkCUDATargetOverload(FunctionDecl *NewFD, // should have the same implementation on both sides. if (NewTarget != OldTarget && ((NewTarget == CFT_HostDevice && - !(LangOpts.OffloadImplicitHostDeviceTemplates && -

[clang] [Clang] Introduce scoped variants of GNU atomic functions (PR #72280)

2023-11-20 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > The underlying implementation is a string literal in the LLVM syncscope > > > argument, but the problem is that this isn't standardized at all and > > > varies between backends potentially > > > > > > We don't have to use the same set of strings as syncscope if that does

[clang] [CUDA][HIP] ignore implicit host/device attr for override (PR #72815)

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

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-21 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: Thanks for reporting. A reduced testcase is https://godbolt.org/z/MY84az9xh `template struct ptr { ~ptr() { static int x = 1;} }; template struct Abc : ptr { public: Abc(); ~Abc() {} }; template class Abc; ` clang thinks Abc::~Abc() is trivial but it is not. It cou

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-21 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @yxsamliu What's the plan here? This issue is blocking us. If there is no > obvious fix very soon, we need to revert this. I will fix it. https://github.com/llvm/llvm-project/pull/72394 ___ cfe-commits mailing list cfe-commits@lists

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

2023-11-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/73140 Treat ctor/dtor in device var init as host device function so that they can be used to initialize file-scope device variables to match nvcc behavior. If they are non-trivial they will be diagnosed. We cannot add

[clang] [CUDA][HIP] make trivial ctor/dtor host device (PR #72394)

2023-11-22 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @yxsamliu What's the plan here? This issue is blocking us. If there is no > obvious fix very soon, we need to revert this. fix by https://github.com/llvm/llvm-project/pull/73140 https://github.com/llvm/llvm-project/pull/72394 ___ cf

[clang] [llvm] [mlir] [lld] [AMDGPU] Change default AMDHSA Code Object version to 5 (PR #73000)

2023-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/73000 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

2023-11-22 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Could you first land the two reverts > ([511cecf](https://github.com/llvm/llvm-project/commit/511cecff7f76958ebfe713189bc106615763b64a) > and > [e9a8e90](https://github.com/llvm/llvm-project/commit/e9a8e906d4c14eb4b317a7420b9bba3dc7321ba2)) > and then have the third commit p

[clang] 22078bd - Revert "[CUDA][HIP] ignore implicit host/device attr for override (#72815)"

2023-11-22 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:04:55-05:00 New Revision: 22078bd9f6842411aac2b75196975d68a817a358 URL: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358 DIFF: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358.dif

[clang] 6b3470b - Revert "[CUDA][HIP] make trivial ctor/dtor host device (#72394)"

2023-11-22 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:20:53-05:00 New Revision: 6b3470b4b83195aeeda60b101e8d3bf8800c321c URL: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c DIFF: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c.dif

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

2023-11-22 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/73140 >From 2dc8bda89483ee655e7a76deac19b8ea9e463c7b Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed, 22 Nov 2023 10:02:59 -0500 Subject: [PATCH] [CUDA][HIP] allow trivial ctor/dtor in device var init Trea

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

2023-11-22 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Could you first land the two reverts > ([511cecf](https://github.com/llvm/llvm-project/commit/511cecff7f76958ebfe713189bc106615763b64a) > and > [e9a8e90](https://github.com/llvm/llvm-project/commit/e9a8e906d4c14eb4b317a7420b9bba3dc7321ba2)) > and then have the third commit p

[clang] [CUDA][HIP] Fix std::is_invocable (PR #70369)

2023-10-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/70369 >From 5097f2075bc41a490a307c55b22dc2764c5b43f2 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 27 Oct 2023 23:34:51 -0400 Subject: [PATCH] [CUDA][HIP] Make template implicitly host device Added opti

[clang] [CUDA][HIP] Make template implicitly host device (PR #70369)

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

[clang] [CUDA][HIP] Make template implicitly host device (PR #70369)

2023-10-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/70369 >From f68b605114ab6b7183b4516df3f1227ef5d6f9d8 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 27 Oct 2023 23:34:51 -0400 Subject: [PATCH] [CUDA][HIP] Make template implicitly host device Added opti

[clang] [CUDA][HIP] Make template implicitly host device (PR #70369)

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

[clang] [CUDA][HIP] Make template implicitly host device (PR #70369)

2023-10-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/70369 >From 0c44a09f45f865f2774bbe33094f1cd262d7c045 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 27 Oct 2023 23:34:51 -0400 Subject: [PATCH] [CUDA][HIP] Make template implicitly host device Added opti

[clang] [CUDA][HIP] Make template implicitly host device (PR #70369)

2023-10-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/70369 >From 5b783705b174fecccb8099c0c2c5b7c93a69cbcf Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Fri, 27 Oct 2023 23:34:51 -0400 Subject: [PATCH] [CUDA][HIP] Make template implicitly host device Added opti

[llvm] [clang] [AMDGPU] Add code model (#70760) test for amdgpu target. (PR #71019)

2023-11-02 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,9 @@ +; RUN: not llc -verify-machineinstrs -o - -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -code-model=tiny < %s 2>&1 | FileCheck %s --check-prefix=TINY +; RUN: not llc -verify-machineinstrs -o - -mtriple=amdgcn-unknown-amdhsa -mcpu=gfx900 -code-model=kernel < %s 2>&

[clang] clang: Add pragma clang fp reciprocal (PR #68267)

2023-11-03 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,130 @@ +// RUN: %clang_cc1 -O3 -triple %itanium_abi_triple -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK,DEFAULT %s +// RUN: %clang_cc1 -O3 -triple %itanium_abi_triple -freciprocal-math -emit-llvm -o - %s | FileCheck -check-prefixes=CHECK,FLAG %s + +float base(

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

2023-12-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/75357 Make changes to clang driver and HIPAMD to allow compile HIP programs to SPIRV with HIPAMD toolchain. >From 953685cdefdb12d5e477b107e88a1c3389eb2bb5 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Wed,

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

2023-12-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > Is generic the best name here? I feel like that's going to be heavily > > overloaded. I'd much prefer a new architecture that just treats "SPIR-V" as > > a single architecture. E.g. `--offload-arch=spirv` or something. For HIPAMD toolchain, `--offload-arch=generic` and `--o

[clang] [compiler-rt] [HIP] support 128 bit int division (PR #71978)

2023-12-13 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/71978 >From 5511b1846fd5eaf839d60a5094ae777152fe975e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 7 Dec 2023 17:10:23 -0500 Subject: [PATCH] [HIP] support 128 bit int division Currently nvcc supports 1

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2023-12-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: this patch is used by https://github.com/llvm/llvm-project/pull/74741 https://github.com/llvm/llvm-project/pull/74737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [AMDGPU] add function attrbute amdgpu-lib-fun (PR #74737)

2023-12-13 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/74737 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [Sema] atomic_compare_exchange: check failure memory order (PR #74959)

2023-12-14 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. https://github.com/llvm/llvm-project/pull/74959 ___ 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)

2023-12-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > > > Is generic the best name here? I feel like that's going to be heavily > > > > overloaded. I'd much prefer a new architecture that just treats > > > > "SPIR-V" as a single architecture. E.g. `--offload-arch=spirv` or > > > > something. > > > > > > For HIPAMD toolchain,

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

2023-12-14 Thread Yaxun Liu via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +llvm::

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

2023-12-14 Thread Yaxun Liu via cfe-commits
@@ -209,6 +210,13 @@ void AMDGCN::Linker::ConstructJob(Compilation &C, const JobAction &JA, if (JA.getType() == types::TY_LLVM_BC) return constructLlvmLinkCommand(C, JA, Inputs, Output, Args); + if (Args.getLastArgValue(options::OPT_mcpu_EQ) == "generic") { +llvm::

[clang] 22078bd - Revert "[CUDA][HIP] ignore implicit host/device attr for override (#72815)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:04:55-05:00 New Revision: 22078bd9f6842411aac2b75196975d68a817a358 URL: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358 DIFF: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358.dif

[clang] 6b3470b - Revert "[CUDA][HIP] make trivial ctor/dtor host device (#72394)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:20:53-05:00 New Revision: 6b3470b4b83195aeeda60b101e8d3bf8800c321c URL: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c DIFF: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c.dif

[clang] 22078bd - Revert "[CUDA][HIP] ignore implicit host/device attr for override (#72815)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:04:55-05:00 New Revision: 22078bd9f6842411aac2b75196975d68a817a358 URL: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358 DIFF: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358.dif

[clang] 6b3470b - Revert "[CUDA][HIP] make trivial ctor/dtor host device (#72394)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:20:53-05:00 New Revision: 6b3470b4b83195aeeda60b101e8d3bf8800c321c URL: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c DIFF: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c.dif

[clang] 22078bd - Revert "[CUDA][HIP] ignore implicit host/device attr for override (#72815)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:04:55-05:00 New Revision: 22078bd9f6842411aac2b75196975d68a817a358 URL: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358 DIFF: https://github.com/llvm/llvm-project/commit/22078bd9f6842411aac2b75196975d68a817a358.dif

[clang] 6b3470b - Revert "[CUDA][HIP] make trivial ctor/dtor host device (#72394)"

2023-11-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2023-11-22T21:20:53-05:00 New Revision: 6b3470b4b83195aeeda60b101e8d3bf8800c321c URL: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c DIFF: https://github.com/llvm/llvm-project/commit/6b3470b4b83195aeeda60b101e8d3bf8800c321c.dif

[clang] clang: Add pragma clang fp reciprocal (PR #68267)

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

[clang] [clang-offload-bundler] Add support for -check-input-archive (PR #73709)

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

[clang] [llvm] [AMDGPU] Add code model (#70760) test for amdgpu target. (PR #71019)

2023-11-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu approved this pull request. LGTM. Please update PR title before merging https://github.com/llvm/llvm-project/pull/71019 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [CodeGen] Add conditional to module cloning in bitcode linking (PR #72478)

2023-11-29 Thread Yaxun Liu via cfe-commits
@@ -251,32 +255,50 @@ bool BackendConsumer::LinkInModules(llvm::Module *M, bool ShouldLinkFiles) { } CurLinkModule = LM.Module.get(); - -// TODO: If CloneModule() is updated to support cloning of unmaterialized -// modules, we can remove this bool Err;

[llvm] [clang] [CUDA][HIP] Improve variable registration with the new driver (PR #73177)

2023-11-29 Thread Yaxun Liu via cfe-commits
@@ -63,6 +63,12 @@ class CGCUDARuntime { OffloadGlobalSurfaceEntry = 0x2, /// Mark the entry as a texture variable. OffloadGlobalTextureEntry = 0x3, + /// Mark the entry as being extern. + OffloadGlobalExtern = 0x4, yxsamliu wrote:

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

2023-11-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping https://github.com/llvm/llvm-project/pull/73140 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [HIP] fix stack marking for -fgpu-rdc (PR #72782)

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

[clang] [CUDA][HIP] allow trivial ctor/dtor in device var init (PR #73140)

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

[clang] [Driver][LTO] Copy fix empty stats filename to AMDGPU, HIPAMD, MinGW (PR #74178)

2023-12-02 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I think we should change signature of addLTOOptions. Instead of accepting a single InputInfo, it should accept InputInfoList. Then these ConstructJob members will pass Inputs to addLTOOptions, and addLTOOptions will pick the first file from it. This should be able to avoid repe

[clang] [CUDA][HIP] warn incompatible redeclare (PR #77359)

2024-01-08 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/77359 nvcc warns about the following code: `void f(); __device__ void f() {}` but clang does not since clang allows device function to overload host function. Users want clang to emit similar warning to help code to

[clang] d414451 - [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-24 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-24T15:19:47-04:00 New Revision: d41445113bccaa037e5876659b4fd98d96af03e4 URL: https://github.com/llvm/llvm-project/commit/d41445113bccaa037e5876659b4fd98d96af03e4 DIFF: https://github.com/llvm/llvm-project/commit/d41445113bccaa037e5876659b4fd98d96af03e4.dif

[clang] 09a5eae - [clang-offload-bundler] add -input/-output options

2022-04-05 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-05T11:13:01-04:00 New Revision: 09a5eae0d1952f53dffd56b9a598215aa1a1487e URL: https://github.com/llvm/llvm-project/commit/09a5eae0d1952f53dffd56b9a598215aa1a1487e DIFF: https://github.com/llvm/llvm-project/commit/09a5eae0d1952f53dffd56b9a598215aa1a1487e.dif

[clang] db5f100 - [HIP] Remove workaround in __clang_hip_runtime_wrapper.h

2021-07-21 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-07-21T15:16:28-04:00 New Revision: db5f100fe4ca252d7f392659e7da5dba10331ae7 URL: https://github.com/llvm/llvm-project/commit/db5f100fe4ca252d7f392659e7da5dba10331ae7 DIFF: https://github.com/llvm/llvm-project/commit/db5f100fe4ca252d7f392659e7da5dba10331ae7.dif

[clang] 9a977da - Fix __hip_fabin visibility

2021-07-23 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-07-23T10:14:29-04:00 New Revision: 9a977daaf6b19c6ff7a53afbe8ece2cb7011dd9e URL: https://github.com/llvm/llvm-project/commit/9a977daaf6b19c6ff7a53afbe8ece2cb7011dd9e DIFF: https://github.com/llvm/llvm-project/commit/9a977daaf6b19c6ff7a53afbe8ece2cb7011dd9e.dif

[clang] 44dbbe6 - [HIP] Preserve ASAN bitcode library functions

2021-07-23 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-07-23T10:35:52-04:00 New Revision: 44dbbe61060acac4d0991a15decac4c909e26844 URL: https://github.com/llvm/llvm-project/commit/44dbbe61060acac4d0991a15decac4c909e26844 DIFF: https://github.com/llvm/llvm-project/commit/44dbbe61060acac4d0991a15decac4c909e26844.dif

[clang] 6730b44 - [HIP] Fix HIP include path

2022-03-09 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-09T20:57:27-05:00 New Revision: 6730b44480fcce18bfbbae0c46719250e9eae425 URL: https://github.com/llvm/llvm-project/commit/6730b44480fcce18bfbbae0c46719250e9eae425 DIFF: https://github.com/llvm/llvm-project/commit/6730b44480fcce18bfbbae0c46719250e9eae425.dif

[clang] da9a703 - [HIP] Fix -fno-gpu-sanitize

2022-03-09 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-09T20:58:50-05:00 New Revision: da9a70313d60572c1e1e630ecf2dad7a0fa5d7ff URL: https://github.com/llvm/llvm-project/commit/da9a70313d60572c1e1e630ecf2dad7a0fa5d7ff DIFF: https://github.com/llvm/llvm-project/commit/da9a70313d60572c1e1e630ecf2dad7a0fa5d7ff.dif

[clang] 4ea1d43 - [CUDA][HIP] Externalize kernels in anonymous name space

2022-04-10 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-10T21:56:28-04:00 New Revision: 4ea1d435099f992cc16127619b0feb64e070630d URL: https://github.com/llvm/llvm-project/commit/4ea1d435099f992cc16127619b0feb64e070630d DIFF: https://github.com/llvm/llvm-project/commit/4ea1d435099f992cc16127619b0feb64e070630d.dif

[clang] 0424b51 - [CUDA][HIP] Fix host used external kernel in archive

2022-04-13 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-13T10:47:16-04:00 New Revision: 0424b5115cffad73a0f6e68affed603a7ed9a692 URL: https://github.com/llvm/llvm-project/commit/0424b5115cffad73a0f6e68affed603a7ed9a692 DIFF: https://github.com/llvm/llvm-project/commit/0424b5115cffad73a0f6e68affed603a7ed9a692.dif

[clang] cac4e2f - [CUDA][HIP] Fix gpu.used.external

2022-04-18 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-18T23:10:31-04:00 New Revision: cac4e2fe258239489c12dd5f153da3e69e17ebba URL: https://github.com/llvm/llvm-project/commit/cac4e2fe258239489c12dd5f153da3e69e17ebba DIFF: https://github.com/llvm/llvm-project/commit/cac4e2fe258239489c12dd5f153da3e69e17ebba.dif

[clang] 800f263 - [CUDA][HIP] Fix delete operator for -fopenmp

2022-04-19 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-19T14:28:03-04:00 New Revision: 800f26386cd9054ceed68e481612908f635b9718 URL: https://github.com/llvm/llvm-project/commit/800f26386cd9054ceed68e481612908f635b9718 DIFF: https://github.com/llvm/llvm-project/commit/800f26386cd9054ceed68e481612908f635b9718.dif

[clang] d4e4ef2 - [HIP] Support code object v5

2022-02-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-04T09:55:08-05:00 New Revision: d4e4ef2e81e03246e29e9b6eaa2929ebd4e77784 URL: https://github.com/llvm/llvm-project/commit/d4e4ef2e81e03246e29e9b6eaa2929ebd4e77784 DIFF: https://github.com/llvm/llvm-project/commit/d4e4ef2e81e03246e29e9b6eaa2929ebd4e77784.dif

[clang] 171da44 - [HIPSPV] Fix literals are mapped to Generic address space

2022-02-05 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-05T17:26:52-05:00 New Revision: 171da443d598662371f4101f0ba92c0138011ff6 URL: https://github.com/llvm/llvm-project/commit/171da443d598662371f4101f0ba92c0138011ff6 DIFF: https://github.com/llvm/llvm-project/commit/171da443d598662371f4101f0ba92c0138011ff6.dif

[clang] 1d97cb1 - [HIP] Emit amdgpu_code_object_version module flag

2022-02-08 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-08T21:58:40-05:00 New Revision: 1d97cb1f6e44a77cfc6911b916656e3c5de9bec8 URL: https://github.com/llvm/llvm-project/commit/1d97cb1f6e44a77cfc6911b916656e3c5de9bec8 DIFF: https://github.com/llvm/llvm-project/commit/1d97cb1f6e44a77cfc6911b916656e3c5de9bec8.dif

[clang] 73b2293 - [CUDA][HIP] Do not promote constexpr var with non-constant initializer

2022-02-15 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-15T15:15:55-05:00 New Revision: 73b22935a7a863679021598db6a45fcfb62cd321 URL: https://github.com/llvm/llvm-project/commit/73b22935a7a863679021598db6a45fcfb62cd321 DIFF: https://github.com/llvm/llvm-project/commit/73b22935a7a863679021598db6a45fcfb62cd321.dif

[clang] 04fb816 - [CUDA][HIP] Externalize kernels with internal linkage

2022-04-22 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-22T17:05:36-04:00 New Revision: 04fb81674ed7981397ffe70fe6a07b7168f6fe2f URL: https://github.com/llvm/llvm-project/commit/04fb81674ed7981397ffe70fe6a07b7168f6fe2f DIFF: https://github.com/llvm/llvm-project/commit/04fb81674ed7981397ffe70fe6a07b7168f6fe2f.dif

[clang] c89433d - [HIP] Fix diag msg about sanitizer

2022-04-26 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-26T10:36:36-04:00 New Revision: c89433d7fa10f9a3fe3858ac455ece5913092107 URL: https://github.com/llvm/llvm-project/commit/c89433d7fa10f9a3fe3858ac455ece5913092107 DIFF: https://github.com/llvm/llvm-project/commit/c89433d7fa10f9a3fe3858ac455ece5913092107.dif

[clang] 57a210e - [CUDA][HIP] Fix linkage of __clang_gpu_used_external

2022-04-26 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-26T20:43:39-04:00 New Revision: 57a210e5b705f4d176facbd8a15aa3e89ea9e335 URL: https://github.com/llvm/llvm-project/commit/57a210e5b705f4d176facbd8a15aa3e89ea9e335 DIFF: https://github.com/llvm/llvm-project/commit/57a210e5b705f4d176facbd8a15aa3e89ea9e335.dif

[clang] 062317f - [HIP] Add HIP runtime library arguments for linker

2022-04-28 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-28T11:12:23-04:00 New Revision: 062317f72ebfc19b0f3733b4181bb09344707653 URL: https://github.com/llvm/llvm-project/commit/062317f72ebfc19b0f3733b4181bb09344707653 DIFF: https://github.com/llvm/llvm-project/commit/062317f72ebfc19b0f3733b4181bb09344707653.dif

[clang] 11d3e31 - [CUDA][HIP] Fix mangling number for local struct

2022-04-28 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-04-28T19:54:43-04:00 New Revision: 11d3e31c60bdc9e491c51b97a964b6289575edfa URL: https://github.com/llvm/llvm-project/commit/11d3e31c60bdc9e491c51b97a964b6289575edfa DIFF: https://github.com/llvm/llvm-project/commit/11d3e31c60bdc9e491c51b97a964b6289575edfa.dif

[clang] 62501bc - [NFC][CUDA][HIP] rework mangling number for aux target

2022-05-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-05-04T13:05:33-04:00 New Revision: 62501bc45a2fb4980725baccf48576cf9b45cd4d URL: https://github.com/llvm/llvm-project/commit/62501bc45a2fb4980725baccf48576cf9b45cd4d DIFF: https://github.com/llvm/llvm-project/commit/62501bc45a2fb4980725baccf48576cf9b45cd4d.dif

[clang] effe799 - [CUDA] remove duplicate condition

2022-07-22 Thread Yaxun Liu via cfe-commits
Author: VitalyR Date: 2022-07-22T11:27:19-04:00 New Revision: effe79993f8e0bd13181fcf660a47ed7044a83c3 URL: https://github.com/llvm/llvm-project/commit/effe79993f8e0bd13181fcf660a47ed7044a83c3 DIFF: https://github.com/llvm/llvm-project/commit/effe79993f8e0bd13181fcf660a47ed7044a83c3.diff LOG:

<    1   2   3   4   5   6   7   8   9   10   >