[clang] [libcxx] [SemaCXX] Implement CWG2137 (list-initialization from objects of the same type) (PR #77768)

2024-05-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > This is mostly just a call to coordinate a bit better. I would suggest that > > if the patch author is engaged on the thread, it would make sense to tell > > them the schedule on which you plan to revert so they have an opportunity > > to tell you if that's going to be disr

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

2024-05-30 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/77359 >From 319552f781eb6186f96f72b8de23de1390c5da0e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 30 May 2024 16:02:37 -0400 Subject: [PATCH] [CUDA][HIP] warn incompatible redeclare nvcc warns about th

[clang] [clang][CodeGen] `used` globals && the payloads for global ctors & dtors are globals (PR #93601)

2024-05-30 Thread Yaxun Liu via cfe-commits
@@ -2928,12 +2928,13 @@ static void emitUsed(CodeGenModule &CGM, StringRef Name, for (unsigned i = 0, e = List.size(); i != e; ++i) { UsedArray[i] = llvm::ConstantExpr::getPointerBitCastOrAddrSpaceCast( -cast(&*List[i]), CGM.Int8PtrTy); ---

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-30 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: llvm datalayout defines P - program addr space for functions G - global addr space for global variables https://llvm.org/docs/LangRef.html#langref-datalayout should we use P for llvm.global_ctors instead of G? https://github.com/llvm/llvm-project/pull/93914 __

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

2024-05-30 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,19 @@ +// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fsyntax-only \ +// RUN: -isystem %S/Inputs -verify %s +// RUN: %clang_cc1 -triple nvptx64-nvidia-cuda -fsyntax-only \ +// RUN: -isystem %S/Inputs -fcuda-is-device -verify %s +// RUN: %clang_cc1 -triple x86_

[clang] [llvm] [clang][CodeGen] Global constructors/destructors are globals (PR #93914)

2024-05-31 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > > Perhaps an alternative is to tweak LangRef wording to say that that these > > are always emitted as unqualified ptrs, and that their ephemeral nature > > implies that their AS is meaningless? > > I think this is the correct way to handle it. Also we'll need a few > stripPo

[clang] [CUDA][HIP] Fix std::min in wrapper header (PR #93976)

2024-05-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/93976 The std::min behaves like 'ahttps://github.com/llvm/llvm-project/issues/93962 Fixes: https://github.com/ROCm/HIP/issues/3502 >From ac8100056c81d1b4d3d40c31574be93ca78cf80c Mon Sep 17 00:00:00 2001 From: "Yaxun

[clang] [CUDA] Fix a couple of driver tests that really weren't being run (PR #93960)

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

[clang] [CUDA][HIP] Fix std::min in wrapper header (PR #93976)

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

[clang] [libcxx] [Clang] Implement CWG2137 (list-initialization from objects of the same type) (PR #94355)

2024-06-04 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @yxsamliu Re: [#77768 > (comment)](https://github.com/llvm/llvm-project/pull/77768#issuecomment-1957171805): > That is the expected behaviour, since CWG2137 expressly wants to use > initializer_list constructors over non-initializer_list constructors > (especially copy const

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/88827 __hipRegisterFatBinary only accepts one pointer argument. It is expected to get the fat binary size from the header. This patch adds a file size field to the header of the compressed bundle. >From 3deb7005c462

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/88827 >From c89b262fc8283d985ac31966de73764aedd140af Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 15 Apr 2024 18:02:42 -0400 Subject: [PATCH] [ClangOffloadBundler] Add file size to header __hipRegister

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-15 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Isn't this ABI breaking since we're changing the size of the struct? > Shouldn't that necessitate a new version? > > Also unrelated, I wonder if there's a future where we can use the > ClangOffloadPackager format in the HIP runtime. I think you are right. Although this featu

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-15 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/88827 >From d18a8c971d0220bafad643bb883b90c03f483913 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 15 Apr 2024 18:02:42 -0400 Subject: [PATCH] [ClangOffloadBundler] Add file size to header __hipRegister

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-16 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/88827 >From fec9509f0c9162331fd2a7757e74b8c8408990c0 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 15 Apr 2024 18:02:42 -0400 Subject: [PATCH] [ClangOffloadBundler] Add file size to header __hipRegister

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-16 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/88827 >From 7574258faa28a43549e507d08128ba700c42acc8 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Mon, 15 Apr 2024 18:02:42 -0400 Subject: [PATCH] [ClangOffloadBundler] Add file size to header __hipRegister

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

2024-04-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > Seems the documentation builder is complaining, maybe something wrong with > the .rst file. It is passing now https://github.com/llvm/llvm-project/pull/88827 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[clang] [CUDA][HIP] Fix record layout on Windows (PR #87651)

2024-04-17 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: ping It passes our internal Windows CI. https://github.com/llvm/llvm-project/pull/87651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix record layout on Windows (PR #87651)

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

[clang] [ClangOffloadBundler] Add file size to header (PR #88827)

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

[clang] [HIP] Fix __clang_hip_cmath.hip for ambiguity (PR #101341)

2024-07-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/101341 If there is a type T which can be converted to both float and double etc but itself is not specialized for __numeric_type, and it is called for math functions eg. fma, it will cause ambiguity with test functio

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

2024-07-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/101350 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. >From 8819e99b64f3293a758f8a81258a25c91fab6ef

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

2024-07-18 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: found another library using mixed min: https://github.com/ROCm/Tensile/issues/1977 https://github.com/llvm/llvm-project/pull/82956 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/

[clang] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-04-24 Thread Yaxun Liu via cfe-commits
@@ -54,3 +56,289 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +static constexpr Builtin::Info BuiltinInfo[] = { +#define BUILTIN(ID, TYPE, ATTRS)

[clang] [clang] deprecate frelaxed-template-template-args, make it on by default (PR #89807)

2024-04-25 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > This patch will finally allow us to mark C++17 support in clang as complete. > > This is a continuation of the review process from an [old PR in > phab](https://reviews.llvm.org/D109496). > > Recap: The original patch from phab initially contained no workarounds / > provisio

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-25 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/90155 MSVC linker merges functions having comdat which have identical set of instructions. CUDA uses kernel stub function as key to look up kernels in device executables. If kernel stub function for different kernels

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/90155 >From 112e5eb538d4167a1d7be6c7171df1ca51cb374e Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 25 Apr 2024 22:23:26 -0400 Subject: [PATCH] [CUDA] make kernel stub ICF-proof MSVC linker merges functi

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Yaxun Liu via cfe-commits
@@ -424,6 +424,34 @@ void CGNVCUDARuntime::emitDeviceStubBodyNew(CodeGenFunction &CGF, CGM.CreateRuntimeFunction(FTy, LaunchKernelName); CGF.EmitCall(FI, CGCallee::forDirect(cudaLaunchKernelFn), ReturnValueSlot(), LaunchKernelArgs); + + // To prevent CU

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

2024-04-29 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/90155 >From 7a741109a6769e2e91d77a82d9a44c7f9c212c48 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 25 Apr 2024 22:23:26 -0400 Subject: [PATCH] [CUDA] make kernel stub ICF-proof MSVC linker may merge fun

[clang] [clang] Fixing Clang HIP inconsistent order for template functions (PR #101627)

2024-08-28 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: is it already fixed by https://github.com/llvm/llvm-project/pull/102661 ? https://github.com/llvm/llvm-project/pull/101627 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[clang] [llvm] [Offload] Move HIP and CUDA to new driver by default (PR #84420)

2024-08-29 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @yxsamliu Do you know what the next steps for merging this would be? I'd like > to get it into the Clang 20 release if possible. The only thing this loses > currently is managed variables being registered in RDC mode, but I'm going to > assume that's hardly seen in practice s

[clang] Compiler messages on HIP SDK for Windows (PR #97668)

2024-07-09 Thread Yaxun Liu via cfe-commits
@@ -0,0 +1,7 @@ +// UNSUPPORTED: system-linux yxsamliu wrote: You may need `// REQUIRES: system-windows` since only on Windows these paths are not added. https://github.com/llvm/llvm-project/pull/97668 ___ cfe-commits

[clang] [Clang] Make the GPU toolchains implicitly link `-lm` and `-lc` (PR #98170)

2024-07-09 Thread Yaxun Liu via cfe-commits
@@ -633,6 +633,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, else if (Args.hasArg(options::OPT_mcpu_EQ)) CmdArgs.push_back(Args.MakeArgString( "-plugin-opt=mcpu=" + Args.getLastArgValue(options::OPT_mcpu_EQ))); + + // If the user's

[clang] [Clang] Make the GPU toolchains implicitly link `-lm` and `-lc` (PR #98170)

2024-07-09 Thread Yaxun Liu via cfe-commits
@@ -633,6 +633,17 @@ void amdgpu::Linker::ConstructJob(Compilation &C, const JobAction &JA, else if (Args.hasArg(options::OPT_mcpu_EQ)) CmdArgs.push_back(Args.MakeArgString( "-plugin-opt=mcpu=" + Args.getLastArgValue(options::OPT_mcpu_EQ))); + yx

[clang] [Clang] Make the GPU toolchains implicitly link `-lm` and `-lc` (PR #98170)

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

[clang] [Clang] Add `__CLANG_GPU_DISABLE_MATH_WRAPPERS` macro for offloading math (PR #98234)

2024-07-10 Thread Yaxun Liu via cfe-commits
@@ -345,4 +349,5 @@ __DEVICE__ float ynf(int __a, float __b) { return __nv_ynf(__a, __b); } #pragma pop_macro("__DEVICE_VOID__") #pragma pop_macro("__FAST_OR_SLOW") +#endif // __CLANG_GPU_DISABLE_MATH_WRAPPERS yxsamliu wrote: some non-libm functions e.g. `__

[clang] [compiler-rt] [nsan] Add shared runtime (PR #98415)

2024-07-10 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: It seems to cause a build failure: https://lab.llvm.org/buildbot/#/builders/123/builds/1580 https://github.com/llvm/llvm-project/pull/98415 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/

[clang] [compiler-rt] [nsan] Add shared runtime (PR #98415)

2024-07-10 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > It seems to cause a build failure: > > https://lab.llvm.org/buildbot/#/builders/123/builds/1580 It seems the issue was due to old system linker. If I use lld to build compier-rt the build passes. I will fix the buildbot https://github.com/llvm/llvm-zorg/pull/225 https://git

[clang] [CUDA][HIP][NFC] add CodeGenModule::shouldEmitCUDAGlobalVar (PR #98543)

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

[clang] [CUDA][HIP] Fix template static member (PR #98580)

2024-07-11 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/98580 Should check host/device attributes before emitting static member of template instantiation. Fixes: https://github.com/llvm/llvm-project/issues/98151 >From ba7ab88308c5af2e1c5e6c841524a932c42afeb2 Mon Sep 17 0

[clang] [CUDA][HIP] Fix template static member (PR #98580)

2024-07-11 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: sorry for the trouble. It is the same change but rebased to main branch. https://github.com/llvm/llvm-project/pull/98580 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[clang] [CUDA][HIP] Fix template static member (PR #98580)

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

[clang] [CUDA] make kernel stub ICF-proof (PR #90155)

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

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-02 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: This patch seems to cause a regression for rocThrust: https://github.com/ROCm/rocThrust/blob/f3a28e43355b0f439fb99a2210bd497ca59c8003/thrust/optional.h#L2756 rocThrust/thrust/../thrust/optional.h:2756:11: error: no member named 'construct' in 'optional' A reduced test case is

[clang] [clang-tools-extra] Reapply "[Clang][Sema] Diagnose class member access expressions naming non-existent members of the current instantiation prior to instantiation in the absence of dependent

2024-05-02 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: Thanks for all your analysis. I agree this is a rocThrust bug. I will open an issue to rocThrust. https://github.com/llvm/llvm-project/pull/90152 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/ma

[clang] [clang][CodeGen] Omit pre-opt link when post-opt is link requested (PR #85672)

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

[clang] [ClangOffloadBundler] make hipv4 and hip compatible (PR #91637)

2024-05-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu created https://github.com/llvm/llvm-project/pull/91637 The distinction between the hip and hipv4 offload kinds is historically based. Originally, these designations might have indicated different versions of the code object ABI (Application Binary Interface). How

[clang] [ClangOffloadBundler] make hipv4 and hip compatible (PR #91637)

2024-05-09 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/91637 >From 21ab5258598961184b175c3b373ae5bf4cb8b914 Mon Sep 17 00:00:00 2001 From: "Yaxun (Sam) Liu" Date: Thu, 9 May 2024 14:11:55 -0400 Subject: [PATCH] [ClangOffloadBundler] make hipv4 and hip compatible The dist

[clang] [ClangOffloadBundler] make hipv4 and hip compatible (PR #91637)

2024-05-09 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > There's some code in the `clang-linker-wrapper` that creates the > offloadbundler format for HIP offloading. I think it and the tests use > `hipv4` which we could presumably remove now? yes. I updated linker wrapper to use hip- instead of hipv4- https://github.com/llvm/llvm-

[clang] [ClangOffloadBundler] make hipv4 and hip compatible (PR #91637)

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

[clang] [LinkerWrapper] Add an overriding option for debugging (PR #91984)

2024-05-14 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: would it be more useful to allow swapping the output by environment variable and MD5 hash, e.g. CLANG_LINK_WRAPPER_SWAP_OUTPUT=hash1:file1,hash2:file2 it calculates the MD5 hash of the output file, if matching, swap it with the specified file. This way, we can set an env var t

[clang] [LinkerWrapper] Add an overriding option for debugging (PR #91984)

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

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

2024-05-15 Thread Yaxun Liu via cfe-commits
@@ -54,3 +56,77 @@ void SPIRV64TargetInfo::getTargetDefines(const LangOptions &Opts, BaseSPIRVTargetInfo::getTargetDefines(Opts, Builder); DefineStd(Builder, "SPIRV64", Opts); } + +namespace { +const AMDGPUTargetInfo AMDGPUTI(llvm::Triple("amdgcn-amd-amdhsa"), {}); + +} //

[clang] [llvm] [clang][SPIR-V] Add support for AMDGCN flavoured SPIRV (PR #89796)

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

[clang] [NFC][amdgpuarch] Correct file names in file header comments (PR #92294)

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

[clang] [llvm] [AMDGPU][Clang] Add check of size for __builtin_amdgcn_global_load_lds (PR #93064)

2024-05-22 Thread Yaxun Liu via cfe-commits
@@ -19040,6 +19040,48 @@ Value *CodeGenFunction::EmitAMDGPUBuiltinExpr(unsigned BuiltinID, CGM.getIntrinsic(Intrinsic::amdgcn_s_sendmsg_rtn, {ResultType}); return Builder.CreateCall(F, {Arg}); } + case AMDGPU::BI__builtin_amdgcn_global_load_lds: { +SmallVect

[clang] [llvm] [mlir] [Clang][CodeGen] Start migrating away from assuming the Default AS is 0 (PR #88182)

2024-05-27 Thread Yaxun Liu via cfe-commits
@@ -368,7 +368,8 @@ CodeGenModule::CodeGenModule(ASTContext &C, IntTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getIntWidth()); IntPtrTy = llvm::IntegerType::get(LLVMContext, C.getTargetInfo().getMaxPointerWidth()); - Int8PtrTy = llvm::PointerType::get(LL

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

2024-07-31 Thread Yaxun Liu via cfe-commits
https://github.com/yxsamliu updated https://github.com/llvm/llvm-project/pull/101350 >From e7c39dbcb05d8fa9232a68c90b0ec4fc4d2a126b 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)

2024-07-31 Thread Yaxun Liu via cfe-commits
@@ -31,16 +43,108 @@ 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] [libc] [Clang] Suppress missing architecture error when doing LTO (PR #100652)

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

[clang] [HIP] Fix __clang_hip_cmath.hip for ambiguity (PR #101341)

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

[clang] [clang][NFC] Make OffloadLTOMode getter a separate method (PR #101200)

2024-08-06 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: > @yxsamliu Would you mind reviewing this change? Sorry for the delay. LGTM https://github.com/llvm/llvm-project/pull/101200 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-co

[clang] [AMDGPU] Use the AMDGPUToolChain when targeting C/C++ directly (PR #99687)

2024-08-07 Thread Yaxun Liu via cfe-commits
yxsamliu wrote: I feel choosing toolchain based on input files does not solve all the use cases. You may want to handle the object files, bitcodes, or assembly files differently by using different toolchains, e.g. you may want to choose rocm toolchain or amdgpu toolchain or HIPAMD toolchain to

[clang] 85c2bd2 - Prevent adding module flag amdgpu_hostcall multiple times

2022-01-19 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-01-19T12:52:33-05:00 New Revision: 85c2bd2a0e0e2c1706bbf50203d5bbbeedbbd741 URL: https://github.com/llvm/llvm-project/commit/85c2bd2a0e0e2c1706bbf50203d5bbbeedbbd741 DIFF: https://github.com/llvm/llvm-project/commit/85c2bd2a0e0e2c1706bbf50203d5bbbeedbbd741.dif

[clang] 8428c75 - [CUDA][HIP] Do not treat host var address as constant in device compilation

2022-01-28 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-01-28T16:04:52-05:00 New Revision: 8428c75da1ab3149292c255057173cb502729d92 URL: https://github.com/llvm/llvm-project/commit/8428c75da1ab3149292c255057173cb502729d92 DIFF: https://github.com/llvm/llvm-project/commit/8428c75da1ab3149292c255057173cb502729d92.dif

[clang] fa0f90b - [HIP] Support linking archive of bundled bitcode

2022-02-19 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-19T18:37:44-05:00 New Revision: fa0f90bc55ed536e1488648255278ce9029cfa59 URL: https://github.com/llvm/llvm-project/commit/fa0f90bc55ed536e1488648255278ce9029cfa59 DIFF: https://github.com/llvm/llvm-project/commit/fa0f90bc55ed536e1488648255278ce9029cfa59.dif

[clang] 9d899d8 - [HIP] Support `-fgpu-default-stream`

2022-02-23 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-23T22:28:29-05:00 New Revision: 9d899d8f01872e91b9909a6ee5937a796a399276 URL: https://github.com/llvm/llvm-project/commit/9d899d8f01872e91b9909a6ee5937a796a399276 DIFF: https://github.com/llvm/llvm-project/commit/9d899d8f01872e91b9909a6ee5937a796a399276.dif

[clang] df0c983 - [HIP] Fix test hip-link-bundled-archive.hip

2022-02-25 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-25T15:27:57-05:00 New Revision: df0c983643222b8b2085fb4d8a833cb64274caf1 URL: https://github.com/llvm/llvm-project/commit/df0c983643222b8b2085fb4d8a833cb64274caf1 DIFF: https://github.com/llvm/llvm-project/commit/df0c983643222b8b2085fb4d8a833cb64274caf1.dif

[clang] 092f15a - [HIP] File device library ABI version file name

2022-02-28 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-02-28T16:24:50-05:00 New Revision: 092f15ac40ce35d077e0225a4462bc4dfa379391 URL: https://github.com/llvm/llvm-project/commit/092f15ac40ce35d077e0225a4462bc4dfa379391 DIFF: https://github.com/llvm/llvm-project/commit/092f15ac40ce35d077e0225a4462bc4dfa379391.dif

[clang] bde13a8 - [HIP] Fix job action offloading kind for mixed HIP/C++ compilation

2022-03-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-04T15:34:02-05:00 New Revision: bde13a8102baef4d79723064e6bd27cd39124d91 URL: https://github.com/llvm/llvm-project/commit/bde13a8102baef4d79723064e6bd27cd39124d91 DIFF: https://github.com/llvm/llvm-project/commit/bde13a8102baef4d79723064e6bd27cd39124d91.dif

[clang] e5eb365 - [CUDA][HIP] Fix offloading kind for linking C++ programs

2022-03-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-04T15:56:54-05:00 New Revision: e5eb365069cce7bb642421d53a1d3964f8d5bdb7 URL: https://github.com/llvm/llvm-project/commit/e5eb365069cce7bb642421d53a1d3964f8d5bdb7 DIFF: https://github.com/llvm/llvm-project/commit/e5eb365069cce7bb642421d53a1d3964f8d5bdb7.dif

[clang] 22b6e81 - Fix test failure in openmp-offload.c

2022-03-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-03-04T16:32:30-05:00 New Revision: 22b6e8173cb258fae5a7d332b6f9eb19e9ddf86f URL: https://github.com/llvm/llvm-project/commit/22b6e8173cb258fae5a7d332b6f9eb19e9ddf86f DIFF: https://github.com/llvm/llvm-project/commit/22b6e8173cb258fae5a7d332b6f9eb19e9ddf86f.dif

[clang] 8baba68 - [HIP] Support overloaded math functions for hipRTC

2021-04-22 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-22T19:06:51-04:00 New Revision: 8baba6890de74d33beb75646ebcbf168e949d578 URL: https://github.com/llvm/llvm-project/commit/8baba6890de74d33beb75646ebcbf168e949d578 DIFF: https://github.com/llvm/llvm-project/commit/8baba6890de74d33beb75646ebcbf168e949d578.dif

[clang] 76a412e - [HIP] Fix help text for -fgpu-allow-device-init

2021-04-27 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-27T10:06:32-04:00 New Revision: 76a412e7a330964fe9914cbaaa0772feef771a28 URL: https://github.com/llvm/llvm-project/commit/76a412e7a330964fe9914cbaaa0772feef771a28 DIFF: https://github.com/llvm/llvm-project/commit/76a412e7a330964fe9914cbaaa0772feef771a28.dif

[clang] 0175999 - [AMDGPU] Add options -mamdgpu-ieee -mno-amdgpu-ieee

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

[clang] c58a6a6 - [HIP] Fix device lib selection

2021-05-01 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-05-01T20:31:11-04:00 New Revision: c58a6a6fb4110ee1ffd0e45ad98872e55855b310 URL: https://github.com/llvm/llvm-project/commit/c58a6a6fb4110ee1ffd0e45ad98872e55855b310 DIFF: https://github.com/llvm/llvm-project/commit/c58a6a6fb4110ee1ffd0e45ad98872e55855b310.dif

[clang] 98ab43a - [HIP] Fix device only linking for -fgpu-rdc

2022-01-10 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-01-10T17:38:02-05:00 New Revision: 98ab43a1d209875ce9cc39420d3e6af57ed0f5b2 URL: https://github.com/llvm/llvm-project/commit/98ab43a1d209875ce9cc39420d3e6af57ed0f5b2 DIFF: https://github.com/llvm/llvm-project/commit/98ab43a1d209875ce9cc39420d3e6af57ed0f5b2.dif

[clang] 694fd10 - [HIP] Fix device malloc/free

2022-01-11 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2022-01-11T14:49:34-05:00 New Revision: 694fd10659eb32399b0c4fb31f2d062040d800b4 URL: https://github.com/llvm/llvm-project/commit/694fd10659eb32399b0c4fb31f2d062040d800b4 DIFF: https://github.com/llvm/llvm-project/commit/694fd10659eb32399b0c4fb31f2d062040d800b4.dif

[clang] 3b172f6 - [HIP] Fix -fgpu-rdc for Windows

2021-12-06 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-06T16:42:23-05:00 New Revision: 3b172f60c6926b43f87de1eaa3fa4c873bdb6de4 URL: https://github.com/llvm/llvm-project/commit/3b172f60c6926b43f87de1eaa3fa4c873bdb6de4 DIFF: https://github.com/llvm/llvm-project/commit/3b172f60c6926b43f87de1eaa3fa4c873bdb6de4.dif

[clang] d55f05d - [CUDA][HIP] Add pre-defined macro `__CLANG_RDC__`

2021-12-07 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-07T18:08:16-05:00 New Revision: d55f05d9f7dc8aa0468a9db19d84671acf05823a URL: https://github.com/llvm/llvm-project/commit/d55f05d9f7dc8aa0468a9db19d84671acf05823a DIFF: https://github.com/llvm/llvm-project/commit/d55f05d9f7dc8aa0468a9db19d84671acf05823a.dif

[clang] 78b0f37 - [HIPSPV][1/4] Refactor HIP tool chain

2021-12-13 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-13T10:50:25-05:00 New Revision: 78b0f3701d441e887e92ff9feec4c226c67c334f URL: https://github.com/llvm/llvm-project/commit/78b0f3701d441e887e92ff9feec4c226c67c334f DIFF: https://github.com/llvm/llvm-project/commit/78b0f3701d441e887e92ff9feec4c226c67c334f.dif

[clang] 240be65 - Fix warning about unused variable in HIPAMD.cpp

2021-12-13 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-13T11:25:48-05:00 New Revision: 240be6541d49ee7c810cf60fb809409cbadd59c6 URL: https://github.com/llvm/llvm-project/commit/240be6541d49ee7c810cf60fb809409cbadd59c6 DIFF: https://github.com/llvm/llvm-project/commit/240be6541d49ee7c810cf60fb809409cbadd59c6.dif

[clang] 006fb62 - Fix build failure of HIPUtility.cpp on Windows

2021-12-13 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-13T11:53:06-05:00 New Revision: 006fb62434f58f69eb7d3d48c81975df2c002778 URL: https://github.com/llvm/llvm-project/commit/006fb62434f58f69eb7d3d48c81975df2c002778 DIFF: https://github.com/llvm/llvm-project/commit/006fb62434f58f69eb7d3d48c81975df2c002778.dif

[clang] a6786cd - [HIPSPV][3/4] Enable SPIR-V emission for HIP

2021-12-20 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-12-20T10:45:09-05:00 New Revision: a6786cdd575701ec1a1bc42adc086cfb70201ad3 URL: https://github.com/llvm/llvm-project/commit/a6786cdd575701ec1a1bc42adc086cfb70201ad3 DIFF: https://github.com/llvm/llvm-project/commit/a6786cdd575701ec1a1bc42adc086cfb70201ad3.dif

[clang] 282bf9e - [HIP] Fix ROCm detection

2021-03-22 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-03-22T16:10:02-04:00 New Revision: 282bf9eaf7b1fc28fd60a177b97dc1ce9f220352 URL: https://github.com/llvm/llvm-project/commit/282bf9eaf7b1fc28fd60a177b97dc1ce9f220352 DIFF: https://github.com/llvm/llvm-project/commit/282bf9eaf7b1fc28fd60a177b97dc1ce9f220352.dif

[clang] cc94771 - [CUDA][HIP] add __builtin_get_device_side_mangled_name

2021-03-25 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-03-25T15:25:29-04:00 New Revision: cc9477166a53faced47cbd4146ac4adea431ccfd URL: https://github.com/llvm/llvm-project/commit/cc9477166a53faced47cbd4146ac4adea431ccfd DIFF: https://github.com/llvm/llvm-project/commit/cc9477166a53faced47cbd4146ac4adea431ccfd.dif

[clang] 85ff35a - [HIP] remove overloaded abs in header

2021-04-01 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-01T12:23:29-04:00 New Revision: 85ff35a9529a1ea9ed7ab8cda10761d66705d518 URL: https://github.com/llvm/llvm-project/commit/85ff35a9529a1ea9ed7ab8cda10761d66705d518 DIFF: https://github.com/llvm/llvm-project/commit/85ff35a9529a1ea9ed7ab8cda10761d66705d518.dif

[clang] 907af84 - [CUDA][HIP] rename -fcuda-flush-denormals-to-zero

2021-04-04 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-05T00:13:51-04:00 New Revision: 907af8439672e47cf978b43625d9318dd34e13ab URL: https://github.com/llvm/llvm-project/commit/907af8439672e47cf978b43625d9318dd34e13ab DIFF: https://github.com/llvm/llvm-project/commit/907af8439672e47cf978b43625d9318dd34e13ab.dif

[clang] 61d065e - Let clang atomic builtins fetch add/sub support floating point types

2021-04-06 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-06T15:44:00-04:00 New Revision: 61d065e21ff37fb9040aed711c97daddac2f7577 URL: https://github.com/llvm/llvm-project/commit/61d065e21ff37fb9040aed711c97daddac2f7577 DIFF: https://github.com/llvm/llvm-project/commit/61d065e21ff37fb9040aed711c97daddac2f7577.dif

[clang] 4fd05e0 - [HIP] Change to code object v4

2021-04-06 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-06T20:22:58-04:00 New Revision: 4fd05e0ad7fba41f27a6f61d9f7fec4382cb96fe URL: https://github.com/llvm/llvm-project/commit/4fd05e0ad7fba41f27a6f61d9f7fec4382cb96fe DIFF: https://github.com/llvm/llvm-project/commit/4fd05e0ad7fba41f27a6f61d9f7fec4382cb96fe.dif

[clang] 86175d5 - Minor fix for test hip-code-object-version.hip

2021-04-06 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-06T20:32:16-04:00 New Revision: 86175d5fedba7c09ad09ee5afd359e7f9246367a URL: https://github.com/llvm/llvm-project/commit/86175d5fedba7c09ad09ee5afd359e7f9246367a DIFF: https://github.com/llvm/llvm-project/commit/86175d5fedba7c09ad09ee5afd359e7f9246367a.dif

[clang] 25942d7 - [AMDGPU] Allow relaxed/consume memory order for atomic inc/dec

2021-04-09 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-09T09:23:41-04:00 New Revision: 25942d7c49ed37a6fa9b291423bb0a22ae77e32d URL: https://github.com/llvm/llvm-project/commit/25942d7c49ed37a6fa9b291423bb0a22ae77e32d DIFF: https://github.com/llvm/llvm-project/commit/25942d7c49ed37a6fa9b291423bb0a22ae77e32d.dif

[clang] f9264ac - [HIP] Workaround ICE compiling SemaChecking.cpp with gcc 5

2021-04-09 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-09T10:40:07-04:00 New Revision: f9264ac0fdb7b58d1eb088ea91af0fee48816033 URL: https://github.com/llvm/llvm-project/commit/f9264ac0fdb7b58d1eb088ea91af0fee48816033 DIFF: https://github.com/llvm/llvm-project/commit/f9264ac0fdb7b58d1eb088ea91af0fee48816033.dif

[clang] 3597f02 - [AMDGPU] Add GlobalDCE before internalization pass

2021-04-17 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-17T11:25:25-04:00 New Revision: 3597f02fd5c62f7c49c71b92e467128ffe2cf9cd URL: https://github.com/llvm/llvm-project/commit/3597f02fd5c62f7c49c71b92e467128ffe2cf9cd DIFF: https://github.com/llvm/llvm-project/commit/3597f02fd5c62f7c49c71b92e467128ffe2cf9cd.dif

[clang] d5c0f00 - [CUDA][HIP] Mark device var used by host only

2021-04-17 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-17T11:25:25-04:00 New Revision: d5c0f00e216aa6797499bb4c8aacac930d8a819b URL: https://github.com/llvm/llvm-project/commit/d5c0f00e216aa6797499bb4c8aacac930d8a819b DIFF: https://github.com/llvm/llvm-project/commit/d5c0f00e216aa6797499bb4c8aacac930d8a819b.dif

[clang] 6823af0 - [HIP] Support hipRTC in header

2021-04-17 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-17T11:34:52-04:00 New Revision: 6823af0ca858b54e09e5be61a19d067ccd0bd6b7 URL: https://github.com/llvm/llvm-project/commit/6823af0ca858b54e09e5be61a19d067ccd0bd6b7 DIFF: https://github.com/llvm/llvm-project/commit/6823af0ca858b54e09e5be61a19d067ccd0bd6b7.dif

[clang] d880557 - [CUDA][HIP] Allow non-ODR use of host var in device

2021-04-19 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-19T14:45:24-04:00 New Revision: d8805574c183484f02855fa82d2e8932415e URL: https://github.com/llvm/llvm-project/commit/d8805574c183484f02855fa82d2e8932415e DIFF: https://github.com/llvm/llvm-project/commit/d8805574c183484f02855fa82d2e8932415e.dif

[clang] 5a2d78b - [HIP] Add option -fgpu-inline-threshold

2021-04-21 Thread Yaxun Liu via cfe-commits
Author: Yaxun (Sam) Liu Date: 2021-04-21T17:18:18-04:00 New Revision: 5a2d78b1639738fbde85248413c1cfd2df55683a URL: https://github.com/llvm/llvm-project/commit/5a2d78b1639738fbde85248413c1cfd2df55683a DIFF: https://github.com/llvm/llvm-project/commit/5a2d78b1639738fbde85248413c1cfd2df55683a.dif

<    8   9   10   11   12   13   14   15   16   17   >