[PATCH] D68753: [CUDA][HIP} Add a test for constexpr default ctor

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: test/SemaCUDA/constexpr-ctor.cu:14-27 +template struct B { + T a; + constexpr B() = default; +}; + +template struct C { + T a; tra wrote: > Do we really need three identical t

[PATCH] D68823: Fix help message for -ffp-contract

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: include/clang/Driver/Options.td:1148 + " | on (according to FP_CONTRACT pragma) | off (never fuse). Default" + " is 'fast' for CUDA/HIP and 'on' otherwise.">, Values<"fast,on,off">; ---

[PATCH] D68753: [CUDA][HIP} Add a test for constexpr default ctor

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: test/SemaCUDA/constexpr-ctor.cu:14-27 +template struct B { + T a; + constexpr B() = default; +}; + +template struct C { + T a; tra wrote: > yaxunl wrote: > > tra wrote: > > >

[PATCH] D68753: [CUDA][HIP} Add a test for constexpr default ctor

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 224492. yaxunl marked an inline comment as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68753/new/ https://reviews.llvm.org/D68753 Files: test/SemaCUDA/constexpr-ctor.cu Index: test/Sema

[PATCH] D68823: Fix help message for -ffp-contract

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc10a64718ed2: Fix help message for -ffp-contract (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D68823?vs=224436&id=224497#toc Repository: rG L

[PATCH] D68753: [CUDA][HIP} Add a test for constexpr default ctor

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc1f8e04eeefe: [CUDA][HIP} Add a test for constexpr default ctor (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D68753?vs=224492&id=224529#toc Rep

[PATCH] D69129: [AMDGPU] Fix assertion due to initializer list

2019-10-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl. Sometimes a global var is replaced by a different llvm value. clang use GetAddrOfGlobalVar to get the original llvm global variable. For most targets, GetAddrOfGlobalV

[PATCH] D69129: [AMDGPU] Fix assertion due to initializer list

2019-10-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CodeGenModule.cpp:3898 +Entry = CE->stripPointerCasts(); } rjmccall wrote: > You can just make this whole thing `Entry = Entry->stripPointerCasts()`. will do w

[PATCH] D69129: [AMDGPU] Fix assertion due to initializer list

2019-10-20 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 rGe6125fc0ec34: [AMDGPU] Fix assertion due to initializer list (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.o

[PATCH] D69268: [HIP] Add option -fgpu-allow-device-init

2019-10-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Add this option to allow device side class type global variables with non-trivial ctor/dtor. device side init/fini functions will be emitted, which will be executed by HIP runtime when the fat binary is loaded/unloaded. This feature is t

[PATCH] D69268: [HIP] Add option -fgpu-allow-device-init

2019-10-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: lib/Frontend/CompilerInvocation.cpp:2530 Opts.GPURelocatableDeviceCode = Args.hasArg(OPT_fgpu_rdc); + Opts.GPUAllowDeviceInit = Args.hasArg(OPT_fgpu_allow_device_init); Opts.HIPUseNewLaunchA

[PATCH] D69268: [HIP] Add option -fgpu-allow-device-init

2019-10-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 226044. yaxunl added a comment. Add warning CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69268/new/ https://reviews.llvm.org/D69268 Files: include/clang/Basic/DiagnosticCommonKinds.td include/clang/Basic/DiagnosticGroups.td include/clang/Basi

[PATCH] D69268: [HIP] Add option -fgpu-allow-device-init

2019-10-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/DiagnosticCommonKinds.td:308 +// HIP +def warn_ignore_hip_only_option : Warning< + "'%0' is ignored since it is only supported for HIP">, tra wrote: > `warn_ig

[PATCH] D69268: [HIP] Add option -fgpu-allow-device-init

2019-10-22 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 rG68f5ca4e19c1: [HIP] Add option -fgpu-allow-device-init (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D69

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 265025. yaxunl retitled this revision from "[HIP] Support -offloading-target-id" to "[HIP] Support target id by --offload-arch". yaxunl edited the summary of this revision. yaxunl added a comment. rebased the patch and revised by passing target id by `--offloa

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D60620#1464633 , @tra wrote: > It looks like you are solving two problems here. > a) you want to create multiple device passes for the same GPU, but with > different options. > b) you may want to pass different compiler option

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

2020-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 265325. yaxunl added a reviewer: arsenm. yaxunl added a comment. Herald added a subscriber: wdng. rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/DiagnosticSemaKinds.

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

2020-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D71726#2039319 , @arsenm wrote: > In D71726#1801346 , @__simt__ wrote: > > > In D71726#1792852 , @yaxunl w

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

2020-05-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added a comment. In D71726#2047566 , @ldionne wrote: > In D71726#1791904 , @jfb wrote: > > > This generally seems fine. Does it work on most backends? I want to make

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

2020-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 265479. yaxunl marked an inline comment as done. yaxunl edited the summary of this revision. yaxunl added a comment. Herald added subscribers: kerbowa, nhaehnle, jvesely. Added TargetInfo::isFPAtomicFetchAddSubSupported to guard fp atomic. CHANGES SINCE LAST

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG361e4f14e359: Fix debug info for NoDebug attr (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79967/new/

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

2020-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/TargetInfo.h:1418 + /// Whether floating point atomic fetch add/sub is supported. + virtual bool isFPAtomicFetchAddSubSupported() const { return false; } + -

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

2020-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 265606. yaxunl marked 2 inline comments as done. yaxunl edited the summary of this revision. yaxunl added a reviewer: tra. yaxunl added a comment. check supported fp atomics by bits. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://re

[PATCH] D79526: [CUDA][HIP] Workaround for resolving host device function against wrong-sided function

2020-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79526#2042680 , @tra wrote: > Reduced test case: > > struct a { > __attribute__((device)) a(short); > __attribute__((device)) operator unsigned() const; > __attribute__((device)) operator int() const; > }; > st

[PATCH] D80450: [CUDA][HIP] Fix implicit HD function resolution

2020-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. When implicit HD function calls a function in device compilation, if one candidate is an implicit HD function, current solution rule is: D wins over HD and H HD and H are equal this caused regression when there is an otherwise worse D c

[PATCH] D80461: HIP: Try to deal with more llvm package layouts

2020-05-22 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. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80461/new/ https://reviews.llvm.org/D80461 ___ cfe-commits mailing list cfe-

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/HIP.cpp:121-123 + auto Pos = SubArchName.find_first_of("+-"); + if (Pos != SubArchName.npos) +SubArchName = SubArchName.substr(0, Pos); tra wrote:

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Basic/HIP.cpp:16 +const llvm::SmallVector +getAllPossibleTargetIdFeatures(llvm::StringRef Device) { + llvm::SmallVector Ret; tra wrote: > Nit: there's an unfortunate cla

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 266315. yaxunl marked an inline comment as done. yaxunl added a comment. Herald added subscribers: kerbowa, nhaehnle, jvesely. Fixed passing target id to clang -cc1. Added predefined macros for target id. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D80450: [CUDA][HIP] Fix implicit HD function resolution

2020-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 266366. yaxunl added a comment. Fix test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80450/new/ https://reviews.llvm.org/D80450 Files: clang/lib/Sema/SemaOverload.cpp clang/test/SemaCUDA/function-overload.cu Index: clang/test/SemaCUDA/funct

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-26 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/HIP.cpp:121-123 + auto Pos = SubArchName.find_first_of("+-"); + if (Pos != SubArchName.npos) +SubArchName = SubArchName.substr(0, Pos); tra wrote:

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 266410. yaxunl added a comment. Changed target id format to be like `gfx908:xnack+:sramecc-`. I tried to introduce --offload-target-id but found that is not good because: 1. it will cause redundant code since I have to handle these options separately in CUDA

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 266976. yaxunl added a comment. Emit target id module flag metadata. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td clang/include/clang/Basic/Off

[PATCH] D80858: [HIP] Support accessing static device variable in host code

2020-05-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. nvcc supports accessing file-scope static device variables in host code by host APIs like cudaMemcpyToSymbol etc. HIP let users access device variables in host code by shadow variables. In host compilation, clang emits a shado

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-05-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. > // ... > // RUN: -x hip --offload-arch=gfx908 \ > // RUN: --offload-arch=gfx908:sramecc+:xnack+ > Does this mean that HIP will create two compilation passes -- one for gfx908 > and one for gfx908:sramecc+:xnack+ ? > Or does it mean that the first line is ignored if y

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 267693. yaxunl added a comment. emit empty target id module flag if no -target-cpu is set CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td clang/in

[PATCH] D80996: [AMDGPU][OpenMP] Fix duplicate copies of arguments in commands

2020-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Can we have a lit test? Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80996/new/ https://reviews.llvm.org/D80996 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D80450: [CUDA][HIP] Fix implicit HD function resolution

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

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

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

[PATCH] D83893: [CUDA][HIP] Always defer diagnostics for wrong-sided reference

2020-07-17 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4fc752b30b9a: [CUDA][HIP] Always defer diagnostics for wrong-sided reference (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 279000. yaxunl added a comment. Herald added subscribers: llvm-commits, dang, hiraditya. Herald added a project: LLVM. rebase and added more checks. The documentation work is still under development. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D6062

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

2020-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/TargetInfo.h:1418 + /// Whether floating point atomic fetch add/sub is supported. + virtual bool isFPAtomicFetchAddSubSupported() const { return false; } + -

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

2020-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 279032. yaxunl marked 2 inline comments as done. yaxunl added a comment. use llvm::fltSemantics for checking CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/DiagnosticSemaKi

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

2020-07-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D71726#2165424 , @jyknight wrote: > Why not have clang always emit atomicrmw for floats, and let AtomicExpandPass > handle legalizing that into integer atomics if necessary, rather than adding > a target hook in clang? Not al

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

2020-07-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D71726#2165494 , @jyknight wrote: > In D71726#2165445 , @yaxunl wrote: > > > In D71726#2165424 , @jyknight > > wrote: > > > > > Why not have clang

[PATCH] D84362: [NFC] Add missing functions to PartialDiagnostic

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. PartialDiagnostic misses some functions compared to DiagnosticBuilder. This patch adds missing functions to PartialDiagnostic so that can emit all diagnostics that can be emitted by DiagnosticBuilder. https://reviews.llvm.org/D84362 F

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: sstefan1, kristof.beyls. Herald added a reviewer: jdoerfert. In CUDA/HIP a function may become implicit host device function by pragma or constexpr. A host device function is checked in both host and device compi

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 279950. yaxunl added a comment. update for depending patch change CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84364/new/ https://reviews.llvm.org/D84364 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/AnalysisBasedWarnings.cpp clang/li

[PATCH] D84362: [NFC] Add missing functions to PartialDiagnostic

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 279951. yaxunl added a comment. fix build failure CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84362/new/ https://reviews.llvm.org/D84362 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/Attr.h clang/include/clang/AST/Canon

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

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

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 280013. yaxunl edited the summary of this revision. yaxunl added a comment. Herald added a subscriber: dang. Added option -fgpu-defer-diag to control this new behavior. By default it is off. Added test for syntax error. CHANGES SINCE LAST ACTION https://re

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D84364#2168036 , @tra wrote: > One side effect of this change is that we'll probably stop producing > diagnostics for the code that is known to be wrong, but happens to be unused. > > E.g. > > __host__ __device__ static void h

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I'd like to clarify a little bit about `deferring` an error. First it is localized to a function. If an error causes a function not parsed completely, it will be emitted immediately. So if an error is deferred, it means clang at least parses that function containing it.

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Another thing we can do is to limit the diagnostic messages that can be deferred. For example, we only defer semantic diagnostics, or overloading resolution related diagnostics. According to previous experience, what bothers us most are the diagnostics triggered by the d

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 280102. yaxunl added a comment. added lit test for SFINAE CHANGES SINCE LAST ACTION https://reviews.llvm.org/D84364/new/ https://reviews.llvm.org/D84364 Files: clang/include/clang/Basic/LangOptions.def clang/include/clang/Driver/Options.td clang/inc

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2169295 , @hliao wrote: > I don't that's proper way to support file-scope static device variables. As > we discuss APIs like cudaMemcpyToSymol, that's a runtime API instead of > driver API. The later needs to specify the

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Another reason is that we need to support it in rdc mode, where different TU can have static var with the same name. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80858/new/ https://reviews.llvm.org/D80858 ___ cfe-c

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 280144. yaxunl added a comment. update the lit test for SFINAE. make sure substitution failure does not incur error msg if there is valid substitution. Since template is not allowed in local class, there is no need for test SFINAE inside host device function

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2170311 , @hliao wrote: > > The problem is that even though the static variable is registered through > > `__hipRigisterVariable`, the runtime still relies on looking up symbol name > > to get the address of the device v

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2170328 , @hliao wrote: > In D80858#2169534 , @yaxunl wrote: > > > Another reason is that we need to support it in rdc mode, where different > > TU can have static var with the sam

[PATCH] D84476: Make hip math headers easier to use from C

2020-07-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Headers/__clang_hip_math.h:98 // BEGIN FLOAT +#ifdef _cplusplus __DEVICE__ typo ? Comment at: clang/lib/Headers/__clang_hip_math.h:558 // BEGIN DOUBLE +#ifdef _cplusplus __DEVICE__ ---

[PATCH] D84476: Make hip math headers easier to use from C

2020-07-24 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. Comment at: clang/lib/Headers/__clang_hip_math.h:561 inline double abs(double __x) { return __ocml_fabs_f64(__x); } +#endif __DEVICE__ JonChe

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-07-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 20 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Driver/Driver.h:332 + llvm::Triple getHIPOffloadTargetTriple() const; + tra wrote: > This is used exclusively by the Driver.cpp and does not have to be a pu

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-07-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 280567. yaxunl marked 9 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td

[PATCH] D84364: [CUDA][HIP] Defer all diagnostics for host device functions

2020-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added a comment. In D84364#2170769 , @tra wrote: > In D84364#2170244 , @tra wrote: > > > I'm going to try the patch on our CUDA code and see how it fares. Stay > > tu

[PATCH] D84364: [CUDA][HIP] Defer overloading resolution diagnostics for host device functions

2020-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 280938. yaxunl marked 2 inline comments as done. yaxunl retitled this revision from "[CUDA][HIP] Defer all diagnostics for host device functions" to "[CUDA][HIP] Defer overloading resolution diagnostics for host device functions". yaxunl edited the summary of

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2171266 , @hliao wrote: > We may try to solve the issue without RDC firstly, where we don't need to > change that static variable name (if the runtime maintains the device > binaries correctly.) We only need to ensure th

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code

2020-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2177159 , @tra wrote: > It's a good point. Perhaps this is one of the cases where we should *not* > follow nvcc. > We can't have our cake (preserve static behavior) and eat it (treat it as > non-static in case something

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

2020-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 281296. yaxunl added a comment. Make IEEE single and double type as supported for fp atomics in all targets by default. This is based on the assumption that AtomicExpandPass or its ongoing work is sufficient to support fp atomics for all targets. This is to f

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. @tra target ID documentation is added by https://reviews.llvm.org/D84822 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D60620: [HIP] Support target id by --offload-arch

2020-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 281465. yaxunl added a comment. separate emitting target-id module flag to a different patch. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 Files: clang/include/clang/Basic/DiagnosticDriverKinds.td clan

[PATCH] D84824: [HIP] Emit target-id module flag

2020-07-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. Separate this patch from https://reviews.llvm.org/D60620 since it depends on https://reviews.llvm.org/D80750 https://reviews.llvm.org/D84824 Files: clang/lib/CodeGen/CodeGenModule.cpp clan

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

2020-07-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping. I think I have addressed all the issues in FE. I think issues in AtomicExpandPass should be addressed by separate patches. Can we land this? Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726

[PATCH] D77329: [AMDGPU] Allow AGPR in inline asm

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa46e7d7a5f60: [AMDGPU] Allow AGPR in inline asm (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D77329?vs=254668&id=254772#toc Repository: rG LL

[PATCH] D77390: Fix __builtin_amdgcn_workgroup_size_x/y/z return type

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: b-sumner, arsenm. Herald added subscribers: kerbowa, nhaehnle, wdng, jvesely. arsenm accepted this revision. This revision is now accepted and ready to land. https://reviews.llvm.org/D77390 Files: clang/include/clang/Basic/BuiltinsAMDGPU.def

[PATCH] D77398: [cuda][hip] Fix `RegisterVar` function prototype.

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77398/new/ https://reviews.llvm.org/D77398 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1508 void checkFunc(SourceLocation Loc, FunctionDecl *FD) { +auto DiagsCountIt = DiagsCount.find(FD); FunctionDecl *Caller = UseStack.empty() ? nullptr : UseStac

[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 254840. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by John's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77028/new/ https://reviews.llvm.org/D77028 Files: clang/include/clang/Sema/Sema.h clang/lib/Sema/Se

[PATCH] D77390: Fix __builtin_amdgcn_workgroup_size_x/y/z return type

2020-04-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl closed this revision. yaxunl added a comment. b72fce1ffd0a0de5b46b486c7030d54cc5d8c225 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77390/new/ https://reviews.llvm.org/D77390 __

[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

2020-04-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/Sema.cpp:1508 void checkFunc(SourceLocation Loc, FunctionDecl *FD) { +auto DiagsCountIt = DiagsCount.find(FD); FunctionDecl *Caller = UseStack.empty() ? nullptr : UseStac

[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

2020-04-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1508 void checkFunc(SourceLocation Loc, FunctionDecl *FD) { +auto DiagsCountIt = DiagsCount.find(FD); FunctionDecl *Caller = UseStack.empty() ? nullptr : UseStac

[PATCH] D77028: [NFC] Refactor DeferredDiagsEmitter and skip redundant visit

2020-04-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1508 void checkFunc(SourceLocation Loc, FunctionDecl *FD) { +auto DiagsCountIt = DiagsCount.find(FD); FunctionDecl *Caller = UseStack.empty() ? nullptr : UseStac

[PATCH] D77028: Speed up deferred diagnostic emitter

2020-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 255315. yaxunl marked an inline comment as done. yaxunl retitled this revision from "[NFC] Refactor DeferredDiagsEmitter and skip redundant visit" to "Speed up deferred diagnostic emitter". yaxunl edited the summary of this revision. yaxunl added a comment. Re

[PATCH] D77028: Speed up deferred diagnostic emitter

2020-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1558 +// visited before. +if (Done.count(FD)) + return; rjmccall wrote: > `insert` returns whether it changed the set, so you can combine this

[PATCH] D77028: Speed up deferred diagnostic emitter

2020-04-06 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 rG2c31aa2de13a: Speed up deferred diagnostic emitter (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST A

[PATCH] D77028: Speed up deferred diagnostic emitter

2020-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/Sema.cpp:1558 +// visited before. +if (Done.count(FD)) + return; rjmccall wrote: > yaxunl wrote: > > rjmccall wrote: > > > `insert` returns whether it c

[PATCH] D77583: [hip] Remove `hip_pinned_shadow`.

2020-04-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is the runtime and HIP directed test change in place? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77583/new/ https://reviews.llvm.org/D77583 ___ cfe-commits mailing list cfe-c

[PATCH] D77583: [hip] Remove `hip_pinned_shadow`.

2020-04-06 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/D77583/new/ https://reviews.llvm.org/D77583 __

[PATCH] D77665: [CUDA] Simplify GPU variant handling. NFC.

2020-04-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Basic/Cuda.cpp:61 +// clang-format off +SM2(20, "compute_20"), SM2(21, "compute_20"), // Fermi +SM(30), SM(32), SM(35), SM(37), // Kepler Thanks for the efforts. Really appreciate this. Can we sepa

[PATCH] D77665: [CUDA] Simplify GPU variant handling. NFC.

2020-04-07 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/D77665/new/ https://reviews.llvm.org/D77665 __

[PATCH] D77670: [CUDA] Add partial support for recent CUDA versions.

2020-04-07 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/D77670/new/ https://reviews.llvm.org/D77670 __

[PATCH] D77688: [CUDA] Improve testing of libdevice detection.

2020-04-07 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/D77688/new/ https://reviews.llvm.org/D77688 __

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. HIP provide host API to allow C/C++ programs to launch kernel. A C/C++ program can declare a HIP kernel as an external function and pass it to the kernel launching API. When linked with object files built from HIP programs. These

[PATCH] D59321: AMDGPU: Teach toolchain to link rocm device libs

2020-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. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59321/new/ https://reviews.llvm.org/D59321 ___ cfe-commits mailing list cfe-

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1970035 , @tra wrote: > Would not this scheme create a conflict between the device-side mangled > kernel name and the handle which we emit with the same name? I recall that > the distinct stub name was introduced specifi

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972258 , @hliao wrote: > In D77743#1970304 , @tra wrote: > > > In D77743#1970163 , @yaxunl wrote: > > > > > The kernel handle is a variable

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972292 , @hliao wrote: > In addition, we may also need to extend the registration to set up the > mapping from that global variable to the host side stub function. > `hipKernelLaunch` (implemented as a function call ins

[PATCH] D77743: [HIP] Emit symbols with kernel name in host binary

2020-04-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1972301 , @hliao wrote: > In D77743#1972298 , @yaxunl wrote: > > > In D77743#1972292 , @hliao wrote: > > > > > In addition, we may also need

[PATCH] D77910: AMDGPU: Define cl_khr_gl_sharing as a supported extension

2020-04-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I am not so sure whether compiler should always report this. I thought it depends on platform and should let runtime to add it when it is really supported. But on the other hand, we could report it by default if it is the most case, and let runtime to disable it if it i

[PATCH] D77954: [CUDA][HIP] Fix overload resolution issue for device host functions

2020-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. yaxunl edited the summary of this revision. Currently clang fails to compile the following CUDA program in device compilation: __host__ int foo(int x) { return 1; } template __device__ __host__ int foo(T x) {

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