[PATCH] D123441: [CUDA][HIP] Fix host used external kernel in archive

2022-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG0424b5115cff: [CUDA][HIP] Fix host used external kernel in archive (authored by yaxunl). Herald added a proj

[PATCH] D123946: [CUDA][HIP] Fix gpu.used.external

2022-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, jhuber6. Herald added a subscriber: mattd. Herald added a project: All. yaxunl requested review of this revision. Rename gpu.used.external as __clang_gpu_used_external as ptxas does not allow . in global variable name. Fixes: https://git

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/Driver.cpp:3885-3888 + bool UseNewOffloadingDriver = + C.isOffloadingHostKind(C.getActiveOffloadKinds()) && + (Args.hasArg(options::OPT_foffload_new_driver) || + Args.hasArg(options::OPT_fopenmp_new_drive

[PATCH] D123946: [CUDA][HIP] Fix gpu.used.external

2022-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcac4e2fe2582: [CUDA][HIP] Fix gpu.used.external (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123946/new

[PATCH] D123976: [CUDA][HIP] Fix delete operator for -fopenmp

2022-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: mattd, guansong. Herald added a project: All. yaxunl requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. When new operator is called in OpenMP parallel regi

[PATCH] D123976: [CUDA][HIP] Fix delete operator for -fopenmp

2022-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 423515. yaxunl added a comment. remove redundant casts. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123976/new/ https://reviews.llvm.org/D123976 Files: clang/lib/Sema/SemaExprCXX.cpp clang/test/SemaCUDA/openmp-parallel.cu Index: clang/test/S

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. should we have a test to show the effect of -foffload-new-driver on -ccc-print-phases for CUDA/HIP? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123325/new/ https://reviews.llvm.org/D123325 ___

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. need a CodeGenCUDA test for the registering. Also need a Driver test for the subcommands. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123812/new/ https://reviews.llvm.org/D123812 _

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Also, I am wondering whether we should document the new embedding scheme: section names, symbol names, entries, etc, if it has not bee done. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123812/new/ https://reviews.llvm.org

[PATCH] D123313: [OpenMP] Make clang argument handling for the new driver more generic

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6949-6952 +CmdArgs.push_back(Args.MakeArgString( +"-fembed-offload-object=" + File + "," + +Action::GetOffloadKindName(OffloadAction->getOffloadingDeviceKind()) + +"," + TC

[PATCH] D123313: [OpenMP] Make clang argument handling for the new driver more generic

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6949-6952 +CmdArgs.push_back(Args.MakeArgString( +"-fembed-offload-object=" + File + "," + +Action::GetOffloadKindName(OffloadAction->getOffloadingDeviceKind()) + +"," + TC

[PATCH] D123976: [CUDA][HIP] Fix delete operator for -fopenmp

2022-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG800f26386cd9: [CUDA][HIP] Fix delete operator for -fopenmp (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorep

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/linker-wrapper-image.c:32 +// RUN: %clang -cc1 %s -emit-obj -o %t.o \ +// RUN: -fembed-offload-object=%S/Inputs/dummy-elf.o,cuda,nvptx64-nvida-cuda,sm_70 +// RUN: clang-linker-wrapper --print-wrapped-module --dry-run

[PATCH] D124151: [clang][HIP] Updating driver to enable archive/bitcode to bitcode linking when targeting HIPAMD toolchain

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124151/new/ https://reviews.llvm.org/D124151 __

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: mattd. Herald added a project: All. yaxunl requested review of this revision. This patch is a continuation of https://reviews.llvm.org/D123353. Not only kernels in anonymous namespace, but also template kernels

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11322 + } else if (Context.getLangOpts().CUDA && Context.getLangOpts().CUDAIsDevice && + !IgnoreCUDAGlobalAttr) { // Device-side functions with __glo

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 424280. yaxunl marked an inline comment as done. yaxunl added a comment. use static function CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124189/new/ https://reviews.llvm.org/D124189 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/CodeGen

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:12300 + (D->hasAttr() && + GetGVALinkageForFunction(cast(D), + /*IgnoreCUDAGlobalAttr=*/true) == tra wrote: > yaxunl wrote: > > tra wrote: >

[PATCH] D118876: [HIPSPV] Fix literals are mapped to Generic address space

2022-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118876/new/ https://reviews.llvm.org/D118876 __

[PATCH] D118949: [HIP] Support code object v5

2022-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, b-sumner. Herald added subscribers: dang, kerbowa, jvesely. yaxunl requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. New device library supporting v4 and v5 has abi_version_400.bc a

[PATCH] D118949: [HIP] Support code object v5

2022-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. Will revise as recommended when committing. Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118949/new/ https://reviews.llvm.org/D118949 ___ cfe-commits mailing list cfe-c

[PATCH] D118949: [HIP] Support code object v5

2022-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGd4e4ef2e81e0: [HIP] Support code object v5 (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, b-sumner. Herald added subscribers: dang, kerbowa, t-tye, tpr, dstuttard, jvesely, kzhuravl. yaxunl requested review of this revision. Herald added a subscriber: wdng. code object version determines ABI, therefore should not be mixed. Th

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:575 +// times 100. +if (getTarget().getTargetOpts().CodeObjectVersion != "none") { + unsigned CodeObjVer; tra wrote: > When will it ever be set to `none`? Does the new opti

[PATCH] D118876: [HIPSPV] Fix literals are mapped to Generic address space

2022-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a subscriber: tstellar. yaxunl added a comment. In D118876#3295958 , @linjamaki wrote: > Thanks for the review, @yaxunl. Could you push this to the LLVM? And to the > LLVM 14 release branch too, if possible? Sure. @tstellar What is the curr

[PATCH] D118876: [HIPSPV] Fix literals are mapped to Generic address space

2022-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG171da443d598: [HIPSPV] Fix literals are mapped to Generic address space (authored by yaxunl). Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:575 +// times 100. +if (getTarget().getTargetOpts().CodeObjectVersion != "none") { + unsigned CodeObjVer; tra wrote: > yaxunl wrote

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 406221. yaxunl marked an inline comment as done. yaxunl added a comment. marshalling the arg as enum. fix test failures for -cc1as. temporarily disable it except v5. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119026/new/ https://reviews.llvm.org/

[PATCH] D118876: [HIPSPV] Fix literals are mapped to Generic address space

2022-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. It has been cherry-picked to 14.x by 02d5b112 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118876/new/ https://reviews.llvm.org/D118876 ___

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Driver/Options.td:3445 def mcode_object_version_EQ : Joined<["-"], "mcode-object-version=">, Group, - HelpText<"Specify code object ABI version. Defaults to 4. (AMDGPU only)"

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 406536. yaxunl marked 2 inline comments as done. yaxunl added a comment. add a test for -cc1as CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119026/new/ https://reviews.llvm.org/D119026 Files: clang/include/clang/Basic/TargetOptions.h clang/incl

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:1166 CmdArgs.insert(CmdArgs.begin() + 1, "-mllvm"); +// -cc1as does not need -mcode-object-version option. +if (!IsCC1As) tra wro

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 406605. yaxunl marked 2 inline comments as done. yaxunl added a comment. fix comments and add a driver test for -cc1as CHANGES SINCE LAST ACTION https://reviews.llvm.org/D119026/new/ https://reviews.llvm.org/D119026 Files: clang/include/clang/Basic/Targ

[PATCH] D119026: [HIP] Emit amdgpu_code_object_version module flag

2022-02-08 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1d97cb1f6e44: [HIP] Emit amdgpu_code_object_version module flag (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm

[PATCH] D119615: [CUDA][HIP] Do not promote constexpr var with non-constant initializer

2022-02-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. constexpr var may be initialized with address of non-const variable. In this case the initializer is not constant in device compilation. This has been handled for const vars but not for constexpr

[PATCH] D119615: [CUDA][HIP] Do not promote constexpr var with non-constant initializer

2022-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:148-150 + if ((Var->isConstexpr() || Var->getType().isConstQualified()) && + Var->hasAttr() && !hasExplicitAttr(Var)) tra wrote: > So the i

[PATCH] D119615: [CUDA][HIP] Do not promote constexpr var with non-constant initializer

2022-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG73b22935a7a8: [CUDA][HIP] Do not promote constexpr var with non-constant initializer (authored by yaxunl). H

[PATCH] D119207: [CUDA][SPIRV] Assign global address space to CUDA kernel arguments

2022-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:10322 ABIArgInfo SPIRVABIInfo::classifyKernelArgumentType(QualType Ty) const { - if (getContext().getLangOpts().HIP) { + if (getContext().getLangOpts().CUDAIsDevice) { // Coerce pointer arguments w

[PATCH] D120070: [HIP] Support linking archive of bundled bitcode

2022-02-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. HIP programs compiled with -c -fgpu-rdc generate clang-offload-bundler bundles which contain bitcode for different GPU's. Such files can be archived to an archive file which can be linked with HI

[PATCH] D120070: [HIP] Support linking archive of bundled bitcode

2022-02-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/Driver/hip-link-bundle-archive.hip:3 + +// RUN: touch %T/libhipBundled.a + tra wrote: > Is this file necessary? `clang -###` should not need the file to be present > in

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:12300 + (D->hasAttr() && + GetGVALinkageForFunction(cast(D), + /*IgnoreCUDAGlobalAttr=*/true) == tra wrote: > yaxunl wrote: > > tra wrote: >

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 424364. yaxunl added a comment. use basicGVALinkageForFunction CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124189/new/ https://reviews.llvm.org/D124189 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/CodeGenModule.cpp clang/test/CodeGe

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 7 inline comments as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/device-var-linkage.cu:1-2 // RUN: %clang_cc1 -no-opaque-pointers -triple nvptx -fcuda-is-device \ // RUN: -emit-llvm -o - -x hip %s \ // RUN: | FileCheck -check-prefix

[PATCH] D124189: [CUDA][HIP] Externalize kernels with internal linkage

2022-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked 3 inline comments as done. Closed by commit rG04fb81674ed7: [CUDA][HIP] Externalize kernels with internal linkage (authored by yaxunl). Herald added a pro

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 7 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/AST/ASTContext.h:682 +/// Current name mangling is for device name in host compilation. +bool MangleDeviceNameInHostCompilation = false; + } CUDANameMangleCtx;

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 424688. yaxunl marked 5 inline comments as done. yaxunl added a comment. Revised by Artem's and Reid's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122734/new/ https://reviews.llvm.org/D122734 Files: clang/include/clang/AST/ASTContext.h

[PATCH] D124396: [HIP] Fix diag msg about sanitizer

2022-04-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: kerbowa, jvesely. Herald added a project: All. yaxunl requested review of this revision. Fix the misleading diag msg as the option is ignored for a particular offload arch only. https://reviews.llvm.org/D12439

[PATCH] D124396: [HIP] Fix diag msg about sanitizer

2022-04-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/DiagnosticDriverKinds.td:113-114 def warn_drv_unsupported_option_for_offload_arch_req_feature : Warning< - "ignoring '%0' option as it is not currently supported for " -

[PATCH] D124396: [HIP] Fix diag msg about sanitizer

2022-04-26 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rGc89433d7fa10: [HIP] Fix diag msg about sanitizer (authored by yaxunl). Herald added a project: clang. Chang

[PATCH] D124466: [CUDA][HIP] Fix linkage of __clang_gpu_used_external

2022-04-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: mattd. Herald added a project: All. yaxunl requested review of this revision. Different TU's may have this globl var. appending linkage can only be used with lld recognized special variables. Change it to inter

[PATCH] D124466: [CUDA][HIP] Fix linkage of __clang_gpu_used_external

2022-04-26 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG57a210e5b705: [CUDA][HIP] Fix linkage of __clang_gpu_used_external (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.l

[PATCH] D124545: [HIP] Add HIP runtime library arguments for linker

2022-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a project: All. yaxunl requested review of this revision. Herald added a subscriber: MaskRay. Add -L -l options for linker. https://reviews.llvm.org/D124545 Files: clang/include/clang/Driver/Options.td clang/include/cl

[PATCH] D124545: [HIP] Add HIP runtime library arguments for linker

2022-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/Linux.cpp:681 + ArgStringList &CmdArgs) const { + CmdArgs.push_back( + Args.MakeArgString(StringRef("-L") + RocmInstallation.getLib

[PATCH] D123313: [OpenMP] Make clang argument handling for the new driver more generic

2022-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123313/new/ https://reviews.llvm.org/D123313 __

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. need a test for the generated registration code Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:98-104 + // struct __tgt_image_info { + // int32_t version; + // int32_t image_number; + // int32_t number_images; + // char* off

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:98-104 + // struct __tgt_image_info { + // int32_t version; + // int32_t image_number; + // int32_t number_images; + // char* offload_arch; + // char* target_compile_opts

[PATCH] D124545: [HIP] Add HIP runtime library arguments for linker

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG062317f72ebf: [HIP] Add HIP runtime library arguments for linker (authored by yaxunl). Herald added a projec

[PATCH] D123325: [Clang] Make enabling the new driver more generic

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123325/new/ https://reviews.llvm.org/D123325 __

[PATCH] D124525: [OpenMP][ClangLinkerWrapper] Extending linker wrapper to embed metadata for multi-arch fat binaries

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/tools/clang-linker-wrapper/OffloadWrapper.cpp:98-104 + // struct __tgt_image_info { + // int32_t version; + // int32_t image_number; + // int32_t number_images; + // char* offload_arch; + // char* target_compile_opts

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122734/new/ https://reviews.llvm.org/D122734 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG11d3e31c60bd: [CUDA][HIP] Fix mangling number for local struct (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Mon

[PATCH] D124842: [NFC][CUDA][HIP] rework mangling number for aux target

2022-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: mattd, carlosgalvezp. Herald added a project: All. yaxunl requested review of this revision. CUDA/HIP needs to mangle for aux target. When mangling for aux target, the mangler should use mangling number for aux t

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/include/clang/AST/ASTContext.h:682 +/// Current name mangling is for device name in host compilation. +bool MangleDeviceNameInHostCompilation = false; + } CUDANameMangleCtx;

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a reviewer: aaron.ballman. Herald added subscribers: mattd, carlosgalvezp, dexonsmith. Herald added a project: All. yaxunl requested review of this revision. CUDA/HIP programs use `__noinline__` like a keyword e.g. `__noinlin

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 426794. yaxunl added a comment. add feature cuda_noinline_keyword to facilitate CUDA/HIP headers removing __noinline__ macro CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124866/new/ https://reviews.llvm.org/D124866 Files: clang/include/clang/Bas

[PATCH] D124842: [NFC][CUDA][HIP] rework mangling number for aux target

2022-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11770-11778 + if (!LangOpts.CUDA || LangOpts.CUDAIsDevice) { +assert(!ForAuxTarget && "Only CUDA/HIP host compilation supports mangling " +

[PATCH] D124842: [NFC][CUDA][HIP] rework mangling number for aux target

2022-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG62501bc45a2f: [NFC][CUDA][HIP] rework mangling number for aux target (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://review

[PATCH] D123812: [CUDA] Add wrapper code generation for registering CUDA images

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123812/new/ https://reviews.llvm.org/D123812 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi

[PATCH] D125050: [OpenMP] Try to Infer target triples using the offloading architecture

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/Driver.cpp:789 + (C.getInputArgs().hasArg(options::OPT_fopenmp_targets_EQ) || + C.getInputArgs().hasArg(options::OPT_offload_arch_EQ)); + if (IsOpenMPOffloading) { probably should be C.getInp

[PATCH] D125050: [OpenMP] Try to Infer target triples using the offloading architecture

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. could you please add a test to https://github.com/llvm/llvm-project/blob/main/clang/test/Driver/hip-offload-arch.hip to make sure when -fopenmp is specified, no openmp offloading is performed? Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/Attr.td:1778-1779 def NoInline : DeclOrStmtAttr { - let Spellings = [GCC<"noinline">, CXX11<"clang", "noinline">, + let Spellings = [Keyword<"__noinline__">, GCC<"noinl

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 427685. yaxunl marked 4 inline comments as done. yaxunl added a comment. revised by Aaron's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124866/new/ https://reviews.llvm.org/D124866 Files: clang/include/clang/Basic/Attr.td clang/includ

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/Features.def:274 +// CUDA/HIP Features +FEATURE(cuda_noinline_keyword, true) + aaron.ballman wrote: > yaxunl wrote: > > aaron.ballman wrote: > > > Do the

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 427700. yaxunl marked an inline comment as done. yaxunl added a comment. added release note and documentation CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124866/new/ https://reviews.llvm.org/D124866 Files: clang/docs/ReleaseNotes.rst clang/inc

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D124866#3497439 , @tra wrote: >> CUDA/HIP do not have language spec. > > Well. It's not completely true. CUDA programming guide does serve as the > de-facto spec for CUDA. It's far from perfect, but it does mention > `__noinli

[PATCH] D129435: [Clang] Parse toolchain-specific offloading arguments directly

2022-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. need a test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129435/new/ https://reviews.llvm.org/D129435 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D129435: [Clang] Parse toolchain-specific offloading arguments directly

2022-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129435/new/ https://reviews.llvm.org/D129435 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D128914#3642567 , @jhuber6 wrote: > In D128914#3642558 , > @JonChesterfield wrote: > >> Code looks good to me. It's hard to be sure whether it works without running >> a bunch of hip t

[PATCH] D128914: [HIP] Add support for handling HIP in the linker wrapper

2022-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D128914#3643270 , @jhuber6 wrote: >> There is only one fatbin for -fgpu-rdc mode but the fatbin unregister >> function is called multiple times in each TU. HIP runtime expects each >> fatbin is unregistered only once. The old

[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang

2022-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. There is no constant propagation for globals with weak linage, right? Otherwise, it won't work. My concern is that there may be optimization passes which do not respect the weak linkage and uses the incorrect default value for OpenCL or HIP. Therefore I am not very confi

[PATCH] D130168: [CUDA] remove duplicate condition

2022-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130168/new/ https://reviews.llvm.org/D130168 __

[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang

2022-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D130096#3663411 , @arsenm wrote: > In D130096#3663398 , @jhuber6 wrote: > >> In D130096#3663295 , @yaxunl wrote: >> >>> There is no constant pro

[PATCH] D130096: [Clang][AMDGPU] Emit AMDGPU library control constants in clang

2022-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9480 + AddGlobal("__oclc_ISA_version", Minor + Major * 1000, 32); + AddGlobal("__oclc_ABI_version", 400, 32); +} jhuber6 wrote: > yaxunl wrote: > > should be determined by the code objec

[PATCH] D129784: [HIP] Allow the new driver to compile HIP in non-RDC mode

2022-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129784/new/ https://reviews.llvm.org/D129784 __

[PATCH] D130168: [CUDA] remove duplicate condition

2022-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D130168#3667283 , @VitalyR wrote: > @yaxunl Hi! Could you commit this on my behalf? I read the documentation and > it seems the appropriate way to commit changes for a newcomer not having > commit access like me. My name is "V

[PATCH] D130168: [CUDA] remove duplicate condition

2022-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGeffe79993f8e: [CUDA] remove duplicate condition (authored by VitalyR, committed by yaxunl). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130168/new/ https:

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D124866#3500761 , @aaron.ballman wrote: > Should we do `__forceinline__` at the same time so that there's consistency? `__forceinline__` does not have the issue as `__noinline__` has since it is not a GCC attribute. The curre

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added a comment. In D124866#3501203 , @aaron.ballman wrote: >> `__forceinline__` does not have the issue as `__noinline__` has since it is >> not a GCC attribute. The current CUDA/HIP implementation of >>

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 428167. yaxunl marked 2 inline comments as done. yaxunl added a comment. removed diagnostics and added more tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124866/new/ https://reviews.llvm.org/D124866 Files: clang/docs/ReleaseNotes.rst clang

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/docs/ClangOffloadBinary.rst:15 +metadata. We use a custom binary format for bundling all the device images +together. The image format is a small header wrapping around a string map. This +tool creates bundled binaries so that they

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/docs/ReleaseNotes.rst:344-345 -CUDA Language Changes in Clang +CUDA/HIP Language Changes in Clang -- aaron.ballman wrote: > will fix =

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/noinline.cu:8 +__attribute__((noinline)) void fun2() { } +__attribute__((__noinline__)) void fun3() { } aaron.ballman wrote: > yaxunl wrote: > > aaron.ballman w

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 428423. yaxunl marked an inline comment as done. yaxunl added a comment. make it a feature, add tests for pedantic, fix release notes and doecumentation CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124866/new/ https://reviews.llvm.org/D124866 Files

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rGafc9d674fe5a: [CUDA][HIP] support __noinline__ as keyword (authored by yaxunl). Herald added a project: clan

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Basic/IdentifierTable.cpp:111 KEYSYCL = 0x100, +KEYCUDA = 0x200, KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20, delcypher wrote: > @yaxunl Is it intentional that you didn't update `K

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Basic/IdentifierTable.cpp:111 KEYSYCL = 0x100, +KEYCUDA = 0x200, KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20, delcypher wrote: > yaxunl wrote: > > delcypher wrote: > > > @yaxunl Is

[PATCH] D125396: [clang] Fix KEYALL

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: delcypher, aaron.ballman, tra, rsmith. Herald added a project: All. yaxunl requested review of this revision. Introduce KEYMAX and a generic way to update KEYALL. https://reviews.llvm.org/D125396 Files: clang/lib/Basic/IdentifierTable.cpp

[PATCH] D124866: [CUDA][HIP] support __noinline__ as keyword

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Basic/IdentifierTable.cpp:111 KEYSYCL = 0x100, +KEYCUDA = 0x200, KEYALLCXX = KEYCXX | KEYCXX11 | KEYCXX20, yaxunl wrote: > delcypher wro

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125165#3506448 , @thakis wrote: > We could add a "clang-offload-bundler and clang-offload-wrapper are > deprecated, replace them with $whatever" in the release notes and then remove > them a release later, assuming the replac

[PATCH] D125396: [clang] Fix KEYALL

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125396#3506478 , @delcypher wrote: > @yaxunl Thanks for addressing my feedback so quickly. I think the commit > message should also mention that `KEYCUDA` is now included in `KEYALL`. Other > than that LGTM. will do when com

<    6   7   8   9   10   11   12   13   14   15   >