[PATCH] D67837: [CUDA][HIP] Fix assertion in Sema::markKnownEmitted with -fopenmp

2019-09-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 221829. yaxunl edited the summary of this revision. yaxunl added a comment. Unify CUDA/HIP/OpenMP host/device check. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: include/clang/Sema/Sema.h lib/Se

[PATCH] D57829: [HIP] Disable emitting llvm.linker.options in device compilation

2019-09-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl abandoned this revision. yaxunl marked an inline comment as done. yaxunl added a comment. no longer needed CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57829/new/ https://reviews.llvm.org/D57829 ___ cfe-commits mailing list cfe-comm

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-09-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping @ABataev Any comments? Thanks. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mail

[PATCH] D68284: [HIP] Support -emit-llvm for device compilation

2019-10-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Sometimes it is useful to compile HIP device code to LLVM BC. It is not convenient to use clang -cc1 since there are lots of options needed. This patch allows clang driver to compile HIP device code to LLVM BC with -emit-llvm -c. htt

[PATCH] D68300: [HIP] Add option -fno-hip-link-builtin-bitcode to disable linking device lib

2019-10-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. https://reviews.llvm.org/D68300 Files: include/clang/Driver/Options.td lib/Driver/ToolChains/HIP.cpp test/Driver/hip-no-device-libs.hip Index: test/Driver/hip-no-device-libs.hip ===

[PATCH] D68300: [HIP] Add option -fno-link-builtin-bitcode to disable linking device lib

2019-10-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 222746. yaxunl retitled this revision from "[HIP] Add option -fno-hip-link-builtin-bitcode to disable linking device lib" to "[HIP] Add option -fno-link-builtin-bitcode to disable linking device lib". yaxunl added a comment. change the option name CHANGES S

[PATCH] D68300: [HIP] Add option -fno-link-builtin-bitcode to disable linking device lib

2019-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: include/clang/Driver/Options.td:606 +def flink_builtin_bitcode : Flag<["-"], "flink-builtin-bitcode">, + Flags<[CC1Option]>, HelpText<"Link builtin bitcode for HIP device compilation.">; +def fno

[PATCH] D68284: [HIP] Support -emit-llvm for device compilation

2019-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 222826. yaxunl added a comment. Make it work for -S CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68284/new/ https://reviews.llvm.org/D68284 Files: lib/Driver/Driver.cpp test/Driver/hip-toolchain-emit-llvm.hip Index: test/Driver/hip-toolchain-

[PATCH] D68284: [HIP] Support -emit-llvm for device compilation

2019-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D68284#1690554 , @tra wrote: > LGTM. > > Does it produce textual IR if used with `-S`? Now it produces textural IR if used with -S. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68284/new/ https://reviews.llvm.org/D6

[PATCH] D68284: [HIP] Support -emit-llvm for device compilation

2019-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 222904. yaxunl added a comment. fix -S CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68284/new/ https://reviews.llvm.org/D68284 Files: lib/Driver/Driver.cpp test/Driver/hip-device-compile.hip Index: test/Driver/hip-device-compile.hip ==

[PATCH] D68284: [HIP] Support -emit-llvm for device compilation

2019-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373561: [HIP] Support -emit-llvm for device compilation (authored by yaxunl, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://revie

[PATCH] D68300: [HIP] Use option -nogpulib to disable linking device lib

2019-10-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 223024. yaxunl added a comment. use -nogpuarch CHANGES SINCE LAST ACTION https://reviews.llvm.org/D68300/new/ https://reviews.llvm.org/D68300 Files: include/clang/Driver/Options.td lib/Driver/ToolChains/Cuda.cpp lib/Driver/ToolChains/HIP.cpp test/

[PATCH] D68394: [HIP] Enable specifying different default gpu arch for HIP/CUDA.

2019-10-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/Driver/Driver.cpp:2655 +: CudaActionBuilderBase(C, Args, Inputs, Action::OFK_HIP) { + DefaultCudaArch = CudaArch::GFX600; +} hliao wrote: > Sam, could you let me know which reasonable default ar

[PATCH] D68300: [HIP] Use option -nogpulib to disable linking device lib

2019-10-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: include/clang/Driver/Options.td:606 +def flink_builtin_bitcode : Flag<["-"], "flink-builtin-bitcode">, + Flags<[CC1Option]>, HelpText<"Link builtin bitcode for HIP device compilation.">; +def fno

[PATCH] D68300: [HIP] Use option -nogpulib to disable linking device lib

2019-10-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL373649: [HIP] Use option -nogpulib to disable linking device lib (authored by yaxunl, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: http

[PATCH] D44984: [HIP] Add hip file type and codegen for kernel launching

2018-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: lib/Frontend/CompilerInvocation.cpp:2109 + Opts.HIP = true; + } + rjmccall wrote: > Why is this done here? We infer the language mode from the input kind > somewhere else.

[PATCH] D44984: [HIP] Add hip file type and codegen for kernel launching

2018-04-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 142422. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D44984 Files: include/clang/Basic/LangOptions.def lib/CodeGen/CGCUDANV.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CodeGenModule.

[PATCH] D45441: [HIP] Add predefined macros __HIPCC__ and __HIP_DEVICE_COMPILE__

2018-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Frontend/InitPreprocessor.cpp:473 + Builder.defineMacro("__HIP_DEVICE_COMPILE__"); + } } rjmccall wrote: > I assume these names are defined by the HIP spec. Yes these ar

[PATCH] D44984: [HIP] Add hip file type and codegen for kernel launching

2018-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: lib/Frontend/CompilerInvocation.cpp:2109 + Opts.HIP = true; + } + rjmccall wrote: > yaxunl wrote: > > rjmccall wrote: > > > Why is this done here? We infer the language mode

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 142818. yaxunl marked an inline comment as done. yaxunl retitled this revision from "[HIP] Add hip file type and codegen for kernel launching" to "[HIP] Add hip input kind and codegen for kernel launching". yaxunl edited the summary of this revision. yaxunl ad

[PATCH] D45489: [HIP] Add input type for HIP

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45489#1070470, @tra wrote: > I'm getting confused about the order of the patches. > The patch stack phabricator displays in this patch is different compared to > the stack in https://reviews.llvm.org/D44984. Which one should I trust? Sorry

[PATCH] D45223: [CUDA] Fix overloading resolution failure due to kernel calling convention

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45223#1056187, @rjmccall wrote: > I think the appropriate place to do this is in IsStandardConversion, > immediately after the call to ResolveAddressOfOverloadedFunction. You might > want to add a general utility for getting the type-of-refe

[PATCH] D45489: [HIP] Add input type for HIP

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45489#1070929, @yaxunl wrote: > In https://reviews.llvm.org/D45489#1070470, @tra wrote: > > > I'm getting confused about the order of the patches. > > The patch stack phabricator displays in this patch is different compared > > to the stack

[PATCH] D45489: [HIP] Add input type for HIP

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45489#1071177, @tra wrote: > In https://reviews.llvm.org/D45489#1071044, @yaxunl wrote: > > > In https://reviews.llvm.org/D45489#1070929, @yaxunl wrote: > > > > > In https://reviews.llvm.org/D45489#1070470, @tra wrote: > > > > > > > I'm getting

[PATCH] D45489: [HIP] Add input type for HIP

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL330279: [HIP] Add driver input type for HIP (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D45489?vs=141851&id=142972#toc

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: lib/Frontend/InitPreprocessor.cpp:466-467 Builder.defineMacro("__ASSEMBLER__"); if (LangOpts.CUDA) Builder.defineMacro("__CUDA__"); + if (LangOpts.HIP) tra wrote: > I

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 142978. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D44984 Files: include/clang/Basic/IdentifierTable.h include/clang/Basic/LangOptions.def include/clang/Frontend/FrontendOption

[PATCH] D45223: [CUDA] Fix overloading resolution failure due to kernel calling convention

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45223#1071358, @rjmccall wrote: > Yes, I'm sorry, I think you're right. I had misunderstood the language > problem when I suggested going down this road. In https://reviews.llvm.org/D45223#1071358, @rjmccall wrote: > Yes, I'm sorry, I th

[PATCH] D45223: [CUDA] Set LLVM calling convention for CUDA kernel

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143001. yaxunl retitled this revision from "[CUDA] Fix overloading resolution failure due to kernel calling convention" to "[CUDA] Set LLVM calling convention for CUDA kernel". yaxunl edited the summary of this revision. yaxunl added a comment. Use CodeGen ap

[PATCH] D45223: [CUDA] Set LLVM calling convention for CUDA kernel

2018-04-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45223#1071452, @tra wrote: > AFAICT this is the replacement for https://reviews.llvm.org/D44747. LGTM. Yes. Thanks. https://reviews.llvm.org/D45223 ___ cfe-commits mailing list cfe-commits@list

[PATCH] D45808: [OpenCL] Add 'denorms-are-zero' function attribute

2018-04-19 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: rC Clang https://reviews.llvm.org/D45808 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 21 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Driver/Options.td:552-553 +def : Joined<["--"], "offload-arch=">, Alias; +def offload_archs : Joined<["--"], "offload-archs=">, Flags<[DriverOption]>, + HelpText<"List of offload ar

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143218. yaxunl marked 14 inline comments as done. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D45212 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Action.h include/clang/Driver/Options.td i

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143298. yaxunl edited the summary of this revision. yaxunl added a comment. sync to ToT. https://reviews.llvm.org/D45212 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Action.h include/clang/Driver/Options.td include/clang/D

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143307. yaxunl added a comment. minor bug fix: do not add CUDA specific link options for HIP. https://reviews.llvm.org/D45212 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Action.h include/clang/Driver/Options.td include/cl

[PATCH] D45873: [OpenCL] Reject virtual functions for OpenCL C++

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: test/Parser/opencl-cxx-virtual.cl:1 +// RUN: %clang_cc1 %s -triple spir-unknown-unknown -cl-std=c++ -fsyntax-only -verify + can you add a test for template class with virtual member? Repository: rC Clang https://rev

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Driver/ToolChains/Cuda.cpp:498-501 +OptArgs.push_back(mcpustr); +OptArgs.push_back("-dce"); +OptArgs.push_back("-sroa"); +OptArgs.push_back("-globaldce"); yaxun

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143320. yaxunl marked an inline comment as done. yaxunl added a comment. Remove manually added passes from opt and add -mtriple. https://reviews.llvm.org/D45212 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Action.h include/c

[PATCH] D45223: [CUDA] Set LLVM calling convention for CUDA kernel

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC330447: [CUDA] Set LLVM calling convention for CUDA kernel (authored by yaxunl, committed by ). Repository: rL LLVM https://reviews.llvm.org/D45223 Files: lib/CodeGen/CodeGenModule.cpp lib/CodeGen

[PATCH] D45873: [OpenCL] Reject virtual functions for OpenCL C++

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. This revision is now accepted and ready to land. LGTM. Thanks! https://reviews.llvm.org/D45873 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D45223: [CUDA] Set LLVM calling convention for CUDA kernel

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL330447: [CUDA] Set LLVM calling convention for CUDA kernel (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D45223?vs=14300

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. lifetime.start/end expects pointer argument in alloca address space. However in C++ a temporary variable is in default address space. This patch casts the pointer argument of lifetime.start/end to alloca address space if necessary.

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping https://reviews.llvm.org/D44984 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143792. yaxunl added a comment. Remove CodeGenModule argument from addPrefix* functions. https://reviews.llvm.org/D44984 Files: include/clang/Basic/IdentifierTable.h include/clang/Basic/LangOptions.def include/clang/Frontend/FrontendOptions.h include

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: test/CodeGenCUDA/device-stub.cu:2-8 +// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-llvm %s \ +// RUN: -fcuda-include-gpubinary %t -o - | FileCheck %s +// RUN: %clang_cc1 -triple x86_64-linux-

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 143800. yaxunl marked 5 inline comments as done. yaxunl added a comment. Add back HIP related changes to the tests. https://reviews.llvm.org/D44984 Files: include/clang/Basic/IdentifierTable.h include/clang/Basic/LangOptions.def include/clang/Frontend/

[PATCH] D44984: [HIP] Add hip input kind and codegen for kernel launching

2018-04-24 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL330790: [HIP] Add hip input kind and codegen for kernel launching (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D44984?v

[PATCH] D45441: [HIP] Add predefined macros __HIPCC__ and __HIP_DEVICE_COMPILE__

2018-04-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 rC330824: [HIP] Add predefined macros __HIPCC__ and __HIP_DEVICE_COMPILE__ (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-04-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 14 inline comments as done. yaxunl added a comment. ping https://reviews.llvm.org/D45212 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46049: [OpenCL] Add constant address space to __func__ in AST

2018-04-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Can you add a codegen test for 1.2, 2.0? Also, I am wondering whether this is valid for OpenCL C++. Do we need special handling for string literal? Comment at: lib/AST/Expr.cpp:870 + if (C.getLangOpts().OpenCL && Ty.getAddressSpace() == LangAS::Defaul

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144574. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D45900 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h test/CodeGenCXX/amdgcn_declspec_get.cpp Index: test/CodeGenCXX/amdgcn_decl

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1074400, @rjmccall wrote: > These functions must predate the addition of CreateLifetimeStart and > CreateLifetimeEnd methods on IRBuilder; we should just be calling those. Sorry. I think I misunderstood your comments. I will revise aga

[PATCH] D45900: CodeGen: Fix invalid bitcast for lifetime.start/end

2018-04-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 144600. yaxunl added a comment. Call Builder.CreateLifetimeStart/End. I cannot replace CodeGenFunction::EmitLifetimeStart with Builder.CreateLifetimeStart since we still need to check ShouldEmitLifetimeMarkers and do the address space cast. https://reviews

[PATCH] D46049: [OpenCL] Add constant address space to __func__ in AST

2018-05-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D46049#1085388, @Anastasia wrote: > In https://reviews.llvm.org/D46049#1081196, @yaxunl wrote: > > > Can you add a codegen test for 1.2, 2.0? > > > Anything specific you would like me to check? I am not modifying anything in > CodeGen here thou

[PATCH] D46022: [OpenCL] Restrict various keywords in OpenCL C++ mode

2018-05-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks! https://reviews.llvm.org/D46022 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46049: [OpenCL] Add constant address space to __func__ in AST

2018-05-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks! https://reviews.llvm.org/D46049 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46471: [HIP] Add hip offload kind

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. There are quite differences in HIP action builder and action job creation, which justifies to define a separate offload kind. https://reviews.llvm.org/D46471 Files: include/clang/Driver/Action.h lib/Driver/Action.cpp lib

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. To support linking device code in different source files, it is necessary to embed fat binary at host linking stage. This patch emits an external symbol for fat binary in host codegen, then embed the fat binary by lld through a

[PATCH] D46473: [HIP] Let clang-offload-bundler support HIP

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. When bundle/unbundle intermediate files for HIP, there may be multiple sub archs, therefore BoundArch needs to be included in the target and output file names for clang-offload-bundler. https://reviews.llvm.org/D46473 Files:

[PATCH] D46475: [HIP] Set proper triple and offload kind for the toolchain

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. Also introduce --hip-link option to indicate HIP for linking. https://reviews.llvm.org/D46475 Files: include/clang/Driver/Options.td lib/Driver/Driver.cpp Index: lib/Driver/Driver.cpp

[PATCH] D46476: [HIP] Add action builder

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. To support separate compile/link and linking across device IR in different source files, a new HIP action builder is introduced. Basically it compiles/links host and device code separately, and embed fat binary in host linking

[PATCH] D45212: [HIP] Let CUDA toolchain support HIP language mode and amdgpu

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 145297. yaxunl added a comment. clean up code and separate action builder to another review. https://reviews.llvm.org/D45212 Files: include/clang/Driver/Options.td lib/Driver/ToolChains/Cuda.cpp lib/Driver/ToolChains/Cuda.h Index: lib/Driver/ToolChain

[PATCH] D46487: [HIP] Diagnose unsupported host triple

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. https://reviews.llvm.org/D46487 Files: include/clang/Basic/DiagnosticDriverKinds.td lib/Driver/Driver.cpp test/Driver/cuda-bad-arch.cu Index: test/Driver/cuda-bad-arch.cu =

[PATCH] D46489: [HIP] Let assembler output bitcode for amdgcn

2018-05-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. amdgcn does not support linking of object files, therefore let assembler output bitcode for HIP for amdgcn. https://reviews.llvm.org/D46489 Files: lib/Driver/ToolChains/Clang.cpp Index: lib/Driver/ToolChains/Clang.cpp

[PATCH] D46501: [OpenCL] Guard all half float usage based on cl_khr_fp16 extension

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Only halfn type requires cl_khr_fp16. These functions do not use halfn type, therefore cl_khr_fp16 is not required. Repository: rC Clang https://reviews.llvm.org/D46501 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D46471: [HIP] Add hip offload kind

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Driver/Compilation.cpp:201 + // not compiled again if there are already failures. It is OK to abort the + // CUDA pipeline on errors. + if (A->isOffloading(Action::OFK_Cuda) || A->isOffloadi

[PATCH] D46471: [HIP] Add hip offload kind

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 145472. yaxunl marked 2 inline comments as done. yaxunl added a comment. Updated comments. https://reviews.llvm.org/D46471 Files: include/clang/Driver/Action.h lib/Driver/Action.cpp lib/Driver/Compilation.cpp lib/Driver/ToolChains/Clang.cpp Index: l

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:317 + if (GpuBinaryFileName.empty() && !IsHIP) return nullptr; rjmccall wrote: > Is this filename string only used for CUDA? If so, please rename

[PATCH] D46472: [HIP] Support offloading by linkscript

2018-05-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 145480. yaxunl marked 2 inline comments as done. yaxunl added a comment. Rename variables used for CUDA only. https://reviews.llvm.org/D46472 Files: include/clang/Driver/Options.td lib/CodeGen/CGCUDANV.cpp lib/Driver/ToolChains/CommonArgs.cpp lib/Dri

[PATCH] D48493: [HIP] Support flush denorms bitcode

2018-06-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: test/Driver/hip-toolchain-flush-denorms.hip:6 +// RUN: %clang -### -target x86_64-linux-gnu \ +// RUN: -x hip --cuda-gpu-arch=gfx803 --cuda-gpu-arch=gfx900 \ +// RUN: --hip-device-lib-path=%S/Inputs/hip_multiple_inputs/dev_lib \ -

[PATCH] D48493: [HIP] Support flush denorms bitcode

2018-06-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Driver/ToolChains/HIP.cpp:85 "ockl.amdgcn.bc", "irif.amdgcn.bc", "ocml.amdgcn.bc", "oclc_finite_only_off.amdgcn.bc", + FlushDenormalControlBC, we need to fix t

[PATCH] D48493: [HIP] Support flush denorms bitcode

2018-06-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. better merge these two tests and rename it as hip-device-libs.hip. We can also add other device lib tests to it later. https://reviews.llvm.org/D48493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm

[PATCH] D48493: [HIP] Support flush denorms bitcode

2018-06-27 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! https://reviews.llvm.org/D48493 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D48667: [HIP] Fix ordering of device-lib linking

2018-06-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Please add a lit test. Repository: rC Clang https://reviews.llvm.org/D48667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D48667: [HIP] Fix ordering of device-lib linking

2018-06-27 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! https://reviews.llvm.org/D48667 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. HIP generates one fat binary for all devices after linking. However, for each compilation unit a ctor function is emitted which register the same fat binary. Measures need to be taken to make sure the fat binary is only registe

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49083#1157568, @tra wrote: > > HIP generates one fat binary for all devices after linking. However, for > > each compilation > > unit a ctor function is emitted which register the same fat binary. > > Measures need to be taken to make sure

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 154894. yaxunl marked an inline comment as done. yaxunl added a comment. clean up function prefix. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu ===

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49083#1157586, @yaxunl wrote: > In https://reviews.llvm.org/D49083#1157568, @tra wrote: > > > > HIP generates one fat binary for all devices after linking. However, for > > > each compilation > > > unit a ctor function is emitted which regist

[PATCH] D49294: Sema: Fix explicit address space cast in C++

2018-07-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. Currently clang does not allow implicit cast of a pointer to a pointer type in different address space but allows C-style cast of a pointer to a pointer type in different address space. However, there is a bug in Sema causing incor

[PATCH] D48287: [HIP] Support -fcuda-flush-denormals-to-zero for amdgcn

2018-07-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D48287#1138262, @tra wrote: > Using OpenCL's flag for the purpose adds a *third* way we handle denormals > flushing in clang. Now it would be HIP (which is CUDA-like) using OpenCL's > flag for denormals instead of CUDA's one. > You could chan

[PATCH] D48287: [HIP] Support -fcuda-flush-denormals-to-zero for amdgcn

2018-07-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 155580. yaxunl added a comment. Replace LangOpts.CUDADeviceFlushDenormalsToZero with CodeGenOpts.FlushDenorm. https://reviews.llvm.org/D48287 Files: include/clang/Basic/LangOptions.def lib/CodeGen/CGCall.cpp lib/CodeGen/CodeGenModule.cpp lib/Frontend

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); rjmcc

[PATCH] D49294: Sema: Fix explicit address space cast in C++

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaOverload.cpp:3150 + !getLangOpts().OpenCLCPlusPlus) +return false; + rjmccall wrote: > It's not really OpenCL C++ that's special here, it's the possibility of > promotions between address spaces. Fo

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCUDANV.cpp:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(HandleValue->getType()); rjmcc

[PATCH] D49083: [HIP] Register/unregister device fat binary only once

2018-07-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156184. yaxunl marked 4 inline comments as done. yaxunl added a comment. Added comments about thread safety of ctor functions. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 12 inline comments as done. yaxunl added inline comments. Comment at: lib/Sema/SemaDecl.cpp:17618 + + if (LangOpts.CUDA) { +// When compiling for device, host functions are never emitted. Similarly, ABataev wrote: > Are you going to handle `#p

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 223284. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revised by Alexey's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: include/clang/Sema/Sema.h lib/Sema/SemaCUDA.cp

[PATCH] D68578: [HIP] Fix device stub name

2019-10-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall, hliao. Herald added a subscriber: erik.pilkington. HIP emits a device stub function for each kernel in host code. The HIP debugger requires device stub function to have a different unmangled name as the kernel. Currently the n

[PATCH] D68578: [HIP] Fix device stub name

2019-10-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D68578#1697822 , @tra wrote: > Could you elaborate on how exactly current implementation does not work? > > I would expect the kernel and the stub to be two distinct entities, as far as > debugger is concerned. It does have enou

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 223712. yaxunl marked 14 inline comments as done. yaxunl added a comment. revised by Alexey's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: include/clang/Sema/Sema.h lib/Sema/SemaCUDA.c

[PATCH] D68578: [HIP] Fix device stub name

2019-10-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D68578#1698864 , @t-tye wrote: > I am a little unclear what this patch is doing as it is mentioned that the > mangled name has a _stub in it. My understanding is that the intention was to > create a distinct unmangled name for

[PATCH] D68665: [HIP] Fix -save-temps

2019-10-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, ashi1. Currently clang does not save some of the intermediate file generated during device compilation for HIP when -save-temps is specified. This patch fixes that. https://reviews.llvm.org/D68665 Files: lib/Driver/Driver.cpp lib/

[PATCH] D68665: [HIP] Fix -save-temps

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 8 inline comments as done. yaxunl added inline comments. Comment at: lib/Driver/Driver.cpp:4400 + // HIP image for device compilation with -fno-gpu-rdc is per compilation + // unit. + bool IsHIPNoRDC = JA.getOffloadingDeviceKind() == Action::OFK_HIP &

[PATCH] D68665: [HIP] Fix -save-temps

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 4 inline comments as done. Closed by commit rGbc2350a34126: [HIP] Fix -save-temps (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D68665?vs=223944&id=224

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 224126. yaxunl marked 8 inline comments as done. yaxunl added a comment. revised by Alexey's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67837/new/ https://reviews.llvm.org/D67837 Files: include/clang/Sema/Sema.h lib/Sema/SemaCUDA.cp

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaCUDA.cpp:604 // Do we know that we will eventually codegen the given function? static bool IsKnownEmitted(Sema &S, FunctionDecl *FD) { + return S.getEmissionStatus(FD) == Sema::FunctionEmissionStatus::Emitted;

[PATCH] D67837: [CUDA][HIP] Fix host/device check with -fopenmp

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG229c78d3a5d1: [CUDA][HIP] Fix host/device check with -fopenmp (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D67837?vs=224126&id=224208#toc Repository: rG LLVM Github Monorep

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

2019-10-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. https://reviews.llvm.org/D68753 Files: test/SemaCUDA/constexpr-ctor.cu Index: test/SemaCUDA/constexpr-ctor.cu === --- /dev/null +++ test/SemaCUDA/constexpr-ctor.cu @@ -0

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

2019-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. https://reviews.llvm.org/D68823 Files: include/clang/Driver/Options.td Index: include/clang/Driver/Options.td === --- include/clang/Driver/Options.td +++ include/clang/D

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