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

2020-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#1976294 , @rjmccall wrote: > If `nvcc` ignores host/device-ness when selecting overloads, that's probably > the specified behavior, right? I agree that it would be better to not ignore > it, but Clang shouldn't just mak

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

2020-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#1976316 , @yaxunl wrote: > In D77954#1976294 , @rjmccall wrote: > > > If `nvcc` ignores host/device-ness when selecting overloads, that's > > probably the specified behavior, right

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

2020-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/CodeGenOpenCL/builtins-amdgcn.cl:541 switch (d) { - case 0: *out = __builtin_amdgcn_workgroup_size_x(); break; + case 0: *out = __builtin_amdgcn_workgroup_size_x() +

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

2020-04-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77954#1976378 , @rjmccall wrote: > I'm not saying that we need to be bug-for-bug-compatible with `nvcc`, I'm > just saying that we should be able to point to *something* to justify our > behavior. I take it that the CUDA spec

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

2020-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 256903. yaxunl retitled this revision from "[CUDA][HIP] Fix overload resolution issue for device host functions" to "[CUDA][HIP] Fix host/device based overload resolution". yaxunl added a comment. Revised by John's comments. CHANGES SINCE LAST ACTION http

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

2020-04-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77743#1975822 , @rjmccall wrote: > Is the renaming just being done to avoid breakpoints from triggering in the > stub? Can you not disable debugging the stub using whatever mechanism > `__attribute__((nodebug))` uses? I tri

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

2020-04-13 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:9481 + // emitted, Cand1 is not better than Cand2. This rule should have precedence + // over other rules. + // rjmccall wrote: > Please add `[CU

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

2020-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 256973. yaxunl marked 3 inline comments as done. yaxunl added a comment. fix preference for multiversion. add comments. add more tests for wrong-sided function. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77954/new/ https://reviews.llvm.org/D77954

[PATCH] D78019: HIP: Fix handling of denormal mode

2020-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:286 + +// FIXME: Should this use the default mode based on the target? How do we +// deal with multiple --cuda-gpu-arch? If there are multiple --cuda-gpu-arch, driver will cr

[PATCH] D78020: clang/AMDGPU: Assume denormals are enabled for the default target.

2020-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I think https://reviews.llvm.org/D78019 should fix the issue about HIP not using correct default denormal value if no arch is specified. In that case, driver actually sets offloading arch to gfx803 and clang should be able to see it in JobAction. CHANGES SINCE LAST ACT

[PATCH] D78019: HIP: Fix handling of denormal mode

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

[PATCH] D78020: clang/AMDGPU: Assume denormals are enabled for the default target.

2020-04-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/cuda-flush-denormals-to-zero.cu:26 +// Test no subtarget +// FIXME: This defaults to gfx803, but gets a different denormal mode than explicitly specifying it. +// RUN: %clang -x hip -no-canonical-prefixes -### -target x

[PATCH] D77923: OpenCL: Fix some missing predefined macros

2020-04-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77923#1981698 , @jvesely wrote: > does passing `-U__OPENCL_VERSION__ -D __OPENCL_VERSION__=x.y` on the > commadline work as well? the header trick was my fallback path. Yes the command line option -U or -D override predefined

[PATCH] D78020: clang/AMDGPU: Assume denormals are enabled for the default target.

2020-04-15 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/D78020/new/ https://reviews.llvm.org/D78020 ___ cfe-commits mailing list cfe-

[PATCH] D77885: AMDGPU: Search for new ROCm bitcode library structure

2020-04-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. If we really want to do this, device lib change and hipcc change need to be ready. Since once this is committed without corresponding device lib and hipcc change, HIP will break. On ROCM, device lib is currently installed at /opt/rocm/lib with extension .amdgcn.bc. This

[PATCH] D77923: OpenCL: Fix some missing predefined macros

2020-04-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. The objective of the change is to simplify offline compilation. We want to avoid asking users to add -D if a proper macro can be inferred from triple and cpu. Ideally, users only need to specify triple and cpu with clang driver. In case users want to override the d

[PATCH] D77885: AMDGPU: Search for new ROCm bitcode library structure

2020-04-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:75 +// The desired structure is (${ROCM_ROOT} or +// ${OPENCL_ROOT})/amdgcn/bitcode/*, so try to detect this layout. with your change, the structure becomes ${ROCM_ROOT}/a

[PATCH] D76795: [HIP] Change default --gpu-max-threads-per-block value to 1024

2020-06-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rG04abbb3a7818: [HIP] Change default --gpu-max-threads-per-block value to 1024 (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Mono

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

2020-06-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D80450#2071696 , @tra wrote: > In D80450#2055463 , @tra wrote: > > > Is this patch supposed to be used with D79526 > > or instead of it? > > > ^^^ I don'

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

2020-06-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG049d860707ef: [CUDA][HIP] Fix constexpr variables for C++17 (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org

[PATCH] D81176: [HIP] Add default header and include path

2020-06-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: kerbowa, mgorny, nhaehnle, jvesely. To support std::complex and some other standard C/C++ functions in HIP device code, they need to be forced to be `__host__ __device__` functions by pragmas. This is done by s

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

2020-06-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG263390d4f5f2: [CUDA][HIP] Fix implicit HD function resolution (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D80450?vs=266366&id=268590#toc Repos

[PATCH] D81176: [HIP] Add default header and include path

2020-06-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/ROCm.h:68 + + // CUDA architectures for which we have raised an error in + // CheckRocmVersionSupportsArch. tra wrote: > CUDA -> GPU? > Looks like the

[PATCH] D81176: [HIP] Add default header and include path

2020-06-05 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 rG11d06b9511bd: [HIP] Add default header and include path (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D8

[PATCH] D81176: [HIP] Add default header and include path

2020-06-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81176#2077254 , @thakis wrote: > Also still failing on mac: http://45.33.8.238/mac/14992/step_7.txt I will try to fix it one more time. If it still fails I will revert it. Repository: rG LLVM Github Monorepo CHANGES SINCE

[PATCH] D81176: [HIP] Add default header and include path

2020-06-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81176#2077319 , @thakis wrote: > Still broken: http://45.33.8.238/win/16976/summary.html reverted. The difficulty for fixing these failures is that they only show up on some systems I do not have access and cannot see the co

[PATCH] D81176: [HIP] Add default header and include path

2020-06-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81176#2077333 , @yaxunl wrote: > In D81176#2077319 , @thakis wrote: > > > Still broken: http://45.33.8.238/win/16976/summary.html > > > reverted. > > The difficulty for fixing these failu

[PATCH] D81176: [HIP] Add default header and include path

2020-06-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81176#2077940 , @thakis wrote: > One more example failure: > http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/16333 > > (Note I had re-reverted your reland, see the 2 comments above your comment.) Sorry I misse

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

2020-06-09 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/D81427/new/ https://reviews.llvm.org/D81427 ___

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: tpr. Currently HIP toolchain calls clang to emit bitcode then calls opt/llc for device compilation for the default -fno-gpu-rdc case, which is unnecessary since clang is able to compile a single source file to

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81627#2088502 , @arsenm wrote: > In D81627#2088500 , @arsenm wrote: > > > It doesn't matter if we don't support isa linking. We should just use clang > > and default to -flto. LTO "just

[PATCH] D81713: [HIP] Fix rocm not found on rocm3.5

2020-06-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, arsenm. Herald added subscribers: kerbowa, nhaehnle, wdng, jvesely. Currently rocm detector expects device library bitcodes named as *.bc instead of *.amdgcn.bc. However in rocm3.5 the device library bitcodes are named as *.amdgcn.bc, whic

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/Driver.cpp:2725-2726 for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) { // Create a link action to link device IR with device library // and

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 270302. yaxunl marked 2 inline comments as done. yaxunl added a reviewer: ashi1. yaxunl added a comment. revised by Artem's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81627/new/ https://reviews.llvm.org/D81627 Files: clang/lib/Driver/

[PATCH] D81713: [HIP] Fix rocm not found on rocm3.5

2020-06-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81713#2089672 , @arsenm wrote: > Can you add tests for this? Is this also sufficient with the directory layout > change? You mean does this work after we move device lib from /opt/rocm/lib to /opt/rocm/amdgcn/bitcode ? CHA

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

2020-06-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D60620#2067134 , @tra wrote: > Do you expect users to specify these IDs? How do you see it being used in > practice? I think you do need to implement a user-friendly shortcut and > expand it to the detailed offload-id internall

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81627#2090499 , @tra wrote: > LGTM. Good to go if @arsenm is OK with fixing -fgpu-rdc in a separate patch. @arsenm Are you OK with fixing -fgpu-rdc in a separate patch? The fix for that is orthogonal to the current patch. Mi

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, ashi1. Herald added subscribers: kerbowa, dexonsmith, nhaehnle, jvesely. This patch is a follow up on https://reviews.llvm.org/D81627. In addition to default -fno-gpu-rdc case, this patches let HIP toolchain not use llvm-link/opt/llc to l

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:207-209 + Arg *A = Args.getLastArg(options::OPT_march_EQ); + if (!A) +A = Args.getLastArg(options::OPT_mcpu_EQ); arsenm wrote: > Wh

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 270825. yaxunl added a reviewer: arsenm. yaxunl added a comment. Herald added a subscriber: wdng. use -mcpu instead of march in HIP toolchain. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81861/new/ https://reviews.llvm.org/D81861 Files: clang/li

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added inline comments. Comment at: clang/test/Driver/hip-phases.hip:34 +// RDC-DAG: [[P6:[0-9]+]]: backend, {[[P5]]}, ir, (device-[[T]], [[ARCH]]) +// RDC-DAG: [[P10:[0-9]+]]: linker, {[[P6]]}, image, (device-hip, [[ARCH]]) --

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/test/Driver/hip-phases.hip:253 +// L2-DAG: [[P0:[0-9]+]]: input, "{{.*}}obj1.o", object, (host-[[T:hip]]) +// RL2-DAG: [[P1:[0-9]+]]: clang-offload-unbundler, {[[P0]]}, object, (host-[[T:hip

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 270836. yaxunl marked 3 inline comments as done. yaxunl added a comment. fix tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81861/new/ https://reviews.llvm.org/D81861 Files: clang/lib/Driver/Driver.cpp clang/lib/Driver/ToolChains/AMDGPU.h

[PATCH] D81627: [HIP] Do not call opt/llc for -fno-gpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGe8090d83fd92: [HIP] Do not call opt/llc for -fno-gpu-rdc (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D8

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6752786d657a: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D81861?vs=270836&id=270933#toc Repo

[PATCH] D81861: [HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

2020-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/test/Driver/hip-toolchain-no-rdc.hip:164 +// LKONLY-NOT: llvm-link +// LKONLY-NOT: opt +// LKONLY-NOT: llc arsenm wrote: > yamauchi wrote: > > Hi, this test seems to fail for

[PATCH] D81959: [HIP] Enable -amdgpu-internalize-symbols

2020-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: arsenm, rampitec, tra, ashi1. Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl. Enable -amdgpu-internalize-symbols to eliminate unused functions and global variables for whole program to speed up compilation and improve performa

[PATCH] D81959: [HIP] Enable -amdgpu-internalize-symbols

2020-06-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81959#2096616 , @arsenm wrote: > Isn't the internalization implied by LTO? I thought part of the appeal of LTO > is killing this off How does LTO know that the kernels need to be kept? CHANGES SINCE LAST ACTION https://re

[PATCH] D81713: [HIP] Fix rocm not found on rocm3.5

2020-06-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I will commit this patch since it allows hipcc to use old rocm device library. Will fix other issues later. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D81713/new/ https://reviews.llvm.org/D81713 ___ cfe-commits ma

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

2020-07-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 274774. yaxunl marked 4 inline comments as done. yaxunl added a comment. revised by Artem's and Paul's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/DiagnosticSem

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

2020-07-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:750 +bool Sema::CUDACheckLambdaCapture(CXXMethodDecl *Callee, + const sema::Capture &Capture) { tra wrote: > What do

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-01 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/AMDGPU.cpp:167 +llvm::ErrorOr> VersionFile = +FS.getBufferForFile(BinPath + "/.hipVersion"); +if (!VersionFile) arsenm wrote: > I don't

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-02 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/AMDGPU.cpp:167 +llvm::ErrorOr> VersionFile = +FS.getBufferForFile(BinPath + "/.hipVersion"); +if (!VersionFile) arsenm wrote: > arsenm w

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

2020-07-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Driver/Action.h:216 const llvm::opt::Arg &Input; - + unsigned Id; virtual void anchor(); rjmccall wrote: > Allowing an arbitrary string might be more ad

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

2020-07-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 275685. yaxunl marked 5 inline comments as done. yaxunl retitled this revision from "[HIP] Support accessing static device variable in host code" to "[CUDA][HIP] Support accessing static device variable in host code". yaxunl edited the summary of this revision

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:167 +llvm::ErrorOr> VersionFile = +FS.getBufferForFile(BinPath + "/.hipVersion"); +if (!VersionFile) tra wrote: > arsenm wrot

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/AMDGPU.cpp:167 +llvm::ErrorOr> VersionFile = +FS.getBufferForFile(BinPath + "/.hipVersion"); +if (!VersionFile) yaxunl wrote: > tra wrot

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

2020-07-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 276211. yaxunl added a comment. refactor CUDACheckLambdaCapture and add comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang

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

2020-07-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 276417. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/include/clang/Sema/Sema.h clang/

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

2020-07-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Sema/SemaCUDA.cpp:757-759 + // In host compilation, deferred diagnostics are only emitted for functions + // which are sure to be emitted on host side since there is no reliable + // w

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

2020-07-08 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 rG1eaad01046c8: [CUDA][HIP] Let lambda be host device by default (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D82087: AMDGPU/clang: Add builtins for llvm.amdgcn.ballot

2020-07-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Basic/Targets/AMDGPU.cpp:293 +"wavefrontsize32" : "wavefrontsize64"; + Features.insert(std::make_pair(DefaultWaveSizeFeature, true)); +} what's the default wave front size in backend for gfx10*

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 277095. yaxunl marked 2 inline comments as done. yaxunl added a comment. Herald added a reviewer: dang. Separate detecting ROCm path and device library path. Assume 3.5 as default HIP version. If -rocm-path is specified, do not require version file to exist.

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 11 inline comments as done. yaxunl added a comment. thanks. will fix when commit CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82930/new/ https://reviews.llvm.org/D82930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG849d4405f534: [HIP] Fix rocm detection (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D82930?vs=277095&id=277214#toc Repository: rG LLVM Github

[PATCH] D83591: [OpenMP][CUDA] Fix std::complex in GPU regions

2020-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. This fixed the regression caused by previous change. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D83591/new/ https://reviews.llvm.org/D83591 __

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D82930#2145914 , @thakis wrote: > This breaks check-clang on macOS: http://45.33.8.238/mac/17053/step_7.txt > > The output contains > > 5: clang: warning: argument unused during compilation: > '--rocm-path=/Users/thakis/src/ll

[PATCH] D82930: [HIP] Fix rocm detection

2020-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D82930#2145827 , @njames93 wrote: > This is causing a test case to fail on mac > http://45.33.8.238/mac/17048/step_7.txt 5d2c3e031a6861b3e95673d0e238c09938dd9c0d

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

2020-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 9 inline comments as done. yaxunl added inline comments. Herald added a subscriber: dang. Comment at: clang/lib/AST/ASTContext.cpp:10068 +isa(D) && cast(D)->isFileVarDecl() && +cast(D)->getStorageClass() == SC_Static) { + return GVA_StrongExtern

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

2020-07-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 277272. yaxunl marked 3 inline comments as done. yaxunl added a comment. Only allow cuid to be alphanumeric and underscore. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80858/new/ https://reviews.llvm.org/D80858 Files: clang/include/clang/AST/AST

[PATCH] D82087: AMDGPU/clang: Add builtins for llvm.amdgcn.ballot

2020-07-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D82087#2146170 , @sameerds wrote: > >> https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_kernel_language.md#warp-vote-and-ballot-functions > > > > I think if the language interface insists on fixing the w

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

2020-07-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: kristof.beyls. When a device function calls a host function or vice versa, this is wrong-sided reference. Currently clang immediately diagnose it. This is different from nvcc behavior, where it is diagnosed only

[PATCH] D81713: [HIP] Fix rocm not found on rocm3.5

2020-06-18 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG92d8ad02e92f: [HIP] Fix rocm not found on rocm3.5 (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D81713?vs=270298&id=271689#toc Repository: rG

[PATCH] D81959: [HIP] Enable -amdgpu-internalize-symbols

2020-06-18 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:64-65 +"-shared", +"-mllvm", +"-amdgpu-internalize-symbols", +"-o

[PATCH] D81959: [HIP] Enable -amdgpu-internalize-symbols

2020-06-18 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGc830d517b4e4: [HIP] Enable -amdgpu-internalize-symbols (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D819

[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

2020-06-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 272171. yaxunl retitled this revision from "[HIP] Add -fhip-lambda-host-device" to "[CUDA][HIP] Let non-caputuring lambda be host device". yaxunl edited the summary of this revision. yaxunl added a comment. Revised by Richard's comments. CHANGES SINCE LAST A

[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

2020-06-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 272225. yaxunl marked 4 inline comments as done. yaxunl added a comment. improve diagnostic message CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

2020-06-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In D78655#2019290 , @rsmith wrote: > There are two behaviors that seem to make sense: > > - Treat lambdas as implicitly HD (like constexpr functions) in all CUDA / HIP > language modes. I do

[PATCH] D81176: [HIP] Add default header and include path

2020-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D81176#2105944 , @zhuhan0 wrote: > This broke a test `clang/test/Tooling/clang-check-offload.cpp` for a critical > Linux distro at Facebook. With this change, the test adds a `-include > __clang_hip_runtime_wrapper` argument. T

[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

2020-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D78655#2107016 , @tra wrote: > In D78655#2105058 , @yaxunl wrote: > > > - lambdas with any lambda-capture (which must therefore have an enclosing

[PATCH] D78655: [CUDA][HIP] Let non-caputuring lambda be host device

2020-06-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 272539. yaxunl added a comment. Only make non-capturing lambda host and device by default. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78655/new/ https://reviews.llvm.org/D78655 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/inc

[PATCH] D82506: [HIP] Add missing options for lto

2020-06-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, arsenm, ashi1. Herald added subscribers: dexonsmith, inglorion, wdng. Add -mcpu, -mattr, -mllvm, and -save-temps options for lto when necessary. https://reviews.llvm.org/D82506 Files: clang/lib/Driver/ToolChains/HIP.cpp clang/test/D

[PATCH] D82506: [HIP] Add missing options for lto

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 273424. yaxunl marked an inline comment as done. yaxunl added a comment. Herald added subscribers: kerbowa, nhaehnle, jvesely. Fix issue about -mattr. Also use generic LTO option translation and use -plugin-opt. CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D82579: [NFC] Extract unifyTargetFeatures

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. yaxunl added a child revision: D82506: [HIP] Add missing options for lto. extract unifyTargetFeatures to be used by lld. https://reviews.llvm.org/D82579 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/lib/Driver/ToolChains/Commo

[PATCH] D82506: [HIP] Add missing options for lto

2020-06-25 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:76 +MAttrString.append(Args.MakeArgString(OneFeature)); +if (OneFeature != Features.back()) + MAttrString.append(","); tra wrote: >

[PATCH] D82579: [NFC] Extract unifyTargetFeatures

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:93 +StringRef Name = Features[I]; +assert(Name[0] == '-' || Name[0] == '+'); +LastOpt[Name.drop_front(1)] = I; tra wrote: > I

[PATCH] D82579: [NFC] Extract unifyTargetFeatures

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 273473. yaxunl marked 2 inline comments as done. yaxunl added a comment. return the unified features. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D82579/new/ https://reviews.llvm.org/D82579 Files: clang/lib/Driver/ToolChains/Clang.cpp clang/lib

[PATCH] D82579: [NFC] Extract unifyTargetFeatures

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/CommonArgs.cpp:93 +StringRef Name = Features[I]; +assert(Name[0] == '-' || Name[0] == '+'); +LastOpt[Name.drop_front(1)] = I; tra wrote: > y

[PATCH] D82579: [NFC] Extract unifyTargetFeatures

2020-06-25 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 rGed398c3ca404: [NFC] Extract unifyTargetFeatures (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTI

[PATCH] D82506: [HIP] Add missing options for lto

2020-06-25 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8013ce449022: [HIP] Add missing options for lto (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D82506?vs=273424&id=273588#toc Repository: rG LL

[PATCH] D81869: Modify FPFeatures to use delta not absolute settings to solve PCH compatibility problems

2020-06-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Would you please add the following lit test F12245277: diff.pch.txt If you change FastMath, FiniteMathOnly and UnsafeFPMath to COMPATIBLE_LANGOPT, the test should pass. Comment at: clang/include/clang/Basic/LangOpt

[PATCH] D82650: [HIP] Set default FP_CONTRACT to ON

2020-06-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I think the point of -ffp-contract=fast is that it allows emitting fma across statements if there are such opportunities whereas -ffp-contract=on only allows fma in one statement https://llvm.org/docs/CompileCudaWithLLVM.html#flags-that-control-numerical-code Repositor

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

2020-06-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 274589. yaxunl retitled this revision from "[CUDA][HIP] Let non-caputuring lambda be host device" to "[CUDA][HIP] Let lambda be host device by default". yaxunl edited the summary of this revision. yaxunl added a comment. Added diagnostics for capturing host va

[PATCH] D82930: [HIP] Fix rocm detection

2020-06-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, arsenm. Herald added subscribers: kerbowa, nhaehnle, wdng, jvesely. Do not detect device library by default in rocm detector. Only detect device library in HIP toolchain. Detect rocm path by version file in host toolchains. Also added d

[PATCH] D77923: OpenCL: Fix some missing predefined macros

2020-04-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D77923#1987795 , @jvesely wrote: > will this trigger extra warnings for the user? No. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77923/new/ https://reviews.llvm.org/D77923 __

[PATCH] D59647: [CUDA][HIP] Warn shared var initialization

2020-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl requested review of this revision. yaxunl added a comment. We need to revive this review since we found it is very inconvenient without this. Also, nvcc only emits a warning for it https://cuda.godbolt.org/z/AzrDTt So I think maybe we even want to emit it as warning by default. Reposi

[PATCH] D76957: HIP: Merge builtin library handling

2020-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/ToolChains/HIP.cpp:364 +bool FastRelaxedMath = false; +bool CorrectSqrt = false; + By default this was on. We should keep the old behavior. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D

[PATCH] D76957: HIP: Merge builtin library handling

2020-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76957/new/ https://reviews.llvm.org/D76957 ___ cfe-commits mailing list cfe-

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

2020-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Currently if instructions of float128 get to amdgpu backend, are we going to crash? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D78513/new/ https://reviews.llvm.org/D78513 ___

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

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

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