[PATCH] D102237: [CUDA][HIP] Fix non-ODR-use of static device variable

2021-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 2 inline comments as done. Closed by commit rG98575708da95: [CUDA][HIP] Fix device template variables (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D1

[PATCH] D99683: [HIP] Support ThinLTO

2021-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: llvm/lib/Transforms/IPO/FunctionImport.cpp:496 dbgs() << "ignored! No qualifying callee with summary found.\n"); continue; } tejohnson wrote: > yaxunl

[PATCH] D99683: [HIP] Support ThinLTO

2021-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 344949. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Teresa's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D99683/new/ https://reviews.llvm.org/D99683 Files: clang/include/clang/Driver/Driver.h clang/inclu

[PATCH] D102270: [CUDA][HIP] Fix device template variables

2021-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl closed this revision. yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:17145 }; -if (Var && Var->hasGlobalStorage() && !IsEmittedOnDeviceSide(Var)) { - SemaRef.targetDiag(Loc, diag::err_ref_bad_tar

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

2021-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: mgorny. yaxunl requested review of this revision. This patch adds wrapper headers for `` and a few others which is required to support ``. The basic idea is to make template functions defined in these headers h

[PATCH] D102508: [HIP] Add test libstd_functional

2021-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, ashi1. Herald added a subscriber: mgorny. yaxunl requested review of this revision. This patch adds a test for using in HIP device code. Repository: rT test-suite https://reviews.llvm.org/D102508 Files: External/HIP/CMakeLists.txt

[PATCH] D102508: [HIP] Add test libstd_functional

2021-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D102508#2759905 , @ashi1 wrote: > Looks good, let me verify on HIP builder. It depends on https://reviews.llvm.org/D102507 Repository: rT test-suite CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102508/new/ https:

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I think the root cause might be duplicated decls are added to Sema::DeclsToCheckForDeferredDiags defined in https://github.com/llvm/llvm-project/blob/main/clang/include/clang/Sema/Sema.h#L1789 When compiling source codes, a decl is added only once. However if modules are

[PATCH] D102556: [HIP] Fix spack detection

2021-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: kerbowa, nhaehnle, jvesely. yaxunl requested review of this revision. Missing or duplicate spack package should not cause error, since users may only installed llvm/clang package, or users may installed duplicate

[PATCH] D102556: [HIP] Fix spack detection

2021-05-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/rocm-detect.hip:115 + +// SPACK-MISS-SILENT-NOT: SPACK package hip-4.0.0 not found at +// SPACK-MISS-SILENT-NOT: SPACK package rocm-device-libs-4.0.0 not found at

[PATCH] D102556: [HIP] Fix spack detection

2021-05-17 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 rG18cb17ce4cd5: [HIP] Fix spack detection (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D102556?vs=345643&i

[PATCH] D102723: [HIP] Tighten checks in hip-include-path.hip test case

2021-05-18 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/D102723/new/ https://reviews.llvm.org/D102723 __

[PATCH] D102237: [CUDA][HIP] Fix non-ODR-use of static device variable

2021-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D102237#2767052 , @tra wrote: > Sam, this patch has apparently triggered some unwanted side effects. I'm > still reducing the failures to something that could be used for debugging, > but the rough symptoms are: > > We now end

[PATCH] D102801: [CUDA][HIP] Fix implicit constant variable

2021-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a reviewer: aaron.ballman. yaxunl requested review of this revision. constexpr variables are implicit constant variables in device compilation. Not all constexpr variables are valid to be emitted on device side, therefore we

[PATCH] D102237: [CUDA][HIP] Fix non-ODR-use of static device variable

2021-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D102237#2767538 , @tra wrote: > Here's a slightly simpler reproducer: https://godbolt.org/z/rW6P9e37s I have a fix for this: https://reviews.llvm.org/D102801 It seems the issue was due to clang emits the implicit constant vari

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 346796. yaxunl retitled this revision from "[CUDA][HIP] Fix implicit constant variable" to "[CUDA][HIP] Fix device variables used by host". yaxunl edited the summary of this revision. yaxunl added a comment. Fix the other regression CHANGES SINCE LAST ACTION

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D102801#2769936 , @tra wrote: > This patch does not appear to fix the second regression introduced by the > D102237 . > > Trying to compile the followin

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D102801#2769619 , @tra wrote: > Tentative LGTM as we need it to fix the regression soon. > > Summoning @rsmith for the 'big picture' opinion. > While the patch may fix this particular re

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Sema/Sema.h:12066 + enum CUDAVariableTarget { +CVT_Device, /// Device only tra wrote: > Wasn't there another kind, where the variable is emitted on the

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 346831. yaxunl marked 3 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102801/new/ https://reviews.llvm.org/D102801 Files: clang/include/clang/Sema/Sema.h clang/lib/Code

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101793#2769297 , @weiwang wrote: > Tried to make `Sema::DeclsToCheckForDeferredDiags` `llvm::SmallSetVector`. > The heap RSS did drop significantly (from peak 100GB to 59GB) , but not as > good as the current fix (peak 26GB),

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101793#2772033 , @weiwang wrote: > In D101793#2772021 , @yaxunl wrote: > >> In D101793#2769297 , @weiwang >> wrote: >> >>> Tried to make `Sema

[PATCH] D102801: [CUDA][HIP] Fix device variables used by host

2021-05-20 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 rG4cb42564ec4b: [CUDA][HIP] Fix device variables used by host (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-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/D101793/new/ https://reviews.llvm.org/D101793 __

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101793#2772461 , @weiwang wrote: > Thanks for the approval! > > Just want to understand the list of "decls to check for deferred diagnostics" > better, where are these decls coming from? And why do they need to be checked > f

[PATCH] D101793: [clang][AST] Improve AST Reader/Writer memory footprint

2021-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101793#2774191 , @weiwang wrote: > In D101793#2772717 , @yaxunl wrote: > >> In D101793#2772461 , @weiwang >> wrote: >> >>> Thanks for the appr

[PATCH] D100794: [HIP] Support overloaded math functions for hipRTC

2021-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Headers/__clang_hip_cmath.h:20 #include #include #include ashi1 wrote: > we may not need to `#include` limits and/or type_traits if we replaced them > with `__hip:

[PATCH] D102936: [CUDA] Work around compatibility issue with libstdc++ 11.1.0

2021-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Headers/cuda_wrappers/complex:79 +#if _GLIBCXX_RELEASE == 11 +#define __failed_assertion __cuda_failed_assertion +#endif May I ask where is __cuda_failed_assertion defined? Thanks. Repository: rG LLVM Github

[PATCH] D99683: [HIP] Support ThinLTO

2021-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGbf6124580dfb: [HIP] support ThinLTO (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D99683?vs=344949&id=347205#toc Repository: rG LLVM Github Mon

[PATCH] D102975: [HIP] Check compatibility of -fgpu-sanitize with offload arch

2021-05-22 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. -fgpu-sanitize is incompatible with offload arch containing xnack-. This patch checks that. https://reviews.llvm.org/D102975 File

[PATCH] D97340: [HIP] Support Spack packages

2021-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D97340#2775477 , @haampie wrote: > Hi @tra and @yaxunl, I'm commenting as a reviewer of the spack pull request > for the rocm 4.2.0 ecosystem. First of all: thanks for caring about spack > installations, that's highly appreciat

[PATCH] D101630: [HIP] Fix device-only compilation

2021-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D101630#2748513 , @tra wrote: > How about this: > If the user explicitly specified `--cuda-host-only` or `--cuda-device-only`, > then by default only allow producing the natural output f

[PATCH] D101630: [HIP] Fix device-only compilation

2021-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 347400. yaxunl added a comment. fixed option. bundle output if users specify output by -o or -E CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101630/new/ https://reviews.llvm.org/D101630 Files: clang/include/clang/Driver/Options.td clang/lib/Dri

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Recently we added diagnosing ODR-use of host variables in device functions, which includes ODR-use of const host variables since they are not really emitted on device side. This caused regressions

[PATCH] D102975: [HIP] Check compatibility of -fgpu-sanitize with offload arch

2021-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 347769. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D102975/new/ https://reviews.llvm.org/D102975 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp clang/l

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 347958. yaxunl added a comment. do not promote or check dependent variables since their ctor/dtor/initializers are not determined yet CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files: clang/lib/Sema

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 348089. yaxunl marked 4 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:568 +} +// Check whether a variable has an allowed initializer for a CUDA device side +// variable with global storage. \p VD may be a host variable to be checked for tra wrote: > Nit: add an e

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/device-use-host-var.cu:90 + const int &ref_const_var = global_const_var; const int &ref_constexpr_var = global_constexpr_var; *out = ref_host_var; tra wr

[PATCH] D103221: [HIP] Change default lang std to c++14

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: dexonsmith. yaxunl requested review of this revision. Currently clang and nvcc use c++14 as default std for C++. gcc 11 even uses c++17 as default std for C++. However, clang uses c++98 as default std for HIP.

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 348149. yaxunl marked an inline comment as done. yaxunl added a comment. fix test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103108/new/ https://reviews.llvm.org/D103108 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/S

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

2021-05-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D102507#2760025 , @tra wrote: > In effect this patch applies `__host__ __device__` to a subset of the > standard library headers and whatever headers *they* happen to include. While > it may happen to work, I'm not at all conf

[PATCH] D97340: [HIP] Support Spack packages

2021-05-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D97340#2778073 , @haampie wrote: > Hi Yaxunl, > >> The patch should not cause circular dependency on HIP or device library. > > I'm not saying this patch introduces a circular dependency, I'm saying you > are trying to solve an

[PATCH] D102975: [HIP] Check compatibility of -fgpu-sanitize with offload arch

2021-05-27 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6d2c0950205f: [HIP] Check compatibility of -fgpu-sanitize with offload arch (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://

[PATCH] D97340: [HIP] Support Spack packages

2021-05-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. opened https://reviews.llvm.org/D103281 to fix device lib detection for spack Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97340/new/ https://reviews.llvm.org/D97340 ___ cfe-comm

[PATCH] D101630: [HIP] Fix device-only compilation

2021-05-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101630#202 , @tra wrote: > In D101630#2777346 , @yaxunl wrote: > >> In D101630#2748513 , @tra wrote: >> >>> How about this: >>> If the user

[PATCH] D102723: [HIP] Tighten checks in hip-include-path.hip test case

2021-05-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. It seems we cannot introduce `ROOT` by line 19 since it is not used in other lines in situations where working directories have sym links. Instead, we just change `{{.*}}clang/` to `{{.*}}/lib/clang/` in other lines. Hopefully this will still work. Repository: rG LLV

[PATCH] D102723: [HIP] Tighten checks in hip-include-path.hip test case

2021-05-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D102723#2789610 , @bjope wrote: > In D102723#2789537 , @yaxunl wrote: > >> It seems we cannot introduce `ROOT` by line 19 since it is not used in other >> lines in situations where work

[PATCH] D103221: [CUDA][HIP] Change default lang std to c++14

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 349052. yaxunl retitled this revision from "[HIP] Change default lang std to c++14" to "[CUDA][HIP] Change default lang std to c++14". yaxunl edited the summary of this revision. yaxunl added a comment. revised by Artem's comments, and fix tests CHANGES SINC

[PATCH] D103221: [CUDA][HIP] Change default lang std to c++14

2021-06-01 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/LangStandards.def:196-197 // CUDA LANGSTANDARD(cuda, "cuda", CUDA, "NVIDIA CUDA(tm)", LineComment | CPlusPlus | Digraphs) tra wrote: > I

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

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

[PATCH] D103221: [CUDA][HIP] Change default lang std to c++14

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 349080. yaxunl marked an inline comment as done. yaxunl added a comment. fix test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103221/new/ https://reviews.llvm.org/D103221 Files: clang/include/clang/Basic/LangStandards.def clang/test/Parser/cud

[PATCH] D103221: [CUDA][HIP] Change default lang std to c++14

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/asm_delayed_diags.cu:31 static __device__ __host__ double t3(double x) { - register long double result; + register long double result; // expected-warning {{'register' storag

[PATCH] D101630: [HIP] Fix device-only compilation

2021-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D101630#2791734 , @tra wrote: > In D101630#2787714 , @yaxunl wrote: > >> How does nvcc --genco behave when there are multiple GPU arch's? Does it >> output a fat binary containing multi

[PATCH] D103221: [CUDA][HIP] Change default lang std to c++14

2021-06-01 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 rGf7e87dd6ff0c: [CUDA][HIP] Change default lang std to c++14 (authored by yaxunl). Herald added a project: cla

[PATCH] D103108: [CUDA][HIP] Promote const variables to constant

2021-06-01 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 rG04caa7c3e02f: [CUDA][HIP] Promote const variables to constant (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Mono

[PATCH] D103563: [HIP] Fix amdgcn builtin for long type

2021-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall, arsenm, rampitec, b-sumner. Herald added subscribers: kerbowa, nhaehnle, jvesely. yaxunl requested review of this revision. Herald added a subscriber: wdng. Currently some amdgcn builtins are defined with long int type, which cau

[PATCH] D95007: [CUDA][HIP] Add -fuse-cuid

2021-01-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:2307 + // Only alphanumeric and underscore is allowed in -cuid option. + if (auto *A = Args.getLastArg(OPT_cuid_EQ)) { +const char *V = A->getValue()

[PATCH] D94814: [HIP] Support `__managed__` attribute

2021-01-22 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/DiagnosticSemaKinds.td:8245 "%select{__device__|__global__|__host__|__host__ __device__}0 functions">; -def err_cuda_nonstatic_constdev: Error<"__constant__ and __dev

[PATCH] D94814: [HIP] Support `__managed__` attribute

2021-01-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 2 inline comments as done. Closed by commit rG622eaa4a4cea: [HIP] Support __managed__ attribute (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D94814?v

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-01-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Extract registering device variable to CUDA runtime codegen function since it will be called in multiple places. https://reviews.llvm.org/D95558 Files: clang/lib/CodeGen/CGCUDANV.cpp clang/

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-01-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Currently static variables are allowed in device, global, and host device functions. A static variable in device and global functions is supposed to have implicit device attribute. Currently it d

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-01-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. @rjmccall I have addressed the comments about diagnostics. Could you please review it? Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 ___ cfe-commits mailing list cfe-

[PATCH] D95660: [NFC] Disallow unused prefixes under clang/test/Driver

2021-01-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM for amdgpu changes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95660/new/ https://reviews.llvm.org/D95660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[PATCH] D95665: [Builtins][FIX] Allow targets to opt-out of `long double` builtins

2021-01-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I tried this patch with our CI and it breaks HIP and OpenMP. I suspect it may also break CUDA. It seems in device compilation, when a host function calls a builtin with long double argument, the builtin is not found. My guess is that the target for checking builtin needs

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 7 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/TargetInfo.h:1478 + enum class AtomicOperationKind { +Unsupported, +Init, rjmccall wrote: > This shouldn't be here; if you have places that don't

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 320477. yaxunl marked 7 inline comments as done. yaxunl added a comment. Herald added a reviewer: jfb. revised by John's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/A

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCUDANV.cpp:157 llvm::Function *makeModuleDtorFunction() override; + void + adjustShadowVarLinkage(const VarDecl *D, tra wrote: > clang-format it? `void` ha

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 320526. yaxunl marked 4 inline comments as done. yaxunl added a comment. Revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95558/new/ https://reviews.llvm.org/D95558 Files: clang/lib/CodeGen/CGCUDANV.cpp clang/lib/CodeGen

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:101 +// does that. +class CUDAStaticDeviceVarEmitter +: public StmtVisitor { tra wrote: > Nit. "This class does that" could be dropped. I'd

[PATCH] D95840: [CUDA][HIP] Fix checking dependent initalizer

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Defer constant checking of dependent initializer to template instantiation since it cannot be done for dependent values. This is separated from https://reviews.llvm.org/D95560 https://reviews.l

[PATCH] D95560: [CUDA][HIP] Fix function scope static variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 320644. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95560/new/ https://reviews.llvm.org/D95560 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/C

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-02-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCUDANV.cpp:924 + +void CGNVCUDARuntime::adjustShadowVarLinkage( +const VarDecl *D, llvm::GlobalValue::LinkageTypes &Linkage) { tra wrote: > yaxunl wrote: >

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. This patch focuses on clang work for enabling fp atomics. There is a middle end pass for lowering fp atomics to cmpxchg, however not all targets enable it or enable it properly. From clang point of view, those targets are not ready to say they support fp atomics, therefo

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. If the concern is that diagnose fp atomics as unsupported hinders middle end and backend work for fixing fp atomic issues, how about adding a -fenable-fp-atomics to clang which can override target info about fp atomics support. CHANGES SINCE LAST ACTION https://revie

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D71726#2537054 , @tra wrote: > In D71726#2536966 , @jyknight wrote: > >> My concern is that this is treating a backend _bug_ as if it were just an >> optional feature. But it's not the ca

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-02-02 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:4270-4271 } else { - // Host-side shadows of external declarations of device-side - // global variables become internal definitions. These have to

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. For -fgpu-rdc, shadow variables should not be internalized, otherwise they cannot be accessed by other TUs. This is necessary because the shadow variable of external device variables are always em

[PATCH] D95915: [clang][driver] Only warn once about invalid -stdlib value

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D95915#2539483 , @jdoerfert wrote: > I don't believe a static variable is a good idea. Also the name is not really > informative. Members in `ToolChain` with a proper names would be nicer (IMHO). > > Tests missing. Also, now you

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D95901#2539663 , @tra wrote: >> For -fgpu-rdc, shadow variables should not be internalized, otherwise they >> cannot be accessed by other TUs. >> This is necessary because the shadow variable of external device variables >> ar

[PATCH] D95558: [NFC][CUDA] Refactor registering device variable

2021-02-03 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 rG0b2af1a28894: [NFC][CUDA] Refactor registering device variable (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm

[PATCH] D95840: [CUDA][HIP] Fix checking dependent initalizer

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:538 AllowedInit = - ((VD->getType()->isDependentType() || Init->isValueDependent()) && - VD->isConstexpr()) || + (VD->getType()->isDep

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 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:11437-11443 + return ((!getLangOpts().GPURelocatableDeviceCode && + ((D->hasAttr() && + !D->getAttr()->isImplicit()) || +(D->hasAttr(

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 321198. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Artem's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95901/new/ https://reviews.llvm.org/D95901 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 321203. yaxunl added a comment. clang-format the patch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95901/new/ https://reviews.llvm.org/D95901 Files: clang/lib/AST/ASTContext.cpp clang/lib/CodeGen/CGCUDANV.cpp clang/lib/CodeGen/CodeGenModule.

[PATCH] D95970: [HIP] Allow undefined symbols

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. HIP managed variables need to be emitted as undefined symbols since runtime needs to define them with managed memory accessible by both device and host. Let HIP toolchain allow that with lld. h

[PATCH] D95970: [HIP] Allow undefined symbols

2021-02-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D95970#2540303 , @tra wrote: > What's going to happen if you do have an undefined reference that's *not* to > a `__managed__` variable? By default HIP toolchain uses -fvisibility hidden -fapply-global-visibility-to-externs for

[PATCH] D95915: [clang][driver] Only warn once about invalid -stdlib value

2021-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. It also avoid redundant check. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95915/new/ https://reviews.llvm.org/D95915 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailm

[PATCH] D95840: [CUDA][HIP] Fix checking dependent initalizer

2021-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 2 inline comments as done. Closed by commit rGe355110040d1: [CUDA][HIP] Fix checking dependent initalizer (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.or

[PATCH] D96105: [CUDA][HIP] Pass -fgpu-rdc to host clang -cc1

2021-02-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Currently -fgpu-rdc is not passed to host clang -cc1. This causes issue because -fgpu-rdc affects shadow variable linkage in host compilation. https://reviews.llvm.org/D96105 Files: clang/lib

[PATCH] D95901: [CUDA][HIP] Fix device variable linkage

2021-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb008ea304d43: [CUDA][HIP] Fix device variable linkage (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D9590

[PATCH] D95970: [HIP] Allow undefined symbols

2021-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl abandoned this revision. yaxunl added a comment. In D95970#2540669 , @tra wrote: > In D95970#2540414 , @yaxunl wrote: > >> In D95970#2540303 , @tra wrote: >> >>> What'

[PATCH] D96195: [HIP] Fix managed variable linkage

2021-02-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: dexonsmith, hiraditya. yaxunl requested review of this revision. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Currently managed variables are emitted as undefined symbols, which causes d

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D71726#2537378 , @jyknight wrote: > In D71726#2537101 , @yaxunl wrote: > >> For amdgpu target, we do need diagnose unsupported atomics (not limited

[PATCH] D71726: Let clang atomic builtins fetch add/sub support floating point types

2021-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 322005. yaxunl edited the summary of this revision. yaxunl added a comment. Revised by James, Artem, and John's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/Dia

[PATCH] D95007: [CUDA][HIP] Add -fuse-cuid

2021-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 322020. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Jon and Artem's comments. Removed check of CUID value. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95007/new/ https://reviews.llvm.org/D95007 Files: clang/includ

[PATCH] D85223: [CUDA][HIP] Support accessing static device variable in host code for -fgpu-rdc

2021-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/AST/ASTContext.cpp:11446-11447 bool ASTContext::mayExternalizeStaticVar(const Decl *D) const { - return !getLangOpts().GPURelocatableDeviceCode && + return (!getLangOpts().CUID.empty()

[PATCH] D85223: [CUDA][HIP] Support accessing static device variable in host code for -fgpu-rdc

2021-02-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 322021. yaxunl marked 3 inline comments as done. yaxunl edited the summary of this revision. yaxunl added a comment. Revised by Artem's comments. Use CUID hash as postfix for static variable name. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85223/ne

[PATCH] D109707: [HIP] [AlwaysInliner] Disable AlwaysInliner to eliminate undefined symbols

2021-09-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I think you may try fixing the following line: https://github.com/llvm/llvm-project/blob/main/llvm/lib/Target/AMDGPU/AMDGPUAlwaysInlinePass.cpp#L97 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109707/new/ https://reviews.l

[PATCH] D109841: Fix vtbl field addr space

2021-09-16 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 rGabe8b354e37d: Fix vtbl field addr space (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAS

<    10   11   12   13   14   15   16   17   18   19   >