[PATCH] D79237: [CUDA][HIP] Fix constexpr variables for C++17

2020-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 264329. yaxunl edited the summary of this revision. yaxunl added a comment. add implicit constant attribute to constexpr file scope variables and constexpr static data members in device compilation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79237

[PATCH] D79237: [CUDA][HIP] Fix constexpr variables for C++17

2020-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/constexpr-variables.cu:30-31 + static constexpr int c = sizeof(a); + a[0] = &b; + a[1] = &c; + foo(a); tra wrote: > Can we verify the diags for bad cases, t

[PATCH] D79237: [CUDA][HIP] Fix constexpr variables for C++17

2020-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/constexpr-variables.cu:30-31 + static constexpr int c = sizeof(a); + a[0] = &b; + a[1] = &c; + foo(a); tra wrote: > yaxunl wrote: > > tra wrote: > > > Can w

[PATCH] D79237: [CUDA][HIP] Fix constexpr variables for C++17

2020-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D79237#2039757 , @rsmith wrote: > In D79237#2039559 , @tra wrote: > > > In D79237#2039417 , @tra wrote: >

[PATCH] D79237: [CUDA][HIP] Fix constexpr variables for C++17

2020-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 264394. yaxunl marked an inline comment as done. yaxunl added a comment. fix constexpr var in templates CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79237/new/ https://reviews.llvm.org/D79237 Files: clang/include/clang/Sema/Sema.h clang/lib/Sem

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added a comment. In D79967#2039153 , @dblaikie wrote: > Could you check the commit history for this feature and rope in some folks > who added the function declaration work (it's for debug call sites) - mayb

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 264622. yaxunl marked 2 inline comments as done. yaxunl added a comment. Fix the tests and move the logic to CGDebugInfo::EmitFuncDeclForCallSite to make it clearer. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79967/new/ https://reviews.llvm.org/D

[PATCH] D39739: [HCC] Add flag to Import Weak Functions in Function Importer

2017-12-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Transforms/IPO/FunctionImport.cpp:107 +static cl::opt +ForceImportWeak("force-import-weak", cl::Hidden, +cl::desc("Allow weak functions to be imported"), Is it possible not to expose this option throug

[PATCH] D40806: CodeGen: Fix invalid bitcasts for memcpy

2017-12-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added a subscriber: nhaehnle. CreateCoercedLoad/CreateCoercedStore assumes pointer argument of memcpy is in addr space 0, which is not correct and causes invalid bitcasts for triple amdgcn---amdgiz. It is fixed by using alloca addr space instead. https://rev

[PATCH] D40838: [OpenCL] Fix layering violation by getOpenCLTypeAddrSpace

2017-12-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:41 uint32_t AddrSpc = CGM.getContext().getTargetAddressSpace( - CGM.getTarget().getOpenCLTypeAddrSpace(T)); + CGM.getTarget().getOpenCLTypeAddrSpace(TK)); switch (cast(T)->getKind()) { -

[PATCH] D40838: [OpenCL] Fix layering violation by getOpenCLTypeAddrSpace

2017-12-05 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! https://reviews.llvm.org/D40838 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D39739: [HCC] Add flag to Import Weak Functions in Function Importer

2017-12-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Transforms/IPO/FunctionImport.cpp:107 +static cl::opt +ForceImportWeak("force-import-weak", cl::Hidden, +cl::desc("Allow weak functions to be imported"), AlexVlx wrote: > yaxunl wrote: > > Is it possib

[PATCH] D39739: [HCC] Add flag to Import Weak Functions in Function Importer

2017-12-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D39739#945318, @b-sumner wrote: > The usual rule is to take the first weak definition encountered. Will this work for us? Usually we would like the last one to be linked. Repository: rL LLVM https://reviews.llvm.org/D39739

[PATCH] D40806: CodeGen: Fix invalid bitcasts for memcpy

2017-12-06 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL32: CodeGen: Fix invalid bitcasts for memcpy (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D40806?vs=125417&id=125863#toc Repository: rL LLVM https://reviews.llvm.org/D

[PATCH] D40956: [AMDGPU] Switch to the new addr space mapping by default for clang

2017-12-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added subscribers: t-tye, tpr, dstuttard, nhaehnle, wdng, kzhuravl. Will clean up the old addr space mapping in separate patch. https://reviews.llvm.org/D40956 Files: lib/Basic/Targets/AMDGPU.cpp lib/Basic/Targets/AMDGPU.h test/CodeGen/address-space.c

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

2022-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9436 +CGM.getModule(), Type, true, +llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage, +llvm::ConstantInt::get(Type, Value), Name, nullptr, jhuber6 wrote: > yaxun

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

2022-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9436 +CGM.getModule(), Type, true, +llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage, +llvm::ConstantInt::get(Type, Value), Name, nullptr, yaxunl wrote: > jhuber

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

2022-08-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9436 +CGM.getModule(), Type, true, +llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage, +llvm::ConstantInt::get(Type, Value), Name, nullptr, jhuber6 wrote: > yaxun

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

2022-08-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9436 +CGM.getModule(), Type, true, +llvm::GlobalValue::LinkageTypes::LinkOnceODRLinkage, +llvm::ConstantInt::get(Type, Value), Name, nullptr, jhuber6 wrote: > yaxun

[PATCH] D132689: [Object] Refactor code for extracting offload binaries

2022-09-01 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/D132689/new/ https://reviews.llvm.org/D132689 __

[PATCH] D133133: [CUDA] Allow using -o with -fsyntax-only

2022-09-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/cuda-bindings.cu:99 +// SYN-DAG: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing) // // Test two gpu architectures up to the assemble phase. should we check there is no binding f

[PATCH] D131465: C++/ObjC++: switch to gnu++17 as the default standard

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

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 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. HIP is able to unbundle archive of bundled bitcode. However currently there are two bugs: 1. archives passed by -l: are not unbundled. 2. archives passed as input fi

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 459482. yaxunl added a comment. Herald added subscribers: sstefan1, MaskRay. Herald added a reviewer: jdoerfert. sorry. update with the correct patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133705/new/ https://reviews.llvm.org/D133705 Files:

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 459484. yaxunl added a comment. remove debug output CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133705/new/ https://reviews.llvm.org/D133705 Files: clang/lib/Driver/Driver.cpp clang/lib/Driver/ToolChains/CommonArgs.cpp clang/test/Driver/hip-

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 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/CommonArgs.cpp:1959 + if (FoundAOB) +break; } scchan wrote: > The AOBFileNames small vector needs to be cleared if !FoundAOB or just m

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 459502. yaxunl marked an inline comment as done. yaxunl added a comment. revised by Siu Chi's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D133705/new/ https://reviews.llvm.org/D133705 Files: clang/lib/Driver/Driver.cpp clang/lib/Driver

[PATCH] D133705: [HIP] Fix unbundling archive

2022-09-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D133705#3784605 , @tra wrote: >> Archives passed by -l: should not be prefixed with >> prefix lib and appended with '.a', but still need to be prefixed with >> paths in -L options. >> Archives passed as input files should not

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:717 AMDGPUToolChain::getGPUArch(const llvm::opt::ArgList &DriverArgs) const { - return getProcessorFromTargetID( - getTriple(), DriverArgs.getLastArgValue(options::OPT_mcpu_EQ)); + if (Driver

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:717 AMDGPUToolChain::getGPUArch(const llvm::opt::ArgList &DriverArgs) const { - return getProcessorFromTargetID( - getTriple(), DriverArgs.getLastArgValue(options::OPT_mcpu_EQ)); + if (Driver

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:717 AMDGPUToolChain::getGPUArch(const llvm::opt::ArgList &DriverArgs) const { - return getProcessorFromTargetID( - getTriple(), DriverArgs.getLastArgValue(options::OPT_mcpu_EQ)); + if (Driver

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:720-722 + if (DriverArgs.hasArg(options::OPT_march_EQ)) +return getProcessorFromTargetID( +getTriple(), DriverArgs.getLastArgValue(options::OPT_march_EQ)); It seems the

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/include/clang/Driver/ToolChain.h:719 virtual llvm::SmallVector - getHIPDeviceLibs(const llvm::opt::ArgList &Args) const; + getROCmDeviceLibs(const llvm::opt::ArgList &Args) const; HIPSPV toolchain is not impl

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/include/clang/Driver/ToolChain.h:719 virtual llvm::SmallVector - getHIPDeviceLibs(const llvm::opt::ArgList &Args) const; + getAMDGPUDeviceLibs(const llvm::opt::ArgList &Args) const; well, HIPSPV toolchain is

[PATCH] D133726: [OpenMP][AMDGPU] Link bitcode ROCm device libraries per-TU

2022-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/include/clang/Driver/ToolChain.h:719 virtual llvm::SmallVector - getHIPDeviceLibs(const llvm::opt::ArgList &Args) const; + getAMDGPUDeviceLibs(const llvm::opt::ArgList &Args) const; jhuber6 wrote: > yaxunl wr

[PATCH] D128850: [HIP] Generate offloading entries for HIP with the new driver.

2022-07-05 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/D128850/new/ https://reviews.llvm.org/D128850 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D128923: [LinkerWrapper] Add AMDGPU specific options to the LLD invocation

2022-07-05 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/D128923/new/ https://reviews.llvm.org/D128923 __

[PATCH] D129301: [clang-offload-bundler][NFC] Library-ize ClangOffloadBundler (1/4)

2022-07-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I feel it is better to do the refactoring in one patch, since it is difficult to maintain the integrity of 4 patches. It would be easier to revert or cherry-pick the change. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D129

[PATCH] D129301: [clang-offload-bundler][NFC] Library-ize ClangOffloadBundler (1/4)

2022-07-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D129301#3637664 , @jhuber6 wrote: > In D129301#3637642 , @jdoerfert > wrote: > >> Isn't the offload bundler on it's "way out" (=replaced and then deleted >> soon)? > > HIP still uses i

[PATCH] D129301: [clang-offload-bundler][NFC] Library-ize ClangOffloadBundler (1/4)

2022-07-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D129301#3637641 , @lamb-j wrote: > @yaxunl Are you recommending I combine all 4 patches down into 1 patch? Or > combine a subset of patches? I recommend combining all patches as one. Repository: rG LLVM Github Monorepo CH

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/include/clang/Sema/Sema.h:3325-3330 + /// getCurFunctionDecl - If parsing a lambda, then return the lambda + /// declaration if \p AllowLambda is true, otherwise return the function + ///

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-24 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 rGd41445113bcc: [CUDA][HIP] Fix hostness check with -fopenmp (authored by yaxunl). Herald added a project: cla

[PATCH] D121951: [AMDGPU][OpenCL] Add "amdgpu-no-hostcall-ptr" in Clang codegen pre-COV_5

2022-03-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:9381 + M.getTarget().getTargetOpts().CodeObjectVersion != 500) { +F->addFnAttr("amdgpu-no-hostcall-ptr"); + } scott.linder wrote: > arsenm wrote: > > sameerds wrote: > > > The fr

[PATCH] D121302: [HIP] Fix -fno-gpu-sanitize

2022-03-28 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/HIPAMD.cpp:165 // Diagnose unsupported sanitizer options only once. + if (!Args.hasFlag(options::OPT_fgpu_sanitize, options::OPT_fno_gpu_sanitize)) +return;

[PATCH] D120662: [clang-offload-bundler] add -input/-output options

2022-03-29 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/D120662/new/ https://reviews.llvm.org/D120662 __

[PATCH] D121951: [AMDGPU][OpenCL] Add "amdgpu-no-hostcall-ptr" in Clang codegen pre-COV_5

2022-03-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. In D121951#3411856 , @scott.linder wrote: > @yaxunl Does excluding device-libs via COV_None make sense? That should work. Hopefully, it can cover most spurious warnings. Repository: rG LLVM Gith

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

2022-03-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. Herald added a project: All. yaxunl requested review of this revision. MSVC and Itanium mangling use different mangling numbers for function-scope structs, which causes inconsistent mangled kernel names in device and host compila

[PATCH] D122781: This patch aims to conform AMDGPUOpenMP driver sanitizer changes w.r.t HIPAMD toolchain.

2022-03-31 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/D122781/new/ https://reviews.llvm.org/D122781 __

[PATCH] D122781: This patch aims to conform AMDGPUOpenMP driver sanitizer changes w.r.t HIPAMD toolchain.

2022-03-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is the OpenMP lit test missing? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122781/new/ https://reviews.llvm.org/D122781 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D122781: This patch aims to conform AMDGPUOpenMP driver sanitizer changes w.r.t HIPAMD toolchain.

2022-03-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. This patch can be retitled as "Refactor sanitizer options handling for AMDGPU Toolchain". Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D122781/new/ https://reviews.llvm.org/D122781 _

[PATCH] D122846: [CUDA] Don't call inferCUDATargetForImplicitSpecialMember too early.

2022-03-31 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/D122846/new/ https://reviews.llvm.org/D122846 __

[PATCH] D122781: Refactor sanitizer options handling for AMDGPU Toolchain

2022-04-01 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/D122781/new/ https://reviews.llvm.org/D122781 ___ cfe-commits mailing list cfe-commits@li

[PATCH] D121951: [AMDGPU][OpenCL] Remove "printf and hostcall" diagnostic

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

[PATCH] D123049: Emit OpenCL metadata when targeting SPIR-V

2022-04-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is this because your HIP threadIdx etc are implemented using OpenCL builtins so that the emitted LLVM IR contains calls of OpenCL builtins? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123049/new/ https://reviews.llvm.org/

[PATCH] D123049: Emit OpenCL metadata when targeting SPIR-V

2022-04-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM since currently there is only one HIP/SPIRV implementation. If in the future there is another HIP/SPIRV implementation that does not need this, it could disable it by triple. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D120662: [clang-offload-bundler] add -input/-output options

2022-04-05 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG09a5eae0d195: [clang-offload-bundler] add -input/-output options (authored by yaxunl). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120662/new/ https://rev

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

2022-04-06 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] D129873: [clang-offload-bundler] Library-ize ClangOffloadBundler

2022-07-26 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/D129873/new/ https://reviews.llvm.org/D129873 __

[PATCH] D131183: AMDGPU/clang: Remove dead code

2022-08-04 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. The scope arg to the builtin is a string. I doubt non-constant scope arg will ever get supported. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D131183/new/ https://rev

[PATCH] D106069: [HIP] Add test with_fopenmp.hip

2021-07-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, ashi1. Herald added subscribers: guansong, mgorny. yaxunl requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. Add a test to test-suite for testing std::isnan in host and device functi

[PATCH] D106070: [HIP] Remove workaround in __clang_hip_runtime_wrapper.h

2021-07-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, JonChesterfield, ronl, ashi1. yaxunl requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. Remove the workaround for -fopenmp in __clang_hip_runtime_wrapper.h since it causes device fun

[PATCH] D106070: [HIP] Remove workaround in __clang_hip_runtime_wrapper.h

2021-07-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Since this is not easily tested with lit tests, I added a test to llvm-test-suite: https://reviews.llvm.org/D106069 My understanding is that OpenMP no longer uses __clang_hip_runtime_wrapper.h, so we should be able to remove this workaround. CHANGES SINCE LAST ACTION

[PATCH] D106315: [HIP] Preserve ASAN bitcode library functions

2021-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, b-sumner. Herald added subscribers: kerbowa, nhaehnle, jvesely. yaxunl requested review of this revision. Address sanitizer passes may generate call of ASAN bitcode library functions after bitcode linking in lld, therefore lld cannot add t

[PATCH] D102507: [HIP] Support in device code

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

[PATCH] D106070: [HIP] Remove workaround in __clang_hip_runtime_wrapper.h

2021-07-21 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 rGdb5f100fe4ca: [HIP] Remove workaround in __clang_hip_runtime_wrapper.h (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Gi

[PATCH] D106069: [HIP] Add test with_fopenmp.hip

2021-07-21 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rTd9107edc1a4e: [HIP] Add test with_fopenmp.hip (authored by yaxunl). Repository: rT test-suite CHANGES SINCE LAST ACTION https://reviews.llvm.org/D106069/new/ https://reviews.llvm.org/D106069 Files:

[PATCH] D106571: [HIP] Fix visibility of __hip_fatbin

2021-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, ashi1, scchan. yaxunl requested review of this revision. In -fgpu-rdc case, fat binary is embedded as global variable __hip_fatbin. It needs to have protected visibility to avoid conflict between shared libraries. https://reviews.llvm.or

[PATCH] D106315: [HIP] Preserve ASAN bitcode library functions

2021-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D106315#2898536 , @tra wrote: > LGTM in general. > > One question -- does it have to be a function calling other functions just > for the sake of preserving them? > Can it be a flat array of pointers to the functions you need t

[PATCH] D106571: [HIP] Fix visibility of __hip_fatbin

2021-07-23 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 rG9a977daaf6b1: Fix __hip_fabin visibility (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE L

[PATCH] D106315: [HIP] Preserve ASAN bitcode library functions

2021-07-23 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 rG44dbbe61060a: [HIP] Preserve ASAN bitcode library functions (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://

[PATCH] D106315: [HIP] Preserve ASAN bitcode library functions

2021-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D106315#2900882 , @tra wrote: > In D106315#2899928 , @yaxunl wrote: > >> Yes that's possible. However that would require FE to know these functions >> and declare them, whereas the curr

[PATCH] D105981: [AMDGPU][OpenMP] Support linking of math libraries

2021-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:831-860 auto Kind = llvm::AMDGPU::parseArchAMDGCN(GpuArch); const StringRef CanonArch = llvm::AMDGPU::getArchNameAMDGCN(Kind); std::string LibDeviceFile = RocmInstallation.getLibDeviceFile(C

[PATCH] D105981: [AMDGPU][OpenMP] Support linking of math libraries

2021-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:831-860 auto Kind = llvm::AMDGPU::parseArchAMDGCN(GpuArch); const StringRef CanonArch = llvm::AMDGPU::getArchNameAMDGCN(Kind); std::string LibDeviceFile = RocmInstallation.getLibDeviceFile(C

[PATCH] D105981: [AMDGPU][OpenMP] Support linking of math libraries

2021-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:831-860 auto Kind = llvm::AMDGPU::parseArchAMDGCN(GpuArch); const StringRef CanonArch = llvm::AMDGPU::getArchNameAMDGCN(Kind); std::string LibDeviceFile = RocmInstallation.getLibDeviceFile(C

[PATCH] D120132: [HIP] Fix HIP include path

2022-03-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 414100. yaxunl added a comment. use -idirafter to include HIP include path CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120132/new/ https://reviews.llvm.org/D120132 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp clang/test/Driver/hip-include-pat

[PATCH] D120132: [HIP] Fix HIP include path

2022-03-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I found a simple fix. Use -idirafter instead of -isystem-internal. It is still system include path but will be added after all other system include paths. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120132/new/ https://reviews.llvm.org/D120132 ___

[PATCH] D121302: [HIP] Fix -fno-gpu-sanitize

2022-03-09 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. Fix a typo about -fno-gpu-sanitize handling and disable warnings when -fno-gpu-sanitize is specified. https://reviews.llvm.org/D121302 Files: clang/lib/Driver/Too

[PATCH] D120132: [HIP] Fix HIP include path

2022-03-09 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6730b44480fc: [HIP] Fix HIP include path (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D120132/new/ http

[PATCH] D121302: [HIP] Fix -fno-gpu-sanitize

2022-03-09 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 rGda9a70313d60: [HIP] Fix -fno-gpu-sanitize (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: carlosgalvezp, guansong. Herald added a project: All. yaxunl requested review of this revision. Herald added a reviewer: jdoerfert. Herald added a subscriber: sstefan1. CUDA/HIP determines whether a function can

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 416974. yaxunl added a comment. fix comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121765/new/ https://reviews.llvm.org/D121765 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/Sema.cpp clang/lib/Sema/SemaCUDA.cpp clang/lib/Sema

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/include/clang/Sema/Sema.h:3327-3328 + /// a pointer to the function or lambda decl for the function or lambda being + /// parsed if \p AllowLambda is true. If we're currently in a 'block',

[PATCH] D121765: [CUDA][HIP] Fix hostness check with -fopenmp

2022-03-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. ping CHANGES SINCE LAST ACTION https://reviews.llvm.org/D121765/new/ https://reviews.llvm.org/D121765 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

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

2022-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. This patch takes a similar approach as https://reviews.llvm.org/D69322 has done for lambda. When doing host compilation for CUDA/HIP on Windows with MSVC toolchain, mangling number of lambda always uses Itanium mangling number. In this case, mangling number of local stru

[PATCH] D123353: [CUDA][HIP] Externalize kernels in anonymous name space

2022-04-07 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. kernels in anonymous name space needs to have unique name to avoid duplicate symbols. Fixes: https://github.com/llvm/llvm-project/issues/54560 https://reviews.llvm.

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

2022-04-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D122734#3437344 , @tra wrote: > In D122734#3435086 , @yaxunl wrote: > >> This patch takes a similar approach as https://reviews.llvm.org/D69322 has >> done for lambda. When doing host c

[PATCH] D123387: [clang-offload-bundler] fix "no output file" issue with -outputs

2022-04-08 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. Does this mean without this fix clang-offload-bundler emits an error if -outputs option not given? How could the lit tests passed? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D123353: [CUDA][HIP] Externalize kernels in anonymous name space

2022-04-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/kernel-in-anon-ns.cu:13 + +// CHECK: define weak_odr {{.*}}void @[[KERN:_ZN12_GLOBAL__N_16kernelEv\.anon\..*]]( +// CHECK: @[[STR:.*]] = {{.*}} c"[[KERN]]\00" --

[PATCH] D123370: [CUDA/HIP] Remove argument from module ctor/dtor signatures

2022-04-08 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/D123370/new/ https://reviews.llvm.org/D123370 ___ cfe-commits mailing list cfe-commits@li

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

2022-04-08 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. For -fgpu-rdc, a host function may call an external kernel which is defined in an archive of bitcode. Since this external kernel is only referenced in host function, t

[PATCH] D123353: [CUDA][HIP] Externalize kernels in anonymous name space

2022-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/kernel-in-anon-ns.cu:13 + +// CHECK: define weak_odr {{.*}}void @[[KERN:_ZN12_GLOBAL__N_16kernelEv\.anon\..*]]( +// CHECK: @[[STR:.*]] = {{.*}} c"[[KERN]]\00" --

[PATCH] D123353: [CUDA][HIP] Externalize kernels in anonymous name space

2022-04-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 rG4ea1d435099f: [CUDA][HIP] Externalize kernels in anonymous name space (authored by yaxunl). Herald added a p

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

2022-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 422001. yaxunl retitled this revision from "[HIP] Fix mangling number for local struct" to "[CUDA][HIP] Fix mangling number for local struct". yaxunl edited the summary of this revision. yaxunl added a comment. Herald added a subscriber: carlosgalvezp. Use Ita

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is OpenMP runtime able to find these entries without registering them through some API functions? If so, do you have a pointer to the code doing that? most CUDA/HIP programs assume -fno-gpu-rdc mode, which have multiple sections containing these entries merged by linker,

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

2022-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D123441#3446408 , @tra wrote: > LGTM in principle. This will keep around the GPU code we do need. > > That said, it seems to be a rather blunt hammer. I think we'll end up linking > almost everything in an archive into the fina

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

2022-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D123441#3446478 , @tra wrote: >> This approach will only link in kernels and device variables used by host >> code > > In the absence of the explicit reference info from the host side, GPU-side > linker must link all objects

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

2022-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Also, I don't see the advantage of resolving this issue through toolchains. You still need to detect kernels and device variables referenced by host code, and generate IR's which introduce artificial references to them. It just becomes more complicated since you have to

[PATCH] D123471: [CUDA] Create offloading entries when using the new driver

2022-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. HIP is considering a unified device binary embedding scheme with OpenMP. However, some large MI frameworks are compiled with -fno-gpu-rdc. If compiling with -fgpu-rdc, the linking time will significantly increase since the post-linking optimizations take much longer time

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

2022-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D123441#3446719 , @tra wrote: > So, a main TU with just `__global__ void kernel();` would emit a reference > when it's compiled on the GPU side. That, in turn will tell the linker what

[PATCH] D123498: [clang] Adding Platform/Architecture Specific Resource Header Installation Targets

2022-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a subscriber: Anastasia. yaxunl added a comment. Pls add @Anastasia for OpenCL. LGTM for HIP. HIP headers depend on some of CUDA headers, but LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D123498/new/ https://reviews.llvm.org/D12

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