[PATCH] D78513: [hip] Claim builtin type `__float128` supported if the host target supports it.

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

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. Lambda functions do not have names, therefore they do not need host/device attribute for overloading resolution. They are also have internal linkage and is only emitted if used, therefore no need to use host/device attribute to i

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:722 + if (getLangOpts().HIP) { +Method->addAttr(CUDADeviceAttr::CreateImplicit(Context)); +Method->addAttr(CUDAHostAttr::CreateImplicit(Context)); -

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259453. yaxunl added a comment. clean up test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/lib/Sema/SemaCUDA.cpp clang/test/CodeGenCUDA/lambda.cu clang/test/SemaCUDA/lambda.cu Index:

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259452. yaxunl marked 2 inline comments as done. yaxunl added a comment. Add a negative test for lambda kernel. Add more checks to codegen test. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259458. yaxunl added a comment. Revised to let host/device take precedence over multiversion, as John suggested. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77954/new/ https://reviews.llvm.org/D77954 Files: clang/lib/Sema/SemaOverload.cpp clan

[PATCH] D46472: [HIP] Support offloading by linker script

2020-04-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp:1329 + // Get the HIP offload tool chain. + auto *HIPTC = static_cast( + C.getSingleOffloadToolChain()); JonChesterfield wrote

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9749 + if (isBetterMultiversionCandidate(Cand1, Cand2)) +return true; + echristo wrote: > rjmccall wrote: > > yaxunl wrote: > > > rjmccall wrot

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-23 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:723 +Method->addAttr(CUDADeviceAttr::CreateImplicit(Context)); +Method->addAttr(CUDAHostAttr::CreateImplicit(Context)); +return; pfultz2 wro

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259796. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77954/new/ https://reviews.llvm.org/D77954 Files: clang/lib/Sema/SemaOverload.cpp clang/test/SemaC

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:9749 + if (isBetterMultiversionCandidate(Cand1, Cand2)) +return true; + rjmccall wrote: > tra wrote: > > rjmccall wrote: > > > erichkeane wrote

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259870. yaxunl marked an inline comment as done. yaxunl added a comment. change the precedence of multiversion to be over host/device-ness. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77954/new/ https://reviews.llvm.org/D77954 Files: clang/lib/S

[PATCH] D78817: clang: Allow backend unsupported warnings

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

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. @tra Is it OK I commit it now? Or better wait next Monday morning? Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77954/new/ https://reviews.llvm.org/D77954 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 259957. yaxunl marked 2 inline comments as done. yaxunl added a comment. Fix typo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/lib/Sema/SemaCUDA.cpp clang/test/CodeGenCUDA/lambda.cu clan

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc77a4078e010: [CUDA][HIP] Fix host/device based overload resolution (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#2002580 , @tra wrote: > Go ahead. I'll revert it if it breaks anything on our side. Thanks. Done by b46b1a916d44216f0c70de55ae2123eb9de69027 Reposi

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 260094. yaxunl added a comment. Added more tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/lib/Sema/SemaCUDA.cpp clang/test/CodeGenCUDA/lambda.cu clang/test/SemaCUDA/lambda.cu Index:

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/CodeGenCUDA/lambda.cu:16-26 +template +__global__ void g(F f) { f(); } + +template +void h(F f) { g<<<1,1>>>(f); } + +__device__ int a; tra wrote: > yaxunl wrote: > > tr

[PATCH] D78655: [HIP] Let lambda be host device by default

2020-04-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D78655#2003681 , @hliao wrote: > I though the goal of adding HD/D attributes for lambda is to make the static > check easier as lambda used in device code or device lambda is sensitive to

[PATCH] D78970: [CUDA][HIP] Fix ambiguity of new operator

2020-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. https://reviews.llvm.org/D77954 caused a regression about ambiguity of new operator in file scope. This patch recovered the previous behavior for comparison without a caller. This is a workaround. For real fix we need D71227

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Can we get this in? There are other fixes depending on this. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 ___ cfe-commi

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#2005313 , @gribozavr2 wrote: > Sorry -- this change broke overload resolution for `operator new`, as it is > declared in system headers. I'm reverting the patch. > > $ cat /tmp/in.cu.cc > #define __device__ __attribut

[PATCH] D78980: Elaborate more on --rocm-path flag.

2020-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/include/clang/Driver/Options.td:612 def rocm_path_EQ : Joined<["--"], "rocm-path=">, Group, - HelpText<"ROCm installation path">; + HelpText<"ROCm installation path, used for finding and automatically linking required bitcode li

[PATCH] D78979: OpenCL: Include builtin header by default

2020-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D78979#2006847 , @arsenm wrote: > I'm also wondering if using -nogpulib for the corresponding linker purpose > was correct, since in the OpenCL case it's not really an offload target. > Maybe this should switch to -nostdlib?

[PATCH] D78979: OpenCL: Include builtin header by default

2020-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D78979#2007643 , @Anastasia wrote: > ah I guess if we leave it under `-cc1 ` we will have the command line > interface as follows: > > - Driver (without `-cc1`) adds OpenCL header by default that can be > overridden by the flag

[PATCH] D78970: [CUDA][HIP] Fix ambiguity of new operator

2020-04-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl closed this revision. yaxunl added a comment. committed by 55bcb96f3154808bcb5afc3fb46d8e00bf1db847 CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78970/new/ https://reviews.llvm.org/D78970 _

[PATCH] D79210: Let clang print registered targets for --version

2020-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. We need a way to know supported targets by clang since we use clang as assembler. This patch let clang print registered targets when --version option is passed to clang. https://reviews.llvm.org/D79210 Files: clang/lib/Dr

[PATCH] D79213: [hip] Add noalias on restrict qualified coerced hip pointers

2020-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2267 + const ABIArgInfo &ArgI, const QualType &Ty) { + return LangOpts.HIP && isa(ArgI.getCoerceToType()) && + ArgI.getCoerceToType()->getPointerAddressSpace() == 1 && --

[PATCH] D79210: Let clang print registered targets for --version

2020-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. A sample output: clang --version clang version 11.0.0 (https://github.com/llvm/llvm-project d0a30964c78cec2e3907be8ec16cfbec69bc3f2d) Target: x86_64-unknown-linux-gnu Thread model: posix InstalledDir: /home/yaxunl/git/llvm/assert/bin Registered Targets: aarch64

[PATCH] D79213: [hip] Add noalias on restrict qualified coerced hip pointers

2020-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2268 + return LangOpts.HIP && isa(ArgI.getCoerceToType()) && + ArgI.getCoerceToType()->getPointerAddressSpace() == 1 && + CGF.ConvertType(Ty)->getPointerAddressSpace() == 0 &&

[PATCH] D79213: [hip] Add noalias on restrict qualified coerced hip pointers

2020-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2270 + CGF.ConvertType(Ty)->getPointerAddressSpace() == 0 && + ArgI.getCoerceToType()->getPointerElementType() == + CGF.ConvertType(Ty)->getPointerElementType(); ke

[PATCH] D79213: [hip] Add noalias on restrict qualified coerced hip pointers

2020-05-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2556-2563 + // Restrict qualified HIP pointers that were coerced to global pointers + // can be marked with the noalias attribute. + if (isCoercedHIPGlobalPointer(*this, getLangOpts(), ArgI, Ty)

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

2020-05-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. constexpr variables are compile time constants and implicitly const, therefore they are safe to emit on both device and host side. Besides, in many cases they are intended for both device and host, therefore it makes sense to emi

[PATCH] D79210: Let clang print registered targets for --version

2020-05-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is it OK to commit this? Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79210/new/ https://reviews.llvm.org/D79210 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 261811. yaxunl retitled this revision from "[HIP] Let lambda be host device by default" to "[HIP] Add -fhip-lambda-host-device". yaxunl edited the summary of this revision. yaxunl added a comment. Revised. CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 282952. yaxunl retitled this revision from "[CUDA][HIP] Support accessing static device variable in host code" to "[CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc". yaxunl edited the summary of this revision. yaxunl added a c

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

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall, JonChesterfield, hliao. Herald added a subscriber: dang. yaxunl requested review of this revision. This is separated from https://reviews.llvm.org/D80858 For -fgpu-rdc mode, static device vars in different TU's may have the same

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

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 283028. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by Artem's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

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

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 283067. yaxunl added a comment. Herald added subscribers: atanasyan, sdardis. added tests for targets supporting fp atomics. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/

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

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D71726#2182667 , @tra wrote: > LGTM, modulo couple of nits. > > @jyknight are you OK with this? > > In D71726#2179428 , @yaxunl wrote: > >> Make IEEE single and double type as supported fo

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

2020-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2193970 , @tra wrote: > What is expected to happen to device statics in anonymous name spaces? It may > be worth adding them to the tests. > > LGTM otherwise. static device var in anonymous name space will have external

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

2020-08-05 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was not accepted when it landed; it landed in state "Needs Review". This revision was automatically updated to reflect the committed changes. Closed by commit rG45f2a56856e2: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu… (authored by yaxunl). Herald

[PATCH] D85276: [PGO][CUDA][HIP] Skip generating profile on the device stub and wrong-side functions.

2020-08-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Do we need to disable pgo and coverage mapping for device compilation? Or it is already disabled? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D85276/new/ https://reviews.llvm.org/D85276 ___

[PATCH] D85276: [PGO][CUDA][HIP] Skip generating profile on the device stub and wrong-side functions.

2020-08-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/D85276/new/ https://reviews.llvm.org/D85276 _

[PATCH] D85471: Make clang HIP headers compatible with C++98

2020-08-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/D85471/new/ https://reviews.llvm.org/D85471 _

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

2020-08-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I just saw bugzilla bug https://bugs.llvm.org/show_bug.cgi?id=46922 my patch https://reviews.llvm.org/D77954 is supposed to fix this issue. However since implicit host device functions often cause overloading resolution diagnostics on the device side which are not deferr

[PATCH] D85471: Make clang HIP headers compatible with C++98

2020-08-07 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 rGac3e720dc1af: Make clang HIP headers compatible with C++98 (authored by yaxunl). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

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

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

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D71726#2207148 , @jyknight wrote: > In D71726#2182667 , @tra wrote: > >>> If a target would like to treat single and double fp atomics as >>> unsu

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

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 284463. yaxunl marked 2 inline comments as done. yaxunl added a comment. Revised by James' comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71726/new/ https://reviews.llvm.org/D71726 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2207699 , @tra wrote: > Sam, just a FYI that the patch has a couple of unintended consequences. > > We now end up with various things instantiated as device-side __constant__ > objects when they were not before, when we c

[PATCH] D85686: [CUDA][HIP] Do not externalize implicit constant static variable

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl requested review of this revision. https://reviews.llvm.org/D85686 Files: clang/include/clang/AST/ASTContext.h clang/lib/AST/ASTContext.cpp clang/lib/Sema/SemaExpr.cpp clang/test/CodeGenCUDA/static-device-var-no-rdc.cu In

[PATCH] D80858: [CUDA][HIP] Support accessing static device variable in host code for -fno-gpu-rdc

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80858#2207898 , @tra wrote: >> We can restrict externalization to constant variables with explicit >> 'constant' attributes only, which should fix this issue. > > SGTM. If it does not have explicit device-side attribute, it's n

[PATCH] D85686: [CUDA][HIP] Do not externalize implicit constant static variable

2020-08-10 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:11196 return !getLangOpts().GPURelocatableDeviceCode && - (D->hasAttr() || D->hasAttr()) && + (D->hasAttr() || + (D->hasAttr() && --

[PATCH] D85686: [CUDA][HIP] Do not externalize implicit constant static variable

2020-08-10 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 rGfb04d7b4a698: [CUDA][HIP] Do not externalize implicit constant static variable (authored by yaxunl). Herald added a project: clang. Changed prior to commit: http

[PATCH] D84068: AMDGPU/clang: Search resource directory for device libraries

2020-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D84068#2208394 , @arsenm wrote: >> > > Long term, I'd rather aim for merging rocm-device-libs into libclc and making > it an llvm project. They're largely forks of the same original sources from > about 5 years ago, and it's a

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

2020-08-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 284882. yaxunl added a comment. rebase to ToT and minor bug fixes 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/Target

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

2020-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 285482. yaxunl marked 13 inline comments as done. yaxunl added a comment. revised by Artem's comments, with minor bug fixes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/ https://reviews.llvm.org/D60620 Files: clang/include/clang/Basic/

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

2020-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/include/clang/Basic/TargetID.h:42 +/// is not a null pointer. +/// If \p CanonicalizeProc is true, canonicalize returned processor name. +llvm::Optional tra wrote: > Comment needs updating as parameters and return v

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

2020-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added a comment. In D60620#2216796 , @tra wrote: > Couple of minor nits. LGTM otherwise. Will revise as suggested when committing. Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D60620/new/

[PATCH] D79210: Let clang print registered targets for --version

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG66041187c902: Let clang print registered targets for --version (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D78655: [HIP] Add -fhip-lambda-host-device

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 261869. yaxunl added a comment. add one more test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/LangOptions.def clang/include/clang/Driver/Options.td clang/include/cla

[PATCH] D79344: [cuda] Start diagnosing variables with bad target.

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:156 + if (VD->getType()->isCUDADeviceBuiltinSurfaceType() || + VD->getType()->isCUDADeviceBuiltinTextureType()) +return CFT_HostDevice; We may need to mark constexpr variables as host

[PATCH] D79344: [cuda] Start diagnosing variables with bad target.

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/SemaCUDA/variable-target.cu:42 + return 0; +} hliao wrote: > yaxunl wrote: > > we need to have a test to check captured local host variable is allowed in > > device lambda. > > > > we need to have some test

[PATCH] D79367: [CUDA][HIP] Fix empty ctor/dtor check for union

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. union ctor does not call ctors of its data members. union dtor does not call dtors of its data members. Also union does not have base class. https://godbolt.org/z/8RxZeG Currently when clang checks whether union has an empty c

[PATCH] D79367: [CUDA][HIP] Fix empty ctor/dtor check for union

2020-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd75a6e93ae99: [CUDA][HIP] Fix empty ctor/dtor check for union (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D77954: [CUDA][HIP] Fix host/device based overload resolution

2020-05-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#2021026 , @tra wrote: > It appears that re-landed b46b1a916d44216f0c70de55ae2123eb9de69027 > has > created another compilation regression. I don't hav

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

2020-05-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. https://reviews.llvm.org/D77954 caused regressions due to diagnostics in implicit host device functions. The implicit host device functions are often functions in system headers forced to be device host by pragmas. Some of th

[PATCH] D79565: Document outputing registered targets with -v in release notes

2020-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: hans. https://reviews.llvm.org/D79565 Files: clang/docs/ReleaseNotes.rst Index: clang/docs/ReleaseNotes.rst === --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rs

[PATCH] D79210: Let clang print registered targets for --version

2020-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79210#2024555 , @hans wrote: > I think this is worth a short note in docs/ReleaseNotes.rst. https://reviews.llvm.org/D79565 Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D79210: Let clang print registered targets for --version

2020-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79210#2025058 , @thakis wrote: > In D79210#2025009 , @thakis wrote: > > > We've talked about this 3 years ago in https://reviews.llvm.org/D33900 and > > back then decided that this shoul

[PATCH] D79210: Let clang print registered targets for --version

2020-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79210#2025547 , @MaskRay wrote: > @yaxunl The plural form `--print-targets` may make more sense to be > consistent with other plural form options (--print-search-dirs, > --print-diagnostic-categories, etc) Agree Repository

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

2020-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 262858. yaxunl edited the summary of this revision. yaxunl added a comment. fix regression. only treat implicit host device candidate inferior in device compilation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79526/new/ https://reviews.llvm.org/D

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

2020-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79526#2025761 , @tra wrote: > I've tested the patch on our sources and it still breaks tensorflow > compilation, though in a different way: > > In file included from > third_party/tensorflow/core/kernels/slice_op_gpu.cu.cc:2

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

2020-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79526#2027242 , @tra wrote: > The latest version of the patch works well enough to compile tensorflow. > That's the good news. > > In D79526#2026857 , @yaxunl wrote: > > > Looks like we

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

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 263041. yaxunl marked 2 inline comments as done. yaxunl added a comment. introduce Sema::IsCUDAImplicitHostDeviceFunction() and remove changes to IdentifyCUDATarget and IdentifyCUDAPreference. Added one more test. CHANGES SINCE LAST ACTION https://reviews.

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

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added a comment. In D79526#2027695 , @tra wrote: > This one is just a FYI. I've managed to reduce the failure in the first > version of this patch and it looks rather odd because the reduced test case > has

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

2020-05-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79526#2027552 , @tra wrote: > In D79526#2027470 , @yaxunl wrote: > > > For implicit host device functions, since they are not guaranteed to work > > in device compilation, we can only re

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

2020-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Sema/Sema.h:11670 + bool IsCUDAImplicitHostDeviceFunction(const FunctionDecl *D); + tra wrote: > I think this can be `static` as it does not need Sema's stat

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

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

[PATCH] D79754: [OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1

2020-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: llvm/include/llvm/ADT/Triple.h:700 return getArch() == Triple::r600 || getArch() == Triple::amdgcn; } jdoerfert wrote: > What's the difference between an AMDGPU and AMDGCN? AMDGPU inlude r600 and amdgcn. r600 ar

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

2020-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/test/SemaCUDA/function-overload.cu:479 +namespace ImplicitHostDeviceVsWrongSided { +inline CorrectOverloadRetTy callee(double x); +#pragma clang force_cuda_host_device begin

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

2020-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 3 inline comments as done. Closed by commit rGe03394c6a6ff: [CUDA][HIP] Workaround for resolving host device function against wrong-sided… (authored by yaxunl). Herald added a project: clang. Changed prior to

[PATCH] D79565: Add -print-targets to print the registered targets

2020-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 263410. yaxunl retitled this revision from "Document outputing registered targets with -v in release notes" to "Add -print-targets to print the registered targets". yaxunl added reviewers: MaskRay, thakis, echristo, tra. yaxunl added a comment. add option -pri

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

2020-05-12 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] D72841: Add support for pragma float_control, to control precision and exception behavior at the source level

2020-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Serialization/ASTReader.cpp:7899 +if (FpPragmaCurrentLocation.isInvalid()) { + assert(*FpPragmaCurrentValue == SemaObj->FpPragmaStack.DefaultValue && + "Expected a default pragma float_control value"); -

[PATCH] D79866: [CUDA][HIP] Do not emit debug info for stub function

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. Herald added a subscriber: aprantl. Herald added a reviewer: aaron.ballman. The stub function is generated by compiler and its instructions have nothing to do with the kernel source code. Currently clang generates debug info for

[PATCH] D79565: Add -print-targets to print the registered targets

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGcf2fb139321c: Add -print-targets to print the registered targets (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llv

[PATCH] D72841: Add support for pragma float_control, to control precision and exception behavior at the source level

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Serialization/ASTReader.cpp:7899 +if (FpPragmaCurrentLocation.isInvalid()) { + assert(*FpPragmaCurrentValue == SemaObj->FpPragmaStack.DefaultValue && + "Expected a default pragma float_control value"); -

[PATCH] D79866: [CUDA][HIP] Do not emit debug info for stub function

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79866#2034460 , @tra wrote: > I do not see the behavior the patch is supposed to fix in CUDA. > If I compile a simple program, host-side debugger does not see the `kernel`, > sees `__device_stub_kernel` and, if the breakpoint

[PATCH] D79866: [HIP] Do not emit debug info for stub function

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79866#2034748 , @tra wrote: > In D79866#2034683 , @yaxunl wrote: > > > can you try set bp by using file name and line number on the kernel? > > > In regular gdb it is set on the stub. >

[PATCH] D79866: [HIP] Do not emit debug info for stub function

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 263831. yaxunl retitled this revision from "[CUDA][HIP] Do not emit debug info for stub function" to "[HIP] Do not emit debug info for stub function". yaxunl added a comment. limit change to HIP CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79866/new

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

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79237#2031870 , @tra wrote: > > constexpr variables are compile time constants and implicitly const, > > therefore > > they are safe to emit on both device and host side. Besides, in many cases > > they are intended for both

[PATCH] D79866: [HIP] Do not emit debug info for stub function

2020-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1b7bf1bd75dc: [HIP] Do not emit debug info for stub function (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

[PATCH] D79788: AMDGPU/OpenCL: Accept -nostdlib in place of -nogpulib

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

[PATCH] D79754: [OpenMP][AMDGCN] Support OpenMP offloading for AMDGCN architecture - Part 1

2020-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: llvm/include/llvm/ADT/Triple.h:700 return getArch() == Triple::r600 || getArch() == Triple::amdgcn; } sameerds wrote: > yaxunl wrote: > > jdoerfert wrote: > > > What's the difference between an AMDGPU and AMDGCN

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. Herald added a subscriber: aprantl. NoDebug attr does not totally eliminate debug info about a function when inlining is enabled. This is inconsistent with when inlining is disabled. This patch fixes that. https://reviews.llvm

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D79967#2037675 , @dblaikie wrote: > I'm not quite following the test case - could you explain how it's testing > the situation? > > It might be better/easier to have a more intentional test - also, could you > check the commit

[PATCH] D79967: Fix debug info for NoDebug attr

2020-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 264148. yaxunl added a comment. add a test for nodebug attr. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D79967/new/ https://reviews.llvm.org/D79967 Files: clang/lib/CodeGen/CGDebugInfo.cpp clang/test/CodeGen/nodebug-attr.c clang/test/CodeGen

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