[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] 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 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 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 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 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] 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] 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] 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] 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] 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-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-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] D132607: [OffloadPackager] Add ability to extract mages from other file types

2022-08-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/tools/clang-offload-packager/ClangOffloadPackager.cpp:17-21 +#include "llvm/IR/Constants.h" +#include "llvm/IR/Module.h" +#include "llvm/IRReader/IRReader.h" +#include "llvm/Object/Archive.h" +#include "llvm/Object/ArchiveWriter.h"

[PATCH] D132248: [CUDA][OpenMP] Fix the new driver crashing on multiple device-only outputs

2022-08-23 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/D132248/new/ https://reviews.llvm.org/D132248 __

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

2022-08-22 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, This does not support

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn

2022-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9f6cb3e9fdb4: [AMDGPU] Add builtin s_sendmsg_rtn (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132140/ne

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn

2022-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 454607. yaxunl added a comment. remove unnecessary tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132140/new/ https://reviews.llvm.org/D132140 Files: clang/include/clang/Basic/BuiltinsAMDGPU.def clang/lib/CodeGen/CGBuiltin.cpp clang/test/

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn

2022-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/CodeGenOpenCL/builtins-amdgcn-gfx11.cl:23 + +// Test mismatched argument and return types are handled. + tra wrote: > Is there a particular reason for this test? > > Argument and return value type checks shoul

[PATCH] D132248: [CUDA][OpenMP] Fix the new driver crashing on multiple device-only outputs

2022-08-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D132248#3736295 , @tra wrote: > I'm OK with that. > > @yaxunl -- what are your thoughts on whether this approach would work for > HIP? On one hand HIP already has a lot of features that the new driver is > intended to provide,

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn_b{32|64}

2022-08-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 453681. yaxunl added a comment. revised by Brian's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132140/new/ https://reviews.llvm.org/D132140 Files: clang/include/clang/Basic/BuiltinsAMDGPU.def clang/lib/CodeGen/CGBuiltin.cpp clang/te

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn_b{32|64}

2022-08-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D132140#3732262 , @b-sumner wrote: > Following existing naming, it might make sense to rename "rtn_b32" --> "rtn" > and "rtn_b64" --> "rtnl". will modify. thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132140/

[PATCH] D132140: [AMDGPU] Add builtin s_sendmsg_rtn_b{32|64}

2022-08-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: b-sumner, arsenm, foad, kzhuravl, bcahoon. Herald added subscribers: kosarev, kerbowa, t-tye, tpr, dstuttard, jvesely. Herald added a project: All. yaxunl requested review of this revision. Herald added a subscriber: wdng. https://reviews.llvm.

[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] 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] 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] 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] 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] 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] 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] 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-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] 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] 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] 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] 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] 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] 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-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] 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] 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] D128022: [HIP] add -fhip-kernel-arg-name

2022-06-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 2 inline comments as done. Closed by commit rG8ad4c6e4b129: [HIP] add -fhip-kernel-arg-name (authored by yaxunl). Herald added a project: clang. Changed

[PATCH] D128022: [HIP] add -fhip-kernel-arg-name

2022-06-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:6353 CmdArgs.push_back("-fgpu-allow-device-init"); +if (Args.hasFlag(options::OPT_fhip_kernel_arg_name, + options::OPT_fno_hip_k

[PATCH] D128022: [HIP] add -fhip-kernel-arg-name

2022-06-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1845-1846 + } + if (getCodeGenOpts().EmitOpenCLArgMetadata || + getCodeGenOpts().HIPSaveKernelArgName) Fn->setMetadata("kernel_arg_name", ---

[PATCH] D128022: [HIP] add -fhip-kernel-arg-name

2022-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1845-1846 + } + if (getCodeGenOpts().EmitOpenCLArgMetadata || + getCodeGenOpts().HIPSaveKernelArgName) Fn->setMetadata("kernel_arg_name", ---

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D127142#3600809 , @MaskRay wrote: > Magically deciding a default value for --unwindlib or --rtlib is not nice. > You may emit a warning if the selected default happens to be incompatible > with HIP. We build clang not just fo

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 438709. yaxunl added a comment. add -unwindlib=libgcc by default for --hip-link since -rtlib=compiler-rt needs it CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127142/new/ https://reviews.llvm.org/D127142 Files: clang/lib/Driver/ToolChain.cpp c

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D127142#3590874 , @yaxunl wrote: > In D127142#3571260 , @MaskRay wrote: > >> In D127142#3570290 , @yaxunl wrote: >> >>> If I use --rtlib=compile

[PATCH] D128022: [HIP] add -fhip-kernel-arg-name

2022-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, b-sumner. Herald added a project: All. yaxunl requested review of this revision. Herald added a subscriber: MaskRay. Add option -fhip-kernel-arg-name to emit kernel argument name metadata, which is needed for certain HIP applications. ht

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D127142#3571260 , @MaskRay wrote: > In D127142#3570290 , @yaxunl wrote: > >> If I use --rtlib=compiler-rt, does that also requires --unwindlib=unwindlib ? > > No. --unwindlib=libunwind r

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 437587. yaxunl added a comment. use compiler-rt as runtime lib by default for --hip-link CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127142/new/ https://reviews.llvm.org/D127142 Files: clang/lib/Driver/ToolChain.cpp clang/test/Driver/hip-runti

[PATCH] D127771: [HIP] fix long double size

2022-06-14 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 rGaf9ee3357cec: [HIP] fix long double size (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D1

[PATCH] D127771: [HIP] fix long double size

2022-06-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D127771#3582640 , @tra wrote: > AFAICT, the test case you've added works fine with the compiler at HEAD: > https://cuda.godbolt.org/z/q3xYMfdeb > I guess it only shows up in assertion-enabled builds. Can you check what > happe

[PATCH] D127771: [HIP] fix long double size

2022-06-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: kosarev, kerbowa, tpr, jvesely. Herald added a project: All. yaxunl requested review of this revision. For amdgpu target long double type is the same as double type. The width and align of long double type was in

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D127142#3568905 , @MaskRay wrote: >> These functions are not available in libgcc but in libclang_rt.builtins. >> Therefore --hip-link needs to link with libclang_rt.builtins by default. > > I think this is problematic. > > The

[PATCH] D127267: [NVPTX] Add setAuxTarget override rather than make a new TargetInfo

2022-06-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. This patch is to fix an issue, right? At least we need a test to prevent that issue from happening again. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127267/new/ https://reviews.llvm.org/D127267 _

[PATCH] D127267: [NVPTX] Add setAuxTarget override rather than make a new TargetInfo

2022-06-08 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/D127267/new/ https://reviews.llvm.org/D127267 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 434807. yaxunl marked 3 inline comments as done. yaxunl edited the summary of this revision. yaxunl added a comment. use getCompilerRT to get compiler-rt lib path CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127142/new/ https://reviews.llvm.org/D127

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/MSVC.cpp:485 "amdhip64.lib"}); + CmdArgs.push_back(Args.MakeArgString("clang_rt.builtins-" + + getTriple().getA

[PATCH] D127142: [HIP] Link with clang_rt.builtins

2022-06-06 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. HIP supports _Float16 by default in host programs, which may cause calls of conversion functions for _Float16 emitted e.g. `__trunc

[PATCH] D126704: [HIP] Pass -Xoffload-linker option to device linker

2022-05-31 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG92a606f6de77: [HIP] Pass -Xoffload-linker option to device linker (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D126681: [HIP] Fix static lib name on windows

2022-05-31 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 rG377806a65ea9: [HIP] Fix static lib name on windows (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D126681

[PATCH] D126681: [HIP] Fix static lib name on windows

2022-05-31 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:1788 +for (auto Prefix : {"/libdevice/", "/"}) { + if (IsMSVC) { +AOBFileNames.push_back(Twine(LPath + Prefix + Lib + ".lib").str()); ---

[PATCH] D126704: [HIP] Pass -Xoffload-linker option to device linker

2022-05-31 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. Reuse -Xoffload-linker option for HIP toolchain. https://reviews.llvm.org/D126704 Files: clang/lib/Driver/ToolChains/HIPAMD.cp

[PATCH] D126681: [HIP] Fix static lib name on windows

2022-05-30 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. clang by default assumes static library name to be xxx.lib when -lxxx is specified on Windows with MSVC environment, instead of lib

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125904#3537952 , @tra wrote: > How much work would it take to add cuid generation in the new driver, similar > to what the old driver does, using the same logic, however imperfect it is? > I'd be OK with that as a possibly pe

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In HIP, kernels are represented by attribute `global` and not by calling convention in clang. This may be an alternative. Another alternative might be merging amdgpu_kernel and opencl_kernel calling convention since for the same target they are the same. They could be r

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); jhuber6 wrote: > yaxunl wrote: >

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); Are these options always the sam

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

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

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125970#3526053 , @JonChesterfield wrote: > In D125970#3525985 , @yaxunl wrote: > >> need a codegen test to make sure amdgpu_kernel ABI is used in C/C++ for >> functions with this attr

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. need a codegen test to make sure amdgpu_kernel ABI is used in C/C++ for functions with this attribute. https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu#L64 may be used as an example. Repository: rG LLVM Github Mo

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-19 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 rG559b8fc17ef6: [AMDGPU] emit macro __GFX9__ etc (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D125909?vs=

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-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. yaxunl marked an inline comment as done. Closed by commit rGcefe472c51fb: [clang] Fix __has_builtin (authored by yaxunl). Herald added a project: clang. Changed prior t

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Basic/Targets/AMDGPU.cpp:414 + assert(CanonName.startswith("gfx") && "Invalid amdgcn canonical name"); + Builder.defineMacro(Twine("__") + Twine(CanonName.drop_back(2).upper())

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:2555-2557 if (FeatureList.empty()) return; assert(!FeatureList.contains(' ') && "Space in feature list"); tra wrote: > Should

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: b-sumner, tra, arsenm. Herald added subscribers: kosarev, kerbowa, t-tye, tpr, dstuttard, jvesely, kzhuravl. Herald added a project: All. yaxunl requested review of this revision. Herald added a subscriber: wdng. Emit predefined macros for GPU

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 430420. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125829/new/ https://reviews.llvm.org/D125829 Files: clang/include/clang/Basic/Builtins.h clang/lib

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/Builtins.h:263 + ///false if it is disabled. + bool isRequiredTargetFeaturesEnabled( + unsigned BuiltinID, const llvm::StringMap &TargetFetureMap) const; --

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > yaxunl wrote: > >

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, aaron.ballman, rsmith. Herald added a project: All. yaxunl requested review of this revision. Fix `__has_builtin` to return 1 only if the requested target features of a builtin are enabled by refactoring the code for checking required targ

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125705#3519605 , @jhuber6 wrote: > In D125705#3519570 , @yaxunl wrote: > >> HIP toolchain allows clang driver to compile bundled bitcode or assembly for >> mixed host/device compilatio

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. HIP toolchain allows clang driver to compile bundled bitcode or assembly for mixed host/device compilation or device-only multi-GPU compilation. e.g. clang --offload-arch=gfx906 --offload-arch=gfx908 a.bc b.s Can you add a test to make sure this does not break HIP toolc

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > aaron.ballman wrot

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:260 +``__has_target_feature`` + aaron.ballman wrote: > The first question that comes to mind for me is: why is `__has_fe

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); tra wrote: > Do you have a better

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 429265. yaxunl added a comment. fix typo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12/new/ https://reviews.llvm.org/D12 Files: clang/docs/LanguageExtensions.rst clang/docs/ReleaseNotes.rst clang/include/clang/Lex/Preprocessor.h c

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rsmith, aaron.ballman, tra. Herald added a project: All. yaxunl requested review of this revision. Depending on whether a target feature is enabled or not, programs may choose different algorithm or different builtin functions to use. Instead

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

2022-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D122734#3509096 , @yaxunl wrote: > In D122734#3508294 , @uabelho wrote: > >> Hi, >> >> I noticed when compiling with gcc 9.3.0 that we get a bunch of new warnings >> with this patch: >>

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

2022-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D122734#3508294 , @uabelho wrote: > Hi, > > I noticed when compiling with gcc 9.3.0 that we get a bunch of new warnings > with this patch: > > [1/351] Building CXX object > tools/clan

[PATCH] D125396: [clang] Fix KEYALL

2022-05-11 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 rG84db35594953: [clang] Fix KEYALL (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[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 inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; jhuber6 wrote: > yaxunl wrote: > > This makes the file format depend on LLVM version and potentia

[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 inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; This makes the file format depend on LLVM version and potentially standard C++ library version.

[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#3506529 , @jhuber6 wrote: > In D125165#3506502 , @thakis wrote: > >> In D125165#3506477 , @yaxunl wrote: >> >>> In D125165#3506448

[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#3506502 , @thakis wrote: > In D125165#3506477 , @yaxunl wrote: > >> In D125165#3506448 , @thakis wrote: >> >>> We could add a "clang-off

[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

[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] 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] 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 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

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