[PATCH] D50596: [HIP] Make __hip_gpubin_handle hidden to avoid being merged across different shared libraries

2018-08-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: rjmccall, tra. Different shared libraries contain different fat binary, which is stored in a global variable `__hip_gpubin_handle`. Since different compilation units share the same fat binary, this variable has linkonce linkage. However, it s

[PATCH] D50596: [HIP] Make __hip_gpubin_handle hidden to avoid being merged across different shared libraries

2018-08-17 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC340056: [HIP] Make __hip_gpubin_handle hidden to avoid being merged across different… (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D50596 Files: lib/CodeGen/CGC

[PATCH] D50259: [OpenCL] Disallow negative attribute arguments

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

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

2018-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 145699. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D46475 Files: include/clang/Basic/DiagnosticDriverKinds.td include/clang/Driver/Options.td include/clang/Driver/Types.h lib/

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

2018-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Driver/ToolChains/Clang.cpp:133-135 Work(*C.getSingleOffloadToolChain()); + if (JA.isHostOffloading(Action::OFK_HIP)) tra wrote: > CUDA and HIP are mutually exclusive,

[PATCH] D46601: [OpenCL] Fix typos in emitted enqueue kernel function names

2018-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: Anastasia, b-sumner. Two typos: vaarg => vararg get_kernel_preferred_work_group_multiple => get_kernel_preferred_work_group_size_multiple https://reviews.llvm.org/D46601 Files: lib/CodeGen/CGBuiltin.cpp test/CodeGenOpenCL/cl20-device-s

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

2018-05-08 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. yaxunl marked an inline comment as done. Closed by commit rL331811: [HIP] Add hip offload kind (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.or

[PATCH] D46643: CodeGen: Emit string literal in constant address space

2018-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. Some targets have constant address space (e.g. amdgcn). For them string literal should be emitted in constant address space then casted to default address space. https://reviews.llvm.org/D46643 Files: lib/CodeGen/CGDecl.cpp l

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

2018-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1083377, @rjmccall wrote: > Oh, I see, it's not that the lifetime intrinsics don't handle pointers in the > alloca address space, it's that we might have already promoted them into > `DefaultAS`. > > Do the LLVM uses of lifetime intrins

[PATCH] D46601: [OpenCL] Fix typos in emitted enqueue kernel function names

2018-05-09 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL331895: [OpenCL] Fix typos in emitted enqueue kernel function names (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D46601

[PATCH] D46643: CodeGen: Emit string literal in constant address space

2018-05-09 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:1375 +Loc = Address(EmitCastToVoidPtrInAllocaAddrSpace(Loc.getPointer()), + Loc.getAlignment()); rjmccall wrote: > I don't understand

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

2018-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332121: [HIP] Let clang-offload-bundler support HIP (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D46473 Files: lib/Driver/Driver.cpp lib/Driver/ToolChains/Cla

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

2018-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332122: [HIP] Diagnose unsupported host triple (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D46487?vs=145346&id=146379#

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

2018-05-11 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332123: [HIP] Set proper triple and offload kind for the toolchain (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D46475?

[PATCH] D46643: CodeGen: Emit string literal in constant address space

2018-05-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 146468. yaxunl marked an inline comment as done. yaxunl added a comment. Revised by John's comments. Also refactored to extract common code. https://reviews.llvm.org/D46643 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGen

[PATCH] D43281: [AMDGPU] fixes for lds f32 builtins

2018-05-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! Repository: rC Clang https://reviews.llvm.org/D43281 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.o

[PATCH] D46643: CodeGen: Emit string literal in constant address space

2018-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 146647. yaxunl marked 2 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D46643 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/CodeGenModule.cpp lib/CodeGen/CodeGenModule.h test/CodeGenCXX/amdgcn-string

[PATCH] D46643: CodeGen: Emit string literal in constant address space

2018-05-14 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332279: CodeGen: Emit string literal in constant address space (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D46643 Files: lib/CodeGen/CGDecl.cpp lib/CodeGen/C

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

2018-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D45900#1093160, @rjmccall wrote: > In https://reviews.llvm.org/D45900#1093154, @yaxunl wrote: > > > In https://reviews.llvm.org/D45900#1083377, @rjmccall wrote: > > > > > Oh, I see, it's not that the lifetime intrinsics don't handle pointers in

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

2018-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D46489#1088940, @rjmccall wrote: > I think the right solution here is to make a CompileJobAction with type > TY_LLVM_BC in the first place. You should get the advice of a driver expert, > though. There is already JobAction for TY_LLVM_BC. I

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

2018-05-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 146987. yaxunl edited the summary of this revision. yaxunl added a comment. Add optional argument to CreateMemTemp and CreateTempAlloca to get the original alloca and use it for lifetime intrinsic. https://reviews.llvm.org/D45900 Files: lib/CodeGen/CGCall

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 147156. yaxunl added a comment. Skip backend and assemmbler phases for amdgcn since it does not support linking of object files. https://reviews.llvm.org/D46476 Files: lib/Driver/Driver.cpp test/Driver/cuda-phases.cu Index: test/Driver/cuda-phases.cu =

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

2018-05-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl abandoned this revision. yaxunl added a comment. I have updated https://reviews.llvm.org/D46476 to skip backend and assembler phases for amdgcn, therefore this patch is no longer needed. https://reviews.llvm.org/D46489 ___ cfe-commits mailin

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

2018-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332593: CodeGen: Fix invalid bitcast for lifetime.start/end (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D45900?vs=1469

[PATCH] D46476: [HIP] Add action builder for HIP

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

[PATCH] D46472: [HIP] Support offloading by linker script

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

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

2018-05-17 Thread Yaxun Liu via Phabricator via cfe-commits
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] D46472: [HIP] Support offloading by linker script

2018-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D46472#1103577, @t-tye wrote: > LGTM except for minor suggestions. Thanks. Will make changes when committing. https://reviews.llvm.org/D46472 ___ cfe-commits mailing list cfe-commits@lists.llvm.

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

2018-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Hi Artem, I've addressed your comments. Any further changes are needed? Thanks. https://reviews.llvm.org/D45212 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D46472: [HIP] Support offloading by linker script

2018-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL332724: [HIP] Support offloading by linker script (authored by yaxunl, committed by ). Herald added a subscriber: llvm-commits. Changed prior to commit: https://reviews.llvm.org/D46472?vs=145480&id=1475

[PATCH] D47099: Disable casting of alloca for ActiveFlag

2018-05-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: rjmccall. ActiveFlag is a temporary variable emitted for clean up. It is defined as AllocaInst* type and there is a cast to AlllocaInst in SetActiveFlag. An alloca casted to generic pointer causes assertion in SetActiveFlag. Since there is

[PATCH] D47099: Disable casting of alloca for ActiveFlag

2018-05-19 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D47099#1105493, @rjmccall wrote: > Maybe there should just be a method that makes a primitive alloca without the > casting, and then you can call that in CreateTempAlloca. In many cases we still need to call CreateTempAlloca with cast enabled

[PATCH] D46472: [HIP] Support offloading by linker script

2018-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: cfe/trunk/lib/Driver/ToolChains/CommonArgs.cpp:1371-1388 + // machines. + LksStream << "/*\n"; + LksStream << " HIP Offload Linker Script\n"; + LksStream << " *** Automatically generated by Clang ***\n"; + LksStream << "*/\n";

[PATCH] D47099: Disable casting of alloca for ActiveFlag

2018-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 147860. yaxunl added a comment. Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCast by John's comments. https://reviews.llvm.org/D47099 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCleanup.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunctio

[PATCH] D47099: Disable casting of alloca for ActiveFlag

2018-05-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 147914. yaxunl edited the summary of this revision. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D47099 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCleanup.cpp lib/CodeGen/CGExpr.cpp lib/CodeGen/CodeGenFunction.h tes

[PATCH] D47099: Call CreateTempAllocaWithoutCast for ActiveFlag

2018-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC332982: Call CreateTempMemWithoutCast for ActiveFlag (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D47099 Files: lib/CodeGen/CGCall.cpp lib/CodeGen/CGCleanup.c

[PATCH] D47099: Call CreateTempAllocaWithoutCast for ActiveFlag

2018-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. I revert it since it caused regression on arm and some other arch's. Script: -- /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-linux/stage1/bin/clang -cc1 -internal-isystem /home/ssglocal/clang-cmake-x86_64-avx2-linux/clang-cmake-x86_64-avx2-

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: lib/Driver/Driver.cpp:2221 +CudaDeviceActions.clear(); +for (unsigned I = 0, E = GpuArchList.size(); I != E; ++I) { + CudaDeviceActions.push_back(UA); tra

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 148051. yaxunl marked 4 inline comments as done. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D46476 Files: lib/Driver/Driver.cpp test/Driver/cuda-phases.cu Index: test/Driver/cuda-phases.cu =

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

2018-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 19 inline comments as done. yaxunl added a comment. In https://reviews.llvm.org/D45212#1105177, @tra wrote: > Hi, > > Sorry about the long silence. I'm back to continue the reviews. I'll handle > what I can today and will continue with the rest on Tuesday. > > It looks like patch d

[PATCH] D45212: Add HIP toolchain

2018-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 148216. yaxunl marked 19 inline comments as done. yaxunl retitled this revision from "[HIP] Let CUDA toolchain support HIP language mode and amdgpu" to "Add HIP toolchain". yaxunl edited the summary of this revision. yaxunl added a comment. Herald added a subsc

[PATCH] D45212: Add HIP toolchain

2018-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: lib/Driver/ToolChains/HIP.cpp:29-47 +static bool addBCLib(Compilation &C, const ArgList &Args, + ArgStringList &CmdArgs, ArgStringList LibraryPaths, + String

[PATCH] D45212: Add HIP toolchain

2018-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 148277. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revised by Artem's comments. https://reviews.llvm.org/D45212 Files: include/clang/Driver/Options.td lib/Driver/CMakeLists.txt lib/Driver/Driver.cpp lib/Driver/ToolChains/HIP.cpp

[PATCH] D45212: Add HIP toolchain

2018-05-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Driver/ToolChains/HIP.cpp:44 + } + if (!FoundLibDevice) +C.getDriver().Diag(diag::err_drv_no_such_file) << BCName; tra wrote: > You don't need FoundLibDevice any more as

[PATCH] D47376: [CUDA][HIP] Do not offload for -M

2018-05-25 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added a reviewer: tra. CUDA and HIP action builder currently tries to do offloading for -M, which causes dependency file not generated. This patch changes action builder so that only host compilation is performed to generate dependency file. This assumes th

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. ping Any further changes are needed? Thanks. https://reviews.llvm.org/D46476 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-29 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: test/Driver/cuda-phases.cu:16 +// RUN: | FileCheck -check-prefixes=BIN,BIN_NV %s +// RUN: %clang -x hip -target powerpc64le-ibm-linux-gnu -ccc-print-phases --cuda-gpu-arch=gfx803 %s 2>&1 \ +// RUN

[PATCH] D46476: [HIP] Add action builder for HIP

2018-05-29 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 rC333483: Add action builder for HIP (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D46476?vs=148051&id=149012#toc Reposit

[PATCH] D45212: Add HIP toolchain

2018-05-29 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 rC333484: Add HIP toolchain (authored by yaxunl, committed by ). Changed prior to commit: https://reviews.llvm.org/D45212?vs=148277&id=149013#toc Repository: rC

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

2017-09-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 116704. yaxunl marked 5 inline comments as done. yaxunl added a comment. Rebase to ToT and clean up logic. https://reviews.llvm.org/D35082 Files: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/Basic/AddressSpaces.h lib/AST/ASTC

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

2017-09-26 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: lib/Sema/SemaType.cpp:6974 + if (state.getSema().getLangOpts().OpenCL && !hasOpenCLAddressSpace && + type.getAddressSpace() == LangAS::Default && Anastasia wrote: > I am no

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-09-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:311 +// The header is basically 'struct { int; int; generic void *; +// custom_fields; }'. Assert that that struct is packed. +auto GenPtrAlign = CharUnits::fro

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-09-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 116877. yaxunl marked 4 inline comments as done. yaxunl added a comment. Rebased to ToT and revised by Anastasia's comments. https://reviews.llvm.org/D37822 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRuntime.h

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

2017-09-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 5 inline comments as done. yaxunl added inline comments. Comment at: lib/Sema/SemaType.cpp:6810 + QualType &T, TypeAttrLocation TAL) { + if (!State.getSema().getLangOpts().OpenCL || + T.getAddressSpace() != LangAS::Defa

[PATCH] D37568: [AMDGPU] Allow flexible register names in inline asm constraints

2017-09-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. Ping. Brian, Stas, Can you review this since Matt is on vacation? Thanks. https://reviews.llvm.org/D37568 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.or

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

2017-09-28 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 117020. yaxunl marked 3 inline comments as done. yaxunl added a comment. Revised by Anastasia's comments. https://reviews.llvm.org/D35082 Files: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/Basic/AddressSpaces.h lib/AST/ASTCo

[PATCH] D37568: [AMDGPU] Allow flexible register names in inline asm constraints

2017-09-28 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314452: [AMDGPU] Allow flexible register names in inline asm constraints (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D37568?vs=116383&id=117037#toc Repository: rL LLVM ht

[PATCH] D38463: [OpenCL] Fix checking of vector type casting

2017-10-02 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Currently clang allows the following code int a; int b = (const int) a; However it does not the following code int4 a; int4 b = (const int4) a; This is because Clang compares the qualified types instead of unqualified types for vector type casting, which

[PATCH] D38463: [OpenCL] Fix checking of vector type casting

2017-10-03 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314802: [OpenCL] Fix checking of vector type casting (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D38463?vs=117357&id=117524#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added inline comments. Comment at: test/CodeGenOpenCL/blocks.cl:30 + // COMMON: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 }>, <{ i32, i32, i8 addrspace(4)*, i32 }>* %[[block]], i32 0, i32

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-10-04 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 rL314932: [OpenCL] Clean up and add missing fields for block struct (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D37822?vs=116877&id=117

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 10 inline comments as done. yaxunl added a comment. In https://reviews.llvm.org/D38134#880133, @Anastasia wrote: > I think we should add a test case when the same block is both called and > enqueued. Will do. Comment at: test/CodeGenOpenCL/amdgpu-enqueue-kerne

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 117739. yaxunl marked an inline comment as done. yaxunl edited the summary of this revision. yaxunl added a comment. Emit enqueued block as a wrapper kernel which calls the block invoke function. Added test for calling and enqueue the same block. https://rev

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

2017-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 117770. yaxunl marked 9 inline comments as done. yaxunl added a comment. Revised by John's comments. https://reviews.llvm.org/D35082 Files: include/clang/AST/ASTContext.h include/clang/AST/Type.h include/clang/Basic/AddressSpaces.h lib/AST/ASTContext

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

2017-10-04 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D35082#887855, @rjmccall wrote: > Why is most of this patch necessary under the design of adding a > non-canonical __private address space? There are two reasons that we need a flag to indicate an address space is simplicit: 1. We need a co

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

2017-10-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D35082#889053, @rjmccall wrote: > Are you sure it's a good idea to not print the address space when it's > implicit? Won't that often lead to really confusing diagnostics? > > Also, we do already have a way of expressing that an extended quali

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

2017-10-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D35082#890143, @rjmccall wrote: > You have an important backend change relying on being able to preserve type > sugar better in diagnostics? The only apparent semantic change in this patch > is that you're changing the mangling, which frankly

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

2017-10-05 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D35082#890150, @rjmccall wrote: > Non-canonical information is not supposed to be mangled. > > It's not clear to me what the language rule you're really trying to implement > is. Maybe you really do need a canonical __private address space, in

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 6 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:144 + if (auto *I = dyn_cast(V)) { +// If the block literal is emitted as an instruction, it is an alloca +// and the block invoke function is stored to GEP

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-06 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 118064. yaxunl marked 5 inline comments as done. yaxunl added a comment. Revise by Anastasia's comments. https://reviews.llvm.org/D38134 Files: lib/CodeGen/CGBuiltin.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRuntime.h lib/CodeGen/CodeGe

[PATCH] D33681: [OpenCL] Allow function declaration with empty argument list.

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

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-10 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added inline comments. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:144 + if (auto *I = dyn_cast(V)) { +// If the block literal is emitted as an instruction, it is an alloca +// and the block invoke function is stored to GEP

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 118677. yaxunl marked 2 inline comments as done. yaxunl added a comment. Revised by Anastasia's comments. Get block invoke function by API instead of iterate through IR's. Pass the block kernel directly to `__enqueu_kernel functions`. https://reviews.llvm.o

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

2017-10-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. If there is no other issues. May I commit this patch now? Thanks. https://reviews.llvm.org/D35082 ___ 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-10-11 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In https://reviews.llvm.org/D35082#895230, @rjmccall wrote: > It sounds like there's agreement about the basic technical direction of > introducing LangAS::opencl_private. Please introduce > isAddressSpaceImplicit() in a differen

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 118795. yaxunl marked 5 inline comments as done. yaxunl added a comment. Revised by Anastasia's comments. https://reviews.llvm.org/D38134 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGBuiltin.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRu

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D38134#895848, @Anastasia wrote: > I think it would be good to add a block test to CodeGenOpenCL where we would > just call the block without any enqueue and check that the invoke function is > generated but the kernel wrapper isn't. we have

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

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 118813. yaxunl marked 7 inline comments as done. yaxunl edited the summary of this revision. yaxunl added a comment. Separate implicit addr space flag to another patch as John suggested. This patch only introduces the private addr space but does not print it.

[PATCH] D38857: [OpenCL] Improve printing and semantic check related to implicit addr space

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. There are two issues: 1. only (void*)0 should be treated as nullptr 2. only explicit addr space should be printed This patch introduces a flag in Qualifier to indicating a non-default address space qualifier is deduced by context. Only non-implicit address space q

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: include/clang/Basic/AddressSpaces.h:66 +inline LangAS LangASFromTargetAS(unsigned TargetAS) { + return static_cast((TargetAS) + how about `getLangASFromTargetAS` ? It is preferred to start with small letters. ===

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: tools/libclang/CXType.cpp:402 + ASTContext &Ctx = cxtu::getASTUnit(GetTU(CT))->getASTContext(); + return Ctx.getTargetAddressSpace(T); } arichardson wrote: > yaxunl wrote: > > Is this function suppose to return AST add

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

2017-10-12 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315668: [OpenCL] Add LangAS::opencl_private to represent private address space in AST (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D35082?vs=118813&id=118882#toc Repository:

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/AST/TypePrinter.cpp:1323 OS << "address_space("; -OS << T->getEquivalentType().getAddressSpace(); +OS << T->getEquivalentType() + .getQualifiers() arichardson wrote: > arichardson wrote: > >

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added inline comments. Comment at: lib/AST/TypePrinter.cpp:1323 OS << "address_space("; -OS << T->getEquivalentType().getAddressSpace(); +OS << T->getEquivalentType() + .getQualifiers() arichardson wrote: > yaxunl wrote: > > arich

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl accepted this revision. yaxunl added a comment. LGTM. Thanks! Great work! https://reviews.llvm.org/D38816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-14 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL315804: [OpenCL] Emit enqueued block as kernel (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D38134?vs=118795&id=119017#toc Repository: rL LLVM https://reviews.llvm.org/D38

[PATCH] D38857: [OpenCL] Improve printing and semantic check related to implicit addr space

2017-10-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked an inline comment as done. yaxunl added a comment. In https://reviews.llvm.org/D38857#896994, @Anastasia wrote: > LGTM! Thanks! > > Can we close https://bugs.llvm.org/show_bug.cgi?id=33418 after this commit? Will do. Comment at: test/SemaOpenCL/null_literal.cl:

[PATCH] D38966: CodeGen: Fix invalid bitcasts for atomic builtins

2017-10-16 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Currently clang assumes the temporary variables emitted during codegen of atomic builtins have address space 0, which is not true for target triple amdgcn---amdgiz and causes invalid bitcasts. This patch fixes that. https://reviews.llvm.org/D38966 Files: lib/Cod

[PATCH] D38966: CodeGen: Fix invalid bitcasts for atomic builtins

2017-10-17 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316000: CodeGen: Fix invalid bitcasts for atomic builtins (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D38966?vs=119182&id=119319#toc Repository: rL LLVM https://reviews.l

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-18 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Builder save/restores insertion pointer when emitting addr space cast for alloca, but does not save/restore debug loc, which causes verifier failure for certain call instructions. This patch fixes that. https://reviews.llvm.org/D39069 Files: lib/CodeGen/CGExpr.c

[PATCH] D39184: CodeGen: Fix invalid bitcast in partial initialization of automatic arrary variable

2017-10-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. https://reviews.llvm.org/D39184 Files: lib/CodeGen/CGDecl.cpp test/CodeGenOpenCL/amdgcn-automatic-variable.cl Index: test/CodeGenOpenCL/amdgcn-automatic-variable.cl === --- test/CodeGenOpenCL/amdgc

[PATCH] D39184: CodeGen: Fix invalid bitcast in partial initialization of automatic arrary variable

2017-10-23 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316353: CodeGen: Fix invalid bitcast in partial initialization of automatic arrary… (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D39184?vs=119861&id=119900#toc Repository:

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D39069#903344, @rjmccall wrote: > If this is something we generally need to be doing in all the places we > temporarily save and restore the insertion point, we should fix the basic > behavior of saveIP instead of adding explicit code to a bun

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-23 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 119918. yaxunl added a comment. Use InsertPointGuard and simplify test. https://reviews.llvm.org/D39069 Files: lib/CodeGen/CGExpr.cpp test/CodeGenOpenCL/func-call-dbg-loc.cl Index: test/CodeGenOpenCL/func-call-dbg-loc.cl ===

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 120076. yaxunl added a comment. Revised the test by Paul's comments. https://reviews.llvm.org/D39069 Files: lib/CodeGen/CGExpr.cpp test/CodeGenOpenCL/func-call-dbg-loc.cl Index: test/CodeGenOpenCL/func-call-dbg-loc.cl ==

[PATCH] D39069: CodeGen: Fix missing debug loc due to alloca

2017-10-24 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL316484: CodeGen: Fix missing debug loc due to alloca (authored by yaxunl). Changed prior to commit: https://reviews.llvm.org/D39069?vs=120076&id=120115#toc Repository: rL LLVM https://reviews.llvm.o

[PATCH] D51212: [OpenCL][Docs] Release notes for OpenCL in Clang

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

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

2018-08-24 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. Herald added a subscriber: jvesely. In https://reviews.llvm.org/D43783#1204353, @svenvh wrote: > Sorry for digging up an old commit... > > Apparently this broke block arguments, e.g. the following test case: > > int foo(int (^ bl)(void)) { > return bl(); > } > >

[PATCH] D51336: [HIP] Fix output file extension

2018-08-27 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. yaxunl added reviewers: tra, rjmccall. OffloadBundlingJobAction constructor accepts a list of JobAction as inputs. The host JobAction is the last one. The file type of OffloadBundlingJobAction should be determined by the host JobAction (the last one) instead of the fi

[PATCH] D51336: [HIP] Fix output file extension

2018-08-28 Thread Yaxun Liu via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rC340873: [HIP] Fix output file extension (authored by yaxunl, committed by ). Repository: rC Clang https://reviews.llvm.org/D51336 Files: lib/Driver/Action.cpp test/Driver/hip-output-file-name.hip

  1   2   3   4   5   6   7   8   9   10   >