[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125165#3506502 , @thakis wrote: > In D125165#3506477 , @yaxunl wrote: > >> In D125165#3506448 , @thakis wrote: >> >>> We could add a "clang-off

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125165#3506529 , @jhuber6 wrote: > In D125165#3506502 , @thakis wrote: > >> In D125165#3506477 , @yaxunl wrote: >> >>> In D125165#3506448

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; This makes the file format depend on LLVM version and potentially standard C++ library version.

[PATCH] D125165: [Clang] Introduce clang-offload-packager tool to bundle device files

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/docs/ClangOffloadPackager.rst:31-32 +uint32_t Flags; +StringMap StringData; +MemoryBufferRef Image; + }; jhuber6 wrote: > yaxunl wrote: > > This makes the file format depend on LLVM version and potentia

[PATCH] D125396: [clang] Fix KEYALL

2022-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG84db35594953: [clang] Fix KEYALL (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTIO

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In D122734#3508294 , @uabelho wrote: > Hi, > > I noticed when compiling with gcc 9.3.0 that we get a bunch of new warnings > with this patch: > > [1/351] Building CXX object > tools/clan

[PATCH] D122734: [CUDA][HIP] Fix mangling number for local struct

2022-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D122734#3509096 , @yaxunl wrote: > In D122734#3508294 , @uabelho wrote: > >> Hi, >> >> I noticed when compiling with gcc 9.3.0 that we get a bunch of new warnings >> with this patch: >>

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rsmith, aaron.ballman, tra. Herald added a project: All. yaxunl requested review of this revision. Depending on whether a target feature is enabled or not, programs may choose different algorithm or different builtin functions to use. Instead

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 429265. yaxunl added a comment. fix typo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D12/new/ https://reviews.llvm.org/D12 Files: clang/docs/LanguageExtensions.rst clang/docs/ReleaseNotes.rst clang/include/clang/Lex/Preprocessor.h c

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); tra wrote: > Do you have a better

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:260 +``__has_target_feature`` + aaron.ballman wrote: > The first question that comes to mind for me is: why is `__has_fe

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > aaron.ballman wrot

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. HIP toolchain allows clang driver to compile bundled bitcode or assembly for mixed host/device compilation or device-only multi-GPU compilation. e.g. clang --offload-arch=gfx906 --offload-arch=gfx908 a.bc b.s Can you add a test to make sure this does not break HIP toolc

[PATCH] D125705: [OpenMP] Don't build the offloading driver without a source input

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125705#3519605 , @jhuber6 wrote: > In D125705#3519570 , @yaxunl wrote: > >> HIP toolchain allows clang driver to compile bundled bitcode or assembly for >> mixed host/device compilatio

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, aaron.ballman, rsmith. Herald added a project: All. yaxunl requested review of this revision. Fix `__has_builtin` to return 1 only if the requested target features of a builtin are enabled by refactoring the code for checking required targ

[PATCH] D125555: [clang] Add __has_target_feature

2022-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/docs/LanguageExtensions.rst:275 + // On amdgcn target + #if __has_target_feature("s-memtime-inst") +x = __builtin_amdgcn_s_memtime(); yaxunl wrote: > yaxunl wrote: > >

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: clang/include/clang/Basic/Builtins.h:263 + ///false if it is disabled. + bool isRequiredTargetFeaturesEnabled( + unsigned BuiltinID, const llvm::StringMap &TargetFetureMap) const; --

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 430420. yaxunl marked 2 inline comments as done. yaxunl added a comment. revised by Artem's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125829/new/ https://reviews.llvm.org/D125829 Files: clang/include/clang/Basic/Builtins.h clang/lib

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: b-sumner, tra, arsenm. Herald added subscribers: kosarev, kerbowa, t-tye, tpr, dstuttard, jvesely, kzhuravl. Herald added a project: All. yaxunl requested review of this revision. Herald added a subscriber: wdng. Emit predefined macros for GPU

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:2555-2557 if (FeatureList.empty()) return; assert(!FeatureList.contains(' ') && "Space in feature list"); tra wrote: > Should

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: clang/lib/Basic/Targets/AMDGPU.cpp:414 + assert(CanonName.startswith("gfx") && "Invalid amdgcn canonical name"); + Builder.defineMacro(Twine("__") + Twine(CanonName.drop_back(2).upper())

[PATCH] D125829: [clang] Fix __has_builtin

2022-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rGcefe472c51fb: [clang] Fix __has_builtin (authored by yaxunl). Herald added a project: clang. Changed prior t

[PATCH] D125909: [AMDGPU] emit macro __GFX9__ etc

2022-05-19 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 rG559b8fc17ef6: [AMDGPU] emit macro __GFX9__ etc (authored by yaxunl). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D125909?vs=

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. need a codegen test to make sure amdgpu_kernel ABI is used in C/C++ for functions with this attribute. https://github.com/llvm/llvm-project/blob/main/clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu#L64 may be used as an example. Repository: rG LLVM Github Mo

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D125970#3526053 , @JonChesterfield wrote: > In D125970#3525985 , @yaxunl wrote: > >> need a codegen test to make sure amdgpu_kernel ABI is used in C/C++ for >> functions with this attr

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-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: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125970/new/ https://reviews.llvm.org/D125970 __

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); Are these options always the sam

[PATCH] D125904: [Cuda] Use fallback method to mangle externalized decls if no CUID given

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:6845-6846 +llvm::MD5::MD5Result Result; +for (const auto &Arg : PreprocessorOpts.Macros) + Hash.update(Arg.first); +Hash.final(Result); jhuber6 wrote: > yaxunl wrote: >

[PATCH] D125970: [amdgpu] Add amdgpu_kernel calling conv attribute to clang

2022-05-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In HIP, kernels are represented by attribute `global` and not by calling convention in clang. This may be an alternative. Another alternative might be merging amdgpu_kernel and opencl_kernel calling convention since for the same target they are the same. They could be r

[PATCH] D66512: [OpenCL] Fix declaration of enqueue_marker

2019-08-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: Anastasia, bader, b-sumner. https://reviews.llvm.org/D66512 Files: lib/Headers/opencl-c.h Index: lib/Headers/opencl-c.h === --- lib/Headers/opencl-c.h +++ lib/Headers/opencl-c

[PATCH] D66512: [OpenCL] Fix declaration of enqueue_marker

2019-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL369641: [OpenCL] Fix declaration of enqueue_marker (authored by yaxunl, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.ll

[PATCH] D67048: [AMDGPU] Set default flat work group size to (1, 256) for HIP

2019-09-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: arsenm, rampitec, b-sumner. Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl. https://reviews.llvm.org/D67048 Files: lib/CodeGen/TargetInfo.cpp Index: lib/CodeGen/TargetInfo.cpp ==

[PATCH] D67048: [AMDGPU] Set default flat work group size to (1, 256) for HIP

2019-09-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 218261. yaxunl added a comment. Herald added a subscriber: jvesely. add test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67048/new/ https://reviews.llvm.org/D67048 Files: lib/CodeGen/TargetInfo.cpp test/CodeGenCUDA/kernel-amdgcn.cu Index: te

[PATCH] D67048: [AMDGPU] Set default flat work group size to (1, 256) for HIP

2019-09-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL370808: [AMDGPU] Set default flat work group size to (1,256) for HIP (authored by yaxunl, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Changed prior to commit:

[PATCH] D36118: Fix creating bitcasts with wrong address space

2017-07-31 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/D36118 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 109406. yaxunl marked 29 inline comments as done. yaxunl added a comment. Revised by reviewers' comments. https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/Basic/Builtins.def include/clang/Basic

[PATCH] D36259: [OpenCL] Remove extra select functions from opencl-c.h

2017-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. OpenCL spec v2.0 s6.13.6: gentype select (gentype a, gentype b, igentype c) gentype select (gentype a, gentype b, ugentype c) igentype and ugentype must have the same number of elements and bits as gentype. https://reviews.llvm.org/D36259 Files: lib/Headers/op

[PATCH] D36259: [OpenCL] Remove extra select functions from opencl-c.h

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D36259#830122, @bader wrote: > Out of curiosity: how did you detect this? > Can we use the same approach for writing tests? Some user code generated call to a select function which we do not have in library, then Brian found that there are e

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/Builtins.def:717 +ATOMIC_BUILTIN(__opencl_atomic_fetch_max, "v.", "t") + #undef ATOMIC_BUILTIN t-tye wrote: > Will the OpenCL 2.0 memory fences also be support

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 109542. yaxunl marked 5 inline comments as done. yaxunl added a comment. Herald added subscribers: aheejin, dschuff, jfb. Revised by Tony's and John's comments. https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 109556. yaxunl added a comment. Add assert to make sure pre-defined macros __OPENCL_MEMORY_SCOP_* to be consistent with SyncScope enum. https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/Basic/Bui

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 109591. yaxunl added a comment. Add comments to SyncScope.h https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/Basic/Builtins.def include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: docs/LanguageExtensions.rst:1935 +builtin function, and are named with a ``__opencl_`` prefix.) Low-level ARM exclusive memory builtins t-tye wrote: > Should it also say: > > `

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-03 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 109612. yaxunl marked an inline comment as done. yaxunl added a comment. Added documentation about __OPENCL_MEMORY_SCOPE_* by Tony's comments. https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/Bas

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:21 +/// \brief Defines the synch scope values used by the atomic builtins and +/// expressions +enum class SyncScope { rjmccall wrote: > If the num

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 3 inline comments as done. yaxunl added a comment. Ping. Any other comments? Thanks. Comment at: lib/AST/Expr.cpp:4000-4004 + if (auto AT = T->getAs()) { +return AT->getValueType(); + } else { +return T; + } bader wrote: > No need in el

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added a subscriber: tpr. Currently Clang emits call of __read_pipe_2 or __read_pipe_4 for OpenCL read_pipe builtin, with appended type size and alignment arguments, where 2 or 4 indicates the original number of arguments. For certain targets (e.g. amdgpu), t

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked 2 inline comments as done. Closed by commit rL310082: Add OpenCL 2.0 atomic builtin functions as Clang builtin (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D28691?vs=109612&id=1097

[PATCH] D36259: [OpenCL] Remove extra select functions from opencl-c.h

2017-08-04 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310160: [OpenCL] Remove extra select functions from opencl-c.h (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D36259?vs=109486&id=109845#toc Repository: rL LLVM https://revi

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D36327#833653, @bader wrote: > Hi Sam, > > What do you think about implementing this optimization in target specific > optimization pass? Since size/alignment is saved as function parameter in > LLVM IR, the optimization can be done in target

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D36327#835634, @Anastasia wrote: > In https://reviews.llvm.org/D36327#835153, @b-sumner wrote: > > > In https://reviews.llvm.org/D36327#834032, @Anastasia wrote: > > > > > In https://reviews.llvm.org/D36327#833891, @yaxunl wrote: > > > > > > > I

[PATCH] D36171: AMDGPU: Use direct struct returns

2017-08-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/TargetInfo.cpp:7386 + bool isHomogeneousAggregateBaseType(QualType Ty) const override; + bool isHomogeneousAggregateSmallEnough(const Type *Base, + uint64_t Members) const override; --

[PATCH] D36171: AMDGPU: Use direct struct returns

2017-08-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/TargetInfo.cpp:7386 + bool isHomogeneousAggregateBaseType(QualType Ty) const override; + bool isHomogeneousAggregateSmallEnough(const Type *Base, + uint64_t Members) const override; --

[PATCH] D36171: AMDGPU: Use direct struct returns

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

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. https://reviews.llvm.org/D36580 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/SyncScope.h lib/CodeGen/CGAtomic.cpp lib/Sema/SemaChecking.cpp test/CodeGenOpenCL/atomic-ops-libcall.cl test/CodeGenOpenCL/atomic-ops.cl test/SemaOpenC

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. John, do you have any comments? Thanks. https://reviews.llvm.org/D36327 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:46 + Scopes.push_back(SyncScope::OpenCLSubGroup); + return Scopes; +} rjmccall wrote: > t-tye wrote: > > Should there be an assert/static_assert

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 110863. yaxunl marked 5 inline comments as done. yaxunl added a comment. Revised by John's and Tony's comments. https://reviews.llvm.org/D36580 Files: include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/SyncScope.h lib/CodeGen/CGAtomic.cpp

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 8 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:56 /// enums in opencl-c.h. -enum class SyncScope { - OpenCLWorkGroup = 1, - OpenCLDevice = 2, - OpenCLAllSVMDevices = 3, - OpenCLSubGroup = 4, +enum class Open

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGAtomic.cpp:678 + auto &Builder = CGF.Builder; + auto Scopes = getAllLanguageSyncScopes(); + llvm::DenseMap BB; t-tye wrote: > yaxunl wrote: > > t-tye wrote: > > >

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 110904. yaxunl marked 2 inline comments as done. yaxunl added a comment. Refactor to introduce classes AtomicScopeABI and AtomicScopeOpenCLABI for easy extension to other languages. https://reviews.llvm.org/D36580 Files: include/clang/AST/ASTContext.h i

[PATCH] D33989: [OpenCL] Allow targets to select address space per type

2017-08-14 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/D33989 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listi

[PATCH] D36676: Remove -finclude-default-header in OpenCL atomic tests

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added a subscriber: Anastasia. Only define enums necessary for the tests to speed up the tests. https://reviews.llvm.org/D36676 Files: test/CodeGenOpenCL/atomic-ops-libcall.cl test/CodeGenOpenCL/atomic-ops.cl test/SemaOpenCL/atomic-ops.cl Index: test/

[PATCH] D36678: [OpenCL] Do not use vararg in emitted functions for enqueue_kernel

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added a subscriber: tpr. Not all targets support vararg (e.g. amdgpu). Instead of using vararg in the emitted functions for enqueue_kernel, this patch creates a temporary array of size_t, stores the size arguments in the temporary array and passes it to the e

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D36327#839809, @rjmccall wrote: > Could you just implement this in SimplifyLibCalls? I assume there's some way > to fill in TargetLibraryInfo appropriately for a platform. Is that too late > for your linking requirements? Both the optimize

[PATCH] D36327: [OpenCL] Allow targets emit optimized pipe functions for power of 2 type sizes

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D36327#840658, @bader wrote: > In https://reviews.llvm.org/D36327#840616, @yaxunl wrote: > > > In https://reviews.llvm.org/D36327#839809, @rjmccall wrote: > > > > > Could you just implement this in SimplifyLibCalls? I assume there's some > > >

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 7 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:89 + static std::unique_ptr create(LangOptions &Opt); +}; + rjmccall wrote: > The previous design of this header seems more appropriate to me. Cla

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:92 +/// \brief Defines the synch scope ABI for OpenCL. +class AtomicScopeOpenCLABI : public AtomicScopeABI { +public: rjmccall wrote: > yaxunl wrote

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: include/clang/Basic/SyncScope.h:92 +/// \brief Defines the synch scope ABI for OpenCL. +class AtomicScopeOpenCLABI : public AtomicScopeABI { +public: rjmccall wrote: > yaxunl wrote

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 60. yaxunl marked 3 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D36580 Files: include/clang/AST/Expr.h include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic/SyncScope.h lib/AST/Ex

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310924: [OpenCL] Support variable memory scope in atomic builtins (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D36580?vs=60&id=85#toc Repository: rL LLVM https://r

[PATCH] D36676: Remove -finclude-default-header in OpenCL atomic tests

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL310927: Remove -finclude-default-header in OpenCL atomic tests (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D36676?vs=110953&id=91#toc Repository: rL LLVM https://revi

[PATCH] D36678: [OpenCL] Do not use vararg in emitted functions for enqueue_kernel

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: test/CodeGenOpenCL/cl20-device-side-enqueue.cl:64 + // B32: call i32 @__enqueue_kernel_vaargs(%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %struct.ndrange_t* [[NDR]]{{(.[0-9]+)?}}, i8 addrspa

[PATCH] D36678: [OpenCL] Do not use vararg in emitted functions for enqueue_kernel

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 111302. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Anastasia's comments. https://reviews.llvm.org/D36678 Files: lib/CodeGen/CGBuiltin.cpp test/CodeGenOpenCL/cl20-device-side-enqueue.cl Index: test/CodeGenOpenCL/cl20-devi

[PATCH] D36580: [OpenCL] Support variable memory scope in atomic builtins

2017-08-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: cfe/trunk/lib/Frontend/InitPreprocessor.cpp:581 // Define macros for the OpenCL memory scope. // The values should match clang SyncScope enum. + static_assert( t-tye wrote:

[PATCH] D36410: [OpenCL] Handle taking address of block captures

2017-08-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Sorry for the delay. I feel forbidding user taking address of captured variable is too restrictive and make blocks less useful. A block is quite like a normal function with a generic pointer argument. Users take the responsibility to make sure the cast of a generic poin

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-08-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added inline comments. Comment at: lib/Sema/SemaType.cpp:6969 + if (state.getSema().getLangOpts().OpenCL && + !hasOpenCLAddressSpace && type.getAddressSpace() == 0 && Anastasia wrote: > yaxunl wrote: > > Ana

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-08-17 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D35082#844620, @rjmccall wrote: > The meaning we've agreed on for LangAS::Default is to be the address space of > local declarations, which corresponds quite well to __private in OpenCL. I > think your concern about diagnostics is better addr

[PATCH] D36951: [OpenCL][5.0.0 Release] Release notes for OpenCL in Clang

2017-08-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks. https://reviews.llvm.org/D36951 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 112288. yaxunl edited the summary of this revision. yaxunl added a comment. Herald added subscribers: nhaehnle, jholewinski. Add a flag to indicate whether address space qualifier is implicit and only print explicit address space in diagnostics. https://revi

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11846 // an address space. if (T.getAddressSpace() != 0) { // OpenCL allows function arguments declared to be an array of a type Anastasia wrote: >

[PATCH] D36678: [OpenCL] Do not use vararg in emitted functions for enqueue_kernel

2017-08-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: test/CodeGenOpenCL/cl20-device-side-enqueue.cl:116 + // B32: store i32 4, i32* %[[TMP3]], align 4 + // B32: call i32 @__enqueue_kernel_vaargs(%opencl.queue_t{{.*}}* [[DEF_Q]], i32 [[FLAGS]], %st

[PATCH] D34367: CodeGen: Fix address space of indirect function argument

2017-08-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGCall.cpp:3832 + "indirect-arg-temp"); +IRCallArgs[FirstIRArg] = CastToAllocaAddrSpace(Addr.getPointer()); rjmccall wrote

[PATCH] D71725: [OpenCL] Fix inconsistency between opencl and c11 atomic fetch max/min

2019-12-27 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG134ef0fb4b92: [OpenCL] Fix inconsistency between opencl and c11 atomic fetch max/min (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D71221: [HIP] Add option --gpu-max-threads-per-block=n

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

[PATCH] D71221: [HIP] Add option --gpu-max-threads-per-block=n

2020-01-07 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG9f2d8b5c0cdb: [HIP] Add option --gpu-max-threads-per-block=n (authored by yaxunl). Herald added a project: clang. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.or

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

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

[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

2020-01-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D70172#1772140 , @rjmccall wrote: > Richard is definitely our main expert in the implicit synthesis of special > members. It seems to me that if we need the destructor declaration at some > point, we should be forcing it to ex

[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

2020-01-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D70172#1809571 , @rjmccall wrote: > I thought you were saying that the destructor decl hadn't been created yet, > but I see now that you're saying something more subtle. > > `CurContext` is set to the destructor because the stan

[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

2020-01-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 237122. yaxunl added a comment. Add tests for device compilation. Add a test when both vtbl and deleting dtor are emitted with diagnostic due to delete operator. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70172/new/ https://reviews.llvm.org/D701

[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

2020-01-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D70172#1810665 , @rsmith wrote: > This doesn't look quite right to me. I don't think we should treat the > `delete this;` for a destructor as being emitted-for-device in any > translation unit in which the vtable is marked used

[PATCH] D70172: [CUDA][HIP] Fix assertion due to dtor check on windows

2020-01-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In D70172#1812631 , @rjmccall wrote: > Most uses of the destructor do not use the delete operator, though, and > therefore should not trigger the diagnostics in `f` to be emitted. And this > really doesn't require a fully-realize

[PATCH] D72723: Built-in functions for AMDGPU MFMA instructions.

2020-01-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. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72723/new/ https://reviews.llvm.org/D72723 __

[PATCH] D87321: Fix -gz=zlib options for linker

2020-09-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 291227. yaxunl marked 6 inline comments as done. yaxunl added a comment. revised by Fangrui's comments. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87321/new/ https://reviews.llvm.org/D87321 Files: clang/lib/Driver/ToolChains/AMDGPU.cpp clang/

[PATCH] D87321: Fix -gz=zlib options for linker

2020-09-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/gz.c:1 +// RUN: %clang -### -target x86_64-unknown-linux-gnu -g -gz=none %s 2>&1 | \ +// RUN:FileCheck -check-prefix=NONE %s MaskRay wrote: > This can be merged into `compress.c` > You may delete som

[PATCH] D87321: Fix -gz=zlib options for linker

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

[PATCH] D87321: Fix -gz=zlib options for linker

2020-09-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/compress.c:26 +// CHECK-OPT_GZ_EQ_NONE: {{".*clang.*".* "--compress-debug-sections=none"}} +// CHECK-OPT_GZ_EQ_NONE: {{".*ld.*".* "--compress-debug-sections=none"}} + MaskRay wrote: > If the user sets CL

[PATCH] D87321: Fix -gz=zlib options for linker

2020-09-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: clang/test/Driver/hip-gz-options.hip:1 +// REQUIRES: clang-driver, x86-registered-target, amdgpu-registered-target + MaskRay wrote: > clang-driver is for some legacy cygwin stuff. It should not be needed. > > Does --offl

[PATCH] D87321: Fix -gz=zlib options for linker

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

[PATCH] D87321: Fix -gz=zlib options for linker

2020-09-11 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-gz-options.hip:14 +// CHECK-DAG: {{".*clang.*" .* "--compress-debug-sections=zlib"}} +// CHECK: {{"--compress-debug-sections=zlib"}} MaskRay wrote: > Since th

<    7   8   9   10   11   12   13   14   15   16   >