[PATCH] D51411: [OpenCL] Improve diagnostic of argument in address space conversion builtins

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Is this a feature requested by users? I can understand that this may be useful to pinpoint some conversions which are potentially harmful to performance. However such conversions can often be eliminated by optimization, which makes this warning less useful. On the other

[PATCH] D51411: [OpenCL] Improve diagnostic of argument in address space conversion builtins

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8584 + "passing non-generic address space pointer to %0" + " generates dynamic conversion where it is not needed">; How about change this to: may cause dynamic conversion af

[PATCH] D43783: [OpenCL] Remove block invoke function from emitted block literal struct

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D43783#1215573, @Anastasia wrote: > In https://reviews.llvm.org/D43783#1212485, @yaxunl wrote: > > > In https://reviews.llvm.org/D43783#1204353, @svenvh wrote: > > > > > Sorry for digging up an old commit... > > > > > > Apparently this broke blo

[PATCH] D51434: [HIP] Add -amdgpu-internalize-symbols option to opt

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl. AMDGPU backend needs -amdgpu-internalize-symbols option for opt to work around a limitation of no PLT support, otherwise there is compilation error at -O0. https://reviews

[PATCH] D51441: Add predefined macro __gnu_linux__ for proper aux-triple

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. Herald added a subscriber: krytarowski. Clang predefine macro `__linx__` for aux-triple with Linux OS but does not predefine macro `__gnu_linux__`. This causes some compilation error for certain applications, e.g. Eigen. This patch fixes

[PATCH] D51434: [HIP] Add -amdgpu-internalize-symbols option to opt

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D51434#1217772, @tra wrote: > Could you elaborate on what exactly is the problem this patch fixes? > I don't see how internalizing the symbols connects to PLTs. My understanding > is that PLTs are used to provide stubs for symbols to be resolv

[PATCH] D51441: Add predefined macro __gnu_linux__ for proper aux-triple

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 163145. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D51441 Files: lib/Frontend/InitPreprocessor.cpp test/Preprocessor/predefined-macros.c Index: test/Preprocessor/predefined-macros.c ===

[PATCH] D51434: [HIP] Add -amdgpu-internalize-symbols option to opt

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D51434#1217971, @arsenm wrote: > https://reviews.llvm.org/D51209 is the patch. I think HIP will need an > additional patch, since I think it isn’t subclassing the amdgpu toolchain Yes since HIP has different toolchain. This does not affect ke

[PATCH] D51441: Add predefined macro __gnu_linux__ for proper aux-triple

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D51441#1218010, @tra wrote: > While we're here, perhaps `Builder.defineMacro("__linux__")` should be > changed to `DefineStd("linux")` which defines `linux/__linux/__linux__`? Will do when committing. Thanks. https://reviews.llvm.org/D51441

[PATCH] D51441: Add predefined macro __gnu_linux__ for proper aux-triple

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D51441#1218034, @yaxunl wrote: > In https://reviews.llvm.org/D51441#1218010, @tra wrote: > > > While we're here, perhaps `Builder.defineMacro("__linux__")` should be > > changed to `DefineStd("linux")` which defines `linux/__linux/__linux__`? >

[PATCH] D51441: Add predefined macro __gnu_linux__ for proper aux-triple

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC340967: Add predefined macro __gnu_linux__ for proper aux-triple (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D51441 Files: lib/Frontend/InitPreprocessor.cpp

[PATCH] D51209: AMDGPU: Default to hidden visibility

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

[PATCH] D51434: [HIP] Add -fvisibility hidden option to clang

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 163186. yaxunl retitled this revision from "[HIP] Add -amdgpu-internalize-symbols option to opt" to "[HIP] Add -fvisibility hidden option to clang". yaxunl edited the summary of this revision. yaxunl added a comment. Use -fvisibility hidden. https://reviews.

[PATCH] D51434: [HIP] Add -fvisibility hidden option to clang

2018-08-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 163196. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D51434 Files: lib/Driver/ToolChains/HIP.cpp test/Driver/hip-toolchain.hip Index: test/Driver/hip-toolchain.hip ===

[PATCH] D51434: [HIP] Add -fvisibility hidden option to clang

2018-08-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Driver/ToolChains/HIP.cpp:256 +CC1Args.append({"-fvisibility", "hidden"}); } arsenm wrote: > We should probably start subclassing the HIP toolchain from AMDGPU and share > more of this I'd like to defer the re

[PATCH] D51434: [HIP] Add -fvisibility hidden option to clang

2018-08-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Driver/ToolChains/HIP.cpp:256 +CC1Args.append({"-fvisibility", "hidden"}); } arsenm wrote: > arsenm wrote: > > yaxunl wrote: > > > arsenm wrote: > > > > We should probably start subclassing the HIP toolchain fr

[PATCH] D51434: [HIP] Add -fvisibility hidden option to clang

2018-08-30 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL341077: [HIP] Add -fvisibility hidden option to clang (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D51434?vs=163196&id=

[PATCH] D51411: [OpenCL] Improve diagnostic of argument in address space conversion builtins

2018-09-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D51411#1224615, @Anastasia wrote: > In https://reviews.llvm.org/D51411#1217477, @yaxunl wrote: > > > Is this a feature requested by users? > > > > I can understand that this may be useful to pinpoint some conversions which > > are potentially h

[PATCH] D51809: [CUDA][HIP] Fix assertion in LookupSpecialMember

2018-09-07 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. ShouldDeleteSpecialMember is called upon inherited constructors. It calls inferCUDATargetForImplicitSpecialMember, which in turn calls LookupSpecialMember. LookupSpecialMember expects ConstArg==false for CXXDefaultConstructor. For inheri

[PATCH] D43783: [OpenCL] Remove block invoke function from emitted block literal struct

2018-09-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D43783#1235090, @Anastasia wrote: > Ping! Do you still plan to do this? :) Sorry I caught up in something else. Since there are some subsequent commits, it may take some efforts to revert it. Repository: rC Clang https://reviews.llvm.org

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

2018-07-19 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:444 +auto HandleValue = +CtorBuilder.CreateAlignedLoad(GpuBinaryHandle, CGM.getPointerAlign()); +llvm::Constant *Zero = llvm::Constant::getNullValue(Handle

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

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Sema/SemaOverload.cpp:3150 + !getLangOpts().OpenCLCPlusPlus) +return false; + rjmccall wrote: > yaxunl wrote: > > rjmccall wrote: > > > It's not really OpenCL C++ that

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

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

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

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156383. yaxunl marked 3 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu =

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

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156403. yaxunl marked 5 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D49294 Files: lib/Sema/SemaCast.cpp lib/Sema/SemaOverload.cpp test/CodeGenCXX/address-space-cast.cpp Index: test/CodeGenCXX/

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

2018-07-19 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:578 + DtorBuilder.CreateStore(Zero, GpuBinaryAddr); + DtorBuilder.CreateBr(ExitBlock); +DtorBuilder.SetInsertPoint(ExitBlock); rjmccall wrote

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

2018-07-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 156424. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGenCUDA/device-stub.cu Index: test/CodeGenCUDA/device-stub.cu =

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

2018-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL337540: Sema: Fix explicit address space cast in C++ (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D49294?vs=156403&id=1

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

2018-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337631: [HIP] Register/unregister device fat binary only once (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D49083 Files: lib/CodeGen/CGCUDANV.cpp test/CodeGen

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

2018-07-20 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337639: [HIP] Support -fcuda-flush-denormals-to-zero for amdgcn (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D48287 Files: include/clang/Basic/LangOptions.def

[PATCH] D49643: [HIP] Add -target-cpu option for clang -cc1

2018-07-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra, b-sumner, scchan. https://reviews.llvm.org/D49643 Files: lib/Driver/ToolChains/HIP.cpp test/Driver/hip-toolchain.hip test/Driver/lit.local.cfg Index: test/Driver/lit.local.cfg

[PATCH] D49643: [HIP] Add -target-cpu option for clang -cc1

2018-07-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49643#1171158, @rjmccall wrote: > The commit message here could be better. You're passing `-target-cpu` when > running the device-mode compiler. Right. Will fix. Thanks. https://reviews.llvm.org/D49643 _

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaChecking.cpp:3368-3374 } else if (Form != Load && Form != LoadCopy) { if (ValType.isConstQualified()) { Diag(DRE->getLocStart(), diag::err_atomic_op_needs_non_const_pointer) << Ptr->getType() << Ptr->g

[PATCH] D49643: [HIP] pass `-target-cpu` when running the device-mode compiler

2018-07-23 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC337793: [HIP] pass -target-cpu when running the device-mode compiler (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D49643?vs=156699&id=156953#toc Repository:

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM Repository: rC Clang https://reviews.llvm.org/D49723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. This patch also adds check for array of structs. Can you include this in title or split to a separate patch? Comment at: lib/Sema/SemaDecl.cpp:8065 +std::find(Names.begin(), Names.end(), DesugaredTy.getAsString()); +if (Names.end() != Match)

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-26 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/D49725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl requested changes to this revision. yaxunl added inline comments. This revision now requires changes to proceed. Comment at: lib/Basic/Targets/AMDGPU.h:398 + + LangAS getCUDABuiltinAddressSpace(unsigned AS) const override { +return LangAS::Default; I

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: include/clang/Basic/TargetInfo.h:1157 + /// language address space. + virtual LangAS getCUDABuiltinAddressSpace(unsigned AS) const { +return getLangASFromTargetAS(AS); I think this function is not needed. Although

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: test/CodeGenOpenCL/builtins-amdgcn.cl:3 +// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown -S -emit-llvm -o - %s | FileCheck -enable-var-scope %s +// RUN: %clang_cc1 -cl-std=CL2.0 -triple amdgcn-unknown-unknown-opencl -S -

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D47154#1108813, @tra wrote: > CUDA does not expose explicit AS on clang size. All pointers are treated as > generic and we infer specific address space only in LLVM. > `__nvvm_atom_*_[sg]_*` builtins should probably be removed as they are > i

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. CUDA 8.0 E.3.9.4 says: Within the body of a __device__ or __global__ function, only __shared__ variables or variables without any device memory qualifiers may be declared with static storage class. It is unclear how a function-s

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 157740. yaxunl edited the summary of this revision. yaxunl added a comment. update diagnostic message. https://reviews.llvm.org/D49931 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaDecl.cpp test/CodeGenC

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D49931#1178720, @tra wrote: > > This patch also allows function-scope static const variable without device > > memory qualifier and emits it as a global variable in constant address > > space. > > What does NVCC do with local static const vari

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11923-11930 + if (getLangOpts().CUDA && + !(VD->hasAttr() || +(VD->getType().isConstQualified() && + !VD->hasAttr() && + !VD-

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 157778. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D49931 Files: include/clang/Basic/DiagnosticSemaKinds.td lib/CodeGen/CodeGenModule.cpp lib/Sema/SemaDecl.cpp test/CodeGenCU

[PATCH] D49931: [CUDA][HIP] Allow function-scope static const variable

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC338188: [CUDA][HIP] Allow function-scope static const variable (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D49931 Files: include/clang/Basic/DiagnosticSemaKind

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks. Repository: rC Clang https://reviews.llvm.org/D49723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49930: [DebugInfo][OpenCL] Generate correct block literal debug info for OpenCL

2018-07-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Thanks. Repository: rC Clang https://reviews.llvm.org/D49930 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-30 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. I missed the addr space casts you added to CodeGenFunction::EmitBuiltinExpr. With those casts it should work. For other downstream address space agnostic languages, e.g. (HCC),

[PATCH] D50003: Sema: Fix explicit address space cast involving void pointers

2018-07-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. Explicit cast of a void pointer to a pointer type in different address space is incorrectly classified as bitcast, which causes invalid bitcast in codegen. The patch fixes that by checking the address space of the source and destina

[PATCH] D49930: [DebugInfo][OpenCL] Generate correct block literal debug info for OpenCL

2018-07-30 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. In https://reviews.llvm.org/D49930#1180388, @scott.linder wrote: > Thank you for taking a look @yaxunl. Should I wait for another reviewer or > can I commit this? I think it is OK to land. W

[PATCH] D50104: [OpenCL] Always emit alloca in entry block for enqueue_kernel builtin

2018-07-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:3342 auto *AT = llvm::ArrayType::get(SizeTy, NumArgs - First); + // Always insert the alloca in the entry block so it remains static in + // the SelectionDAG. + BasicBlock *Begin = nullptr;

[PATCH] D50003: Sema: Fix explicit address space cast involving void pointers

2018-08-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaCast.cpp:1050 + SrcType->getAs()->getPointeeType().getAddressSpace() != + DestType->getAs()->getPointeeType().getAddressSpace(); +} rjmccall wrote: > I know the code was like this before,

[PATCH] D50003: Sema: Fix explicit address space cast involving void pointers

2018-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/Sema/SemaCast.cpp:1050 + SrcType->getAs()->getPointeeType().getAddressSpace() != + DestType->getAs()->getPointeeType().getAddressSpace(); +} rjmccall wrote: > yaxunl wrote: > > rjmccall wrote: > >

[PATCH] D50104: [OpenCL] Always emit alloca in entry block for enqueue_kernel builtin

2018-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D50104#1184362, @scott.linder wrote: > Address feedback; I hope I understood correctly what debug info to check for. > > I don't see where in CreateMemTemp and friends EmitLifetimeStart gets called, > and I don't see any lifetime intrinsics in

[PATCH] D50104: [OpenCL] Always emit alloca in entry block for enqueue_kernel builtin

2018-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D50104#1185920, @scott.linder wrote: > I still don't quite see what you describe; with that change all of the > lifetime.end calls pile up just before the enclosing function returns, not > after each call to enqueue_kernel. Looking at > https

[PATCH] D50104: [OpenCL] Always emit alloca in entry block for enqueue_kernel builtin

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

[PATCH] D50003: Sema: Fix explicit address space cast involving void pointers

2018-08-02 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL338805: Sema: Fix explicit address space cast involving void pointers (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D500

[PATCH] D43078: Fix crash on array initializer with non-0 alloca addrspace

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

[PATCH] D43171: [AMDGPU] Change constant addr space to 4 for clang

2018-02-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: t-tye, b-sumner, arsenm. Herald added subscribers: tpr, dstuttard, nhaehnle, wdng, kzhuravl. https://reviews.llvm.org/D43171 Files: include/clang/Basic/BuiltinsAMDGPU.def lib/Basic/Targets/AMDGPU.cpp test/CodeGen/target-data.c test/Cod

[PATCH] D43240: [OpenCL] Fix __enqueue_block for block with captures

2018-02-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: Anastasia, bader. The following test case causes issue with codegen of __enqueue_block void (^block)(void) = ^{ callee(id, out); }; enqueue_kernel(queue, 0, ndrange, block); Clang first does codegen for block expression in the first l

[PATCH] D43171: [AMDGPU] Change constant addr space to 4 for clang

2018-02-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: test/CodeGenOpenCL/address-spaces.cl:37 +// SPIR: i32 addrspace(2)* %arg +// GIZ: i32 addrspace(4)* %arg void f__c(__constant int *arg) {} t-tye wrote: > Suggest using the same name across all the OpenCL tests as some ar

[PATCH] D43171: [AMDGPU] Change constant addr space to 4 for clang

2018-02-13 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325031: [AMDGPU] Change constant addr space to 4 (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D43171?vs=133802&id=13407

[PATCH] D43171: [AMDGPU] Change constant addr space to 4 for clang

2018-02-13 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325031: [AMDGPU] Change constant addr space to 4 (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D43171?vs=133802&id=134071#toc Repository: rC Clang https://re

[PATCH] D42800: Let CUDA toolchain support amdgpu target

2018-02-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 134107. yaxunl added a comment. Update with Greg's change. https://reviews.llvm.org/D42800 Files: include/clang/Basic/Cuda.h include/clang/Driver/ToolChain.h lib/Basic/Cuda.cpp lib/Basic/Targets/AMDGPU.cpp lib/Basic/Targets/AMDGPU.h lib/Basic/Tar

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

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 134416. yaxunl edited the summary of this revision. yaxunl added a comment. Revised by John's comments. Removed address space from CallArg and added l-value expression instead. https://reviews.llvm.org/D34367 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CG

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

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCall.h:211 + push_back(CallArg(rvalue, type, needscopy, AS)); } rjmccall wrote: > Ah, I think I understand what's going on here now. "indirect byval" > arguments include an implicit copy to the

[PATCH] D43240: [OpenCL] Fix __enqueue_block for block with captures

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D43240#1008560, @Anastasia wrote: > LGTM! Thanks for looking at this. Just one thing, I was wondering whether it > would be cleaner way if we extend > test/CodeGenOpenCL/cl20-device-side-enqueue.cl instead of adding a new one > here? Because

[PATCH] D43240: [OpenCL] Fix __enqueue_block for block with captures

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL325264: [OpenCL] Fix __enqueue_block for block with captures (authored by yaxunl, committed by ). Herald added subscribers: llvm-commits, nhaehnle. Changed prior to commit: https://reviews.llvm.org/D432

[PATCH] D43340: Clean up AMDGCN tests

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: t-tye, b-sumner. Remove amdgiz and use AMDGCN as check prefix. https://reviews.llvm.org/D43340 Files: test/CodeGen/address-space.c test/CodeGenCXX/cxx0x-initializer-stdinitializerlist.cpp test/CodeGenCXX/vla.cpp test/CodeGenOpenCL/ad

[PATCH] D43340: Clean up AMDGCN tests

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D43340#1008980, @t-tye wrote: > LGTM Plus I think there was a test with giz in its name. Should that be > renamed? That's test/CodeGenOpenCL/amdgpu-env-amdgiz.cl. I already renamed it in my last commit. https://reviews.llvm.org/D43340 _

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

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D34367#1009021, @rjmccall wrote: > That's not really okay; there are some places that make guarantees about > call-argument ordering, and in general we want that to be decided at a higher > level, rather than having a particular order forced i

[PATCH] D43340: Clean up AMDGCN tests

2018-02-15 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC325279: Clean up AMDGCN tests (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D43340?vs=134445&id=134465#toc Repository: rC Clang https://reviews.llvm.org/D433

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

2018-02-20 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 135109. yaxunl added a comment. Extends NeedsCopy of CallArg for indirect byval arguments. https://reviews.llvm.org/D34367 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.h lib/CodeGen/CGClass.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGObjCGNU.cpp

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

2018-02-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/CodeGen/CGCall.cpp:3505 +if (AS != LangAS::Default && AS != LangAS::opencl_private && +AS != CGM.getASTAllocaAddressSpace()) + Flag = CallArg::ByValArgNeedsCopy; rjmccall wrote: > This is an odd condi

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

2018-02-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 135301. yaxunl added a comment. Replace Flag with LValue in CallArg. https://reviews.llvm.org/D34367 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.h lib/CodeGen/CGClass.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGObjCGNU.cpp lib/CodeGen/ItaniumCX

[PATCH] D43570: [OpenCL] Add '-cl-uniform-work-group-size' compile option

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

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

2018-02-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 135474. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D34367 Files: lib/CodeGen/CGAtomic.cpp lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.h lib/CodeGen/CGClass.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExprCXX.cpp lib

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

2018-02-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 135499. yaxunl added a comment. sync to ToT. https://reviews.llvm.org/D34367 Files: lib/CodeGen/CGAtomic.cpp lib/CodeGen/CGCall.cpp lib/CodeGen/CGCall.h lib/CodeGen/CGClass.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExprCXX.cpp lib/CodeGen/CGGPUB

[PATCH] D43783: [OpenCL] Remove block invoke function from emitted block literal struct

2018-02-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: b-sumner, Anastasia, bader. Herald added a subscriber: nhaehnle. OpenCL runtime tracks the invoke function emitted for any block expression. Due to restrictions on blocks in OpenCL (v2.0 s6.12.5), it is always possible to know the block invoke

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

2017-05-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/AST/ASTContext.cpp:1942 case Type::Pipe: { -TypeInfo Info = getTypeInfo(cast(T)->getElementType()); -Width = Info.Width; -Align = Info.Align; +Width = Target->getPointerWidth(0); +Align = Target->getPointerAlign

[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

2017-05-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added subscribers: t-tye, Anastasia, tpr, dstuttard, wdng, kzhuravl. AMDGPU backend requires global variables in global or constant address space and alloca in private address space. However, in C++ all variables are in default address space. Previously chang

[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

2017-05-30 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 100819. yaxunl added a comment. Fix comments. https://reviews.llvm.org/D33706 Files: lib/Basic/Targets.cpp lib/CodeGen/CGCall.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h lib/CodeGen/CodeGenModule.cpp lib/Code

[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

2017-05-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1107 assert(T.getAddressSpace() == LangAS::Default); if (getASTAllocaAddressSpace() != LangAS::Default) { auto *Addr = getTargetHooks().performAddrSpaceCast( -

[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

2017-05-31 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 100899. yaxunl marked an inline comment as done. yaxunl added a comment. Remove redundant code. https://reviews.llvm.org/D33706 Files: lib/Basic/Targets.cpp lib/CodeGen/CGCall.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFun

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

2017-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D33597#770137, @Anastasia wrote: > Use global AS pointer for pipe size. > > @Sam, I am moving you to the reviewer to finish this change. Do you think it > makes sense to add RUN line with some AMD GPU in triple to the test? I would appreciate

[PATCH] D33706: CodeGen: Cast temporary variable to proper address space

2017-06-01 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 101070. yaxunl marked 2 inline comments as done. yaxunl retitled this revision from "[AMDGPU] Fix address space for global and temporary variables in C++" to "CodeGen: Cast temporary variable to proper address space". yaxunl edited the summary of this revision

[PATCH] D33821: [OpenCL] Harden function pointer diagnostics.

2017-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Thanks. https://reviews.llvm.org/D33821 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33706: CodeGen: Cast temporary variable to proper address space

2017-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 101221. yaxunl marked 7 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D33706 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h test/Code

[PATCH] D33706: CodeGen: Cast temporary variable to proper address space

2017-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 101227. yaxunl added a comment. Fix a comment. https://reviews.llvm.org/D33706 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h test/CodeGen/address-space.c test/CodeGen/default-address-spa

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Herald added subscribers: t-tye, tpr, dstuttard, wdng, kzhuravl. amdgcn target requires global variable to stay in global or constant address space. In C or C++ global variables are emitted in the default (generic) address space which the amdgcn backend cannot handle

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

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

[PATCH] D33598: [libclang] [OpenCL] Expose CIndex functions for typedef and address space

2017-06-07 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! sorry for the delay. https://reviews.llvm.org/D33598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/

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

2017-06-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 101955. yaxunl retitled this revision from "Support synchronisation scope in Clang atomic builtin functions" to "Add OpenCL 2.0 atomic builtin functions as Clang builtin". yaxunl edited the summary of this revision. yaxunl added a comment. Add __opencl_atomic

[PATCH] D33842: [AMDGPU] Fix address space of global variable

2017-06-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 102204. yaxunl marked an inline comment as done. yaxunl added a comment. Add TargetInfo::getTargetConstantAddressSpace. https://reviews.llvm.org/D33842 Files: include/clang/Basic/TargetInfo.h lib/Basic/Targets.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/C

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

2017-06-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 102374. yaxunl marked 11 inline comments as done. yaxunl edited the summary of this revision. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D28691 Files: docs/LanguageExtensions.rst include/clang/AST/Expr.h include/clang/

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

2017-06-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Can you add missing types to test/CodeGenOpenCL/opencl_types.cl ? Comment at: include/clang/Basic/TargetInfo.h:1034 + virtual LangAS::ID getOpenCLTypeAddrSpace(BuiltinType::Kind K) const { +switch (K) { +#define IMAGE_TYPE(ImgType, Id, SingletonId,

[PATCH] D34235: [OpenCL] Fix OpenCL and SPIR version metadata generation.

2017-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. LGTM. Thanks. https://reviews.llvm.org/D34235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

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

2017-06-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: include/clang/Basic/TargetInfo.h:1041 +default: + return LangAS::Default; +} bader wrote: > yaxunl wrote: > > I think the default (including even_t, clk_event_t, queue_t, reserved_id_t) > > should be global

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