[PATCH] D68587: [hip] Assume host-only compilation if the final phase is ahead of `backend`.

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D68587#1700178 , @tra wrote: > TL; DR; > +1 to formalizing how we want -M*/-E/-S/-emit-llvm/-fsyntax-only to behave. > OK with -M/-E/-S defaulting to host, and erroring out if applied to multiple > sub-compilations. > I'm st

[PATCH] D68587: [hip] Assume host-only compilation if the final phase is ahead of `backend`.

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao abandoned this revision. hliao added a comment. need to more clarification and re-design Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68587/new/ https://reviews.llvm.org/D68587 ___ cfe-commits m

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, yaxunl. Herald added a project: clang. Herald added a subscriber: cfe-commits. - So far, we only recognize the compilation with offloading and skip the offloading part. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D6866

[PATCH] D68663: [clang-offload-bundler] Support `.cui` and `.d`.

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, yaxunl. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D68663 Files: clang/tools/clang-offload-bundler/ClangOffloadBundler.cpp Index: clang/tools/cl

[PATCH] D68663: [clang-offload-bundler] Support `.cui` and `.d`.

2019-10-08 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Adding this support is aimed to prevent crashing or failure, it's not intended to be final output for -M or -E. So, hip fails on these options due to the unsupported type of clang-offload-bundler. Before we nail down the details on the expected output of -M or -E, especia

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:117 // The one job we find should be to invoke clang again. const auto &Cmd = cast(*Jobs.begin()); if (StringRef(Cmd.getCreator().getName()) != "clang") { -

[PATCH] D68663: [clang-offload-bundler] Support `.cui` and `.d`.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG2ae54aba03f2: [clang-offload-bundler] Support `.cui` and `.d`. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D68663?vs=223932&id=224044#toc Repository: rG LLVM Github Monorep

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: rsmith, eli.friedman. Herald added a project: clang. Herald added a subscriber: cfe-commits. - [Itanium C++ ABI][1], for certain contexts like default parameter and etc., mangling numbering will be local to the particular argument in which it ap

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 224115. hliao added a comment. remove refactoring code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68715/new/ https://reviews.llvm.org/D68715 Files: clang/include/clang/AST/ASTContext.h clang/include/clang

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Sema/SemaLambda.cpp:353 + ManglingContextDecl), +ManglingContextDecl); } efriedma wrote: > If I'm following correctly, t

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. s/code/core/ in last comment Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68715/new/ https://reviews.llvm.org/D68715 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68660/new/ https://reviews.llvm.org/D68660 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D68715#1701986 , @efriedma wrote: > LGTM Thanks. BTW, shall I commit the refactoring code directly. That change just replaces the code returning multiple values from pointer/reference argument with a tuple. Repository: rG

[PATCH] D68715: [mangle] Fix mangling where an extra mangle context is required.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGfd18e94697c9: [mangle] Fix mangling where an extra mangle context is required. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68715/new/

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-09 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:117 // The one job we find should be to invoke clang again. const auto &Cmd = cast(*Jobs.begin()); if (StringRef(Cmd.getCreator().getName()) != "clang") { -

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, rsmith, yaxunl. Herald added a reviewer: martong. Herald added a reviewer: shafik. Herald added a project: clang. Herald added a subscriber: cfe-commits. - HIP/CUDA host side needs to use device kernel symbol name to match the device side b

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. this's a patch address the same issue previously proposed to be worked around in https://reviews.llvm.org/D63164 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 ___

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 2 inline comments as done. hliao added a comment. minor comment to help review. BTW, as the AST ser/deser is changed as well, not sure we have compatibility issue and, if there is, how to handle that. please advice me on that concern. Thanks. Comment at: clang/i

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 224443. hliao added a comment. add more assertions on offload compilation. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68660/new/ https://reviews.llvm.org/D68660 Files: clang/lib/Tooling/Tooling.cpp clang/

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:117 // The one job we find should be to invoke clang again. const auto &Cmd = cast(*Jobs.begin()); if (StringRef(Cmd.getCreator().getName()) != "clang") { -

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Tooling/Tooling.cpp:102 + if (isa(A)) { +assert(Actions.size() == 2); +assert(isa(Actions.front())); tra wrote: > Why 2? Will it not be different if us

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 224476. hliao marked an inline comment as done. hliao added a comment. revice comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68660/new/ https://reviews.llvm.org/D68660 Files: clang/lib/Tooling/Tooling.

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG1ccb39bbd87c: [tooling] Teach Tooling to understand compilation with offloading. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68660/new

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D68660#1705087 , @thakis wrote: > This makes tests assert on Mac: http://45.33.8.238/mac/1415/step_6.txt I have no access to MacOS but try to fix that in r374478. Maybe that's a good excuse for a MacBook, ;) Repository: rG

[PATCH] D68660: [tooling] Teach Tooling to understand compilation with offloading.

2019-10-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D68660#1705087 , @thakis wrote: > This makes tests assert on Mac: http://45.33.8.238/mac/1415/step_6.txt please let me know whether that works for you. thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-11 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review, thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://l

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-15 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-15 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D68818#1709688 , @tra wrote: > @rsmith Richard, could you take a look, please? Lambdas, mangling, ODR rules > & ABI scare me. :-) @tra thanks for promoting the review. This patch is quite critical to support extended lambda in

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-16 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added a comment. In D68818#1711698 , @rsmith wrote: > Broadly, I think it's reasonable to number additional lambda expressions in > CUDA compilations. However: > > - This is (in theory) an ABI break on the hos

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 225452. hliao added a comment. Force numbering on all lambdas in CUDA/HIP. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 Files: clang/include/clang/AST/DeclCXX.h cl

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. this patch enables the dumping of actions in the hierarchy or tree. In most cases, it's a linear list but, for offload compilation, a tree representation is more intuitive. Even though there are cross-subtree edges, they are rare and also noted in the corresponding action

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, sfantao, echristo. Herald added a project: clang. Herald added a subscriber: cfe-commits. hliao added a comment. this patch enables the dumping of actions in the hierarchy or tree. In most cases, it's a linear list but, for offload compilat

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D69124#1713360 , @tra wrote: > Could you give an example of before/after output? $ clang -x cuda -ccc-print-phases --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_60 -c ~/dummy.cpp 0: input, "/home/michliao/dummy.cpp", cud

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D69124#1713360 , @tra wrote: > Could you give an example of before/after output? For HIP $ clang -x hip -ccc-print-phases --cuda-gpu-arch=gfx900 --cuda-gpu-arch=gfx906 -c ~/dummy.cpp 0: input, "/home/michliao/dummy.c

[PATCH] D68554: [clang-format] Proposal for clang-format to give compiler style warnings

2019-10-17 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/Format/dry-run-alias.cpp:1-2 +// RUN: clang-format -style=LLVM -i -n %s 2> %t.stderr +// RUN: grep -E "*code should be clang-formatted*" %t.stderr + Why not check with `FileCheck`? Comment at:

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D69124#1713427 , @tra wrote: > This is... rather oddly-structured output. My brain refuses to accept that > the most-indented phase is the input. > Perhaps we should do `llvm::errs().indent(MaxIdent-Ident)`. This should give >

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 225620. hliao added a comment. revise the output by drawing tree lines. now, the output looks like $ clang -x cuda -ccc-print-phases --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_60 -c dummy.cpp +- 0: input, "/home/michliao/dummy.cpp", cuda, (host-c

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 225678. hliao added a comment. minor test case revising. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68818/new/ https://reviews.llvm.org/D68818 Files: clang/include/clang/AST/DeclCXX.h clang/include/clang/

[PATCH] D69124: [clang][driver] Print compilation phases with indentation.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd7a487adfedb: [clang][driver] Print compilation phases with indentation. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69124/new/ https

[PATCH] D68818: [hip][cuda] Fix the extended lambda name mangling issue.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG243ebfba17da: [hip][cuda] Fix the extended lambda name mangling issue. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D68818?vs=225678&id=225720#toc Repository: rG LLVM Github

[PATCH] D63164: [HIP] Add option to force lambda nameing following ODR in HIP/CUDA.

2019-10-18 Thread Michael Liao via Phabricator via cfe-commits
hliao abandoned this revision. hliao added a comment. revised change is already committed. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D63164/new/ https://reviews.llvm.org/D63164 ___ cfe-commits maili

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2019-10-22 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: rsmith, rjmccall, tra, yaxunl. Herald added a reviewer: martong. Herald added a reviewer: shafik. Herald added subscribers: cfe-commits, erik.pilkington. Herald added a project: clang. - On Windows, extended lambda has extra issues due to the num

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2019-10-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D69389: [hip] Relax an allow the declaration of functions with variadic arguments in HIP.

2019-10-24 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: jlebar, tra, yaxunl. Herald added a project: clang. Herald added a subscriber: cfe-commits. - As variadic parameters have the lowest rank in overload resolution, without real usage of `va_arg`, they are commonly used as the catch-all fallbacks i

[PATCH] D69389: [hip] Allow the declaration of functions with variadic arguments in HIP.

2019-10-24 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 226301. hliao added a comment. revise commit message Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69389/new/ https://reviews.llvm.org/D69389 Files: clang/lib/CodeGen/TargetInfo.cpp clang/lib/Driver/ToolChai

[PATCH] D69389: [hip] Allow the declaration of functions with variadic arguments in HIP.

2019-10-24 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:7764 + QualType Ty) const { + llvm_unreachable("AMDGPU does not support varargs"); +} tra wrote: > llvm_unreachable(

[PATCH] D69389: [hip] Allow the declaration of functions with variadic arguments in HIP.

2019-10-24 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5a48678a6a16: [hip] Allow the declaration of functions with variadic arguments in HIP. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D693

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2019-10-29 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llv

[PATCH] D80237: [hip] Ensure pointer in struct argument has proper `addrspacecast`.

2020-05-19 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 265148. hliao added a comment. Revise following comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80237/new/ https://reviews.llvm.org/D80237 Files: clang/lib/CodeGen/CGCall.cpp clang/test/CodeGenCUDA/a

[PATCH] D80237: [hip] Ensure pointer in struct argument has proper `addrspacecast`.

2020-05-22 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added a comment. In D80237#2051887 , @rjmccall wrote: > `addrspacecast` might be a real conversion. I feel like this is really going > well beyond what argument coercion should be expected to do, and we need

[PATCH] D80237: [hip] Ensure pointer in struct argument has proper `addrspacecast`.

2020-05-22 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80237#2051918 , @rjmccall wrote: > In D80237#2051909 , @hliao wrote: > > > In D80237#2051887 , @rjmccall > > wrote: > > > > > `addrspacecast` migh

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

2020-07-22 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Hi @rsmith, @rjmccall and @tra what's your suggestion to make progress on this review? In D71227#2167596 , @tra wrote: > Is this patch still actual? I need to rebase this to the latest trunk. Interrupt with other heavy loads. R

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao requested changes to this revision. hliao added a comment. This revision now requires changes to proceed. 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 speci

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2169399 , @yaxunl wrote: > In D80858#2169295 , @hliao wrote: > > > I don't that's proper way to support file-scope static device variables. As > > we discuss APIs like cudaMemcpyToS

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. 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 same name. That's an issue of our current RDC support through LLVM IR instead of nati

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2170533 , @yaxunl wrote: > In D80858#2170328 , @hliao wrote: > > > In D80858#2169534 , @yaxunl wrote: > > > > > Another reason is that we nee

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2170547 , @tra wrote: > Would it work if we generate a globally unique visible aliases for the static > vars and use the alias' name to register device-side entities without > changing their visibility? We still need to

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2170668 , @tra wrote: > In D80858#2170604 , @hliao wrote: > > > In D80858#2170547 , @tra wrote: > > > > > Would it work if we generate a glob

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

2020-07-23 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2170821 , @tra wrote: > In D80858#2170781 , @hliao wrote: > > > The problem is not whether we have solution to tell them but when we need > > to add that. Not all `static` device va

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

2020-07-28 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D80858#2177104 , @yaxunl wrote: > 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 t

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

2020-07-28 Thread Michael Liao via Phabricator via cfe-commits
hliao 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 o

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

2020-04-03 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, yaxunl. Herald added a project: clang. Herald added a subscriber: cfe-commits. - `RegisterVar` has `void` return type and `size_t` in its variable size parameter in HIP or CUDA 9.0+. Repository: rG LLVM Github Monorepo https://reviews.

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

2020-04-03 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGb952d799cacd: [cuda][hip] Fix `RegisterVar` function prototype. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77398/new/ https://review

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

2020-04-05 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 255219. hliao added a comment. Rebase to the latest trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/Pars

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

2020-04-06 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added a reviewer: yaxunl. Herald added a project: clang. Herald added a subscriber: cfe-commits. - Use `device_builtin_surface` and `device_builtin_texture` for surface/texture reference support. So far, both the host and device use the same reference type, whi

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

2020-04-06 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D77583#1965823 , @yaxunl wrote: > Is the runtime and HIP directed test change in place? yeah, I verified several tests using texture references. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://review

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

2020-04-07 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc97be2c37785: [hip] Remove `hip_pinned_shadow`. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77583/new/ https://reviews.llvm.org/D7758

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added a reviewer: tra. Herald added subscribers: cfe-commits, hiraditya, mgorny, jholewinski. Herald added a project: clang. - Replace them with the internal version, i.e. `nvvm.texsurf.handle.internal` just before the instruction selector. - Teach clang codegen

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 256321. hliao added a comment. Rebase to trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7/new/ https://reviews.llvm.org/D7 Files: clang/lib/CodeGen/TargetInfo.cpp clang/test/CodeGenCUDA/surface

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

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao requested changes to this revision. hliao added a comment. This revision now requires changes to proceed. In D77743#1970304 , @tra wrote: > In D77743#1970163 , @yaxunl wrote: > > > The kernel handle is a varia

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

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. 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 instead of the kernel launch syntax) to call into that stub function to prepare the a

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

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D77743#1972298 , @yaxunl wrote: > 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 th

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

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. The ambiguity issue is still there. That `__global__` function generates different code if it's compiled as HIP by clang or non-HIP code by clang or other compilers. That will break the resolving from the symbol value to its device kernel name. CHANGES SINCE LAST ACTION

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D7#1972349 , @tra wrote: > The patch could use a more detailed description. Specifically, it does not > describe the purpose of these changes. > > > Replace them with the internal version, i.e. nvvm.texsurf.handle.internal >

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-09 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 256511. hliao added a comment. Add more comments to explain what that pass does. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7/new/ https://reviews.llvm.org/D7 Files: clang/lib/CodeGen/TargetInfo.cpp

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-10 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 256518. hliao added a comment. Fix a clang-tidy warning. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D7/new/ https://reviews.llvm.org/D7 Files: clang/lib/CodeGen/TargetInfo.cpp clang/test/CodeGenCUD

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D7#1974672 , @tra wrote: > In D7#1972720 , @hliao wrote: > > > In D7#1972349 , @tra wrote: > > > > > The patch could use a more detailed

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D7#1974988 , @tra wrote: > In D7#1974849 , @hliao wrote: > > > > > > > > >> NVVM IR spec is for nvidia's own compiler. It's based on LLVM, but it does > >> not impose direct constr

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D7#1975406 , @tra wrote: > In D7#1975178 , @hliao wrote: > > > the 1st argument in `llvm.nvvm.texsurf.hande.internal` or the 2nd one in > > `llvm.nvvm.texsurf.handle` must be kept

[PATCH] D77777: [nvptx] Add `nvvm.texsurf.handle` internalizer.

2020-04-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D7#1975440 , @tra wrote: > Also, if I read PTX docs correctly, it should be OK to pass texture handle > address via an intermediate variable: > > https://docs.nvidia.com/cuda/parallel-thread-execution/index.html#texture-sam

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-04-11 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1975784 , @tra wrote: > It appears I can crash clang with some texture code: > https://godbolt.org/z/5vdEwC `llvm.nvvm.tex.unified.2d.v4f32.f32` has a vector output, the alias __attribute__((device)) float tex2d_ld(te

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

2020-04-14 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 257347. hliao added a comment. Rebase to trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.cpp

[PATCH] D81427: [hip] Fix device-only relocatable code compilation.

2020-06-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: yaxunl, tra. Herald added a project: clang. Herald added a subscriber: cfe-commits. - In HIP, just as the regular device-only compilation, the device-only relocatable code compilation should not involve offload bundle. - In addition, that device

[PATCH] D81427: [hip] Fix device-only relocatable code compilation.

2020-06-09 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 269555. hliao added a comment. Revise following reviewer's comment. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81427/new/ https://reviews.llvm.org/D81427 Files: clang/lib/Driver/Driver.cpp clang/test/Driv

[PATCH] D81427: [hip] Fix device-only relocatable code compilation.

2020-06-10 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8b6821a5843b: [hip] Fix device-only relocatable code compilation. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D81427?vs=269555&id=269928#toc Repository: rG LLVM Github Mono

[PATCH] D81427: [hip] Fix device-only relocatable code compilation.

2020-06-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81427#2085739 , @thakis wrote: > This doesn't pass tests: http://45.33.8.238/linux/19977/step_7.txt > > Please take a look, and please revert for now if fixing takes a while. Thanks. I am building with PowerPC enabled to reprod

[PATCH] D81427: [hip] Fix device-only relocatable code compilation.

2020-06-10 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81427#2085739 , @thakis wrote: > This doesn't pass tests: http://45.33.8.238/linux/19977/step_7.txt > > Please take a look, and please revert for now if fixing takes a while. Fixed in https://github.com/llvm/llvm-project/commi

[PATCH] D81670: [TTI] Expose isNoopAddrSpaceCast from TLI.[SROA] Teach SROA to recognize no-op addrspacecast.

2020-06-11 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: arsenm, chandlerc. Herald added subscribers: llvm-commits, cfe-commits, kerbowa, dexonsmith, steven_wu, hiraditya, nhaehnle, wdng, jvesely. Herald added projects: clang, LLVM. So far, SROA could only handle convertible pointer pairs if they are

[PATCH] D81670: [TTI] Expose isNoopAddrSpaceCast from TLI.[SROA] Teach SROA to recognize no-op addrspacecast.

2020-06-11 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 270177. hliao added a comment. Revise the formatting. Updating D81670: [TTI] Expose isNoopAddrSpaceCast from TLI. === [SROA] Teach SROA to recognize no-op addrspacecast. Repository: rG LLVM Github Mon

[PATCH] D81670: [TTI] Expose isNoopAddrSpaceCast from TLI.[SROA] Teach SROA to recognize no-op addrspacecast.

2020-06-11 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81670#2087974 , @arsenm wrote: > We should instead allow bitcast to perform no-op addrspacecasts That may be a little bit challenging as so far no-op `addrspacecast` is target-specific. There may be no TTI available when `bitc

[PATCH] D81849: [clang][amdgpu] Prefer not using `fp16` conversion intrinsics.

2020-06-15 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: yaxunl, arsenm. Herald added subscribers: cfe-commits, kerbowa, t-tye, tpr, dstuttard, nhaehnle, wdng, jvesely, kzhuravl. Herald added a project: clang. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D81849 Files: clang/lib/B

[PATCH] D81938: [SROA] Teach SROA to perform no-op pointer conversion.[InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: arsenm, chandlerc. Herald added subscribers: llvm-commits, cfe-commits, kerbowa, hiraditya, nhaehnle, wdng, jvesely. Herald added projects: clang, LLVM. - When promoting a pointer from memory to register, SROA skips pointers from different addr

[PATCH] D81849: [clang][amdgpu] Prefer not using `fp16` conversion intrinsics.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe830fa260da9: [clang][amdgpu] Prefer not using `fp16` conversion intrinsics. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81849/new/ h

[PATCH] D81938: [SROA] Teach SROA to perform no-op pointer conversion.[InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81938#2095828 , @lebedev.ri wrote: > This should be two separate patches - inferaddressspace and SROA. Yes, I prepared that into 2 commits but `arc` combines them together. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 271162. hliao added a comment. Fix constant expression handling. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81938/new/ https://reviews.llvm.org/D81938 Files: clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer

[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81938#2095982 , @tra wrote: > In D81938#2095869 , @hliao wrote: > > > In D81938#2095828 , @lebedev.ri > > wrote: > > > > > This should be two sepa

[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D81938#2096500 , @arsenm wrote: > I'm not entirely convinced this is safe in all contexts. I think you can > argue that this is safe if it directly feeds a memory instruction, as the > access would be undefined if it weren't val

[PATCH] D81938: [InferAddressSpaces] Handle the pair of `ptrtoint`/`inttoptr`.

2020-06-17 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 271551. hliao added a comment. Add TTI hooks to double-check that address space casting is no-op. NOTE: This change depends on - https://reviews.llvm.org/D82025 (exposing `isNoopAddrSpaceCast` from TLI into TTI) to be compiled. - https://reviews.llvm.org/D8194

<    1   2   3   4   5   6   >