[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-13 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 305250. hliao marked an inline comment as done. hliao added a comment. Revise the interface of that target hook. Add a dedicated test case for value reading from parameter even though most cases are already covered in the clang test. Repository: rG LLVM Git

[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-13 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 3 inline comments as done. hliao added inline comments. Comment at: llvm/include/llvm/CodeGen/BasicTTIImpl.h:227 + Optional getAssumedAddrSpace(const Value *V) const { +return getTLI()->getTargetMachine().getAssumedAddrSpace(V); arsenm wrote:

[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-16 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 3 inline comments as done. hliao added a comment. Kindly ping for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D91121/new/ https://reviews.llvm.org/D91121 ___ cfe-commits mailing lis

[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp:533 + if (!LD) +return -1; + tra wrote: > Is there a suitable constant for `don't know` result? I would say all generic pointers loaded from the constant memory are safe

[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-16 Thread Michael Liao 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 rGf375885ab86d: [InferAddrSpace] Teach to handle assumed address space. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D9112

[PATCH] D91121: [InferAddrSpace] Teach to handle assumed address space.

2020-11-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:483 +// Skip values with an assumed address space. +if (TTI->getAssumedAddrSpace(TopVal) == UninitializedAddressSpace) { + for (Value *PtrOperand : getPointerOperands(*TopVal,

[PATCH] D91590: [NVPTX] Efficently support dynamic index on CUDA kernel aggregate parameters.

2020-11-16 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added a reviewer: tra. Herald added subscribers: llvm-commits, cfe-commits, arphaman, hiraditya, yaxunl, mgorny, jholewinski. Herald added projects: clang, LLVM. hliao requested review of this revision. Repository: rG LLVM Github Monorepo https://reviews.llvm

[PATCH] D91590: [NVPTX] Efficently support dynamic index on CUDA kernel aggregate parameters.

2020-11-16 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. This's an experimental or demo-only patch in my spare time on eliminating private memory usage in https://godbolt.org/z/EPPn6h. The attachment F14026286: sample.tar.xz includes both the reference and new IR, PTX, and SASS (sm_60) outpu

[PATCH] D91590: [NVPTX] Efficently support dynamic index on CUDA kernel aggregate parameters.

2020-11-18 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. As mentioned earlier, that's very experimental support. Even though the SASS looks reasonable, it still needs verifying on real systems. For non-kernel functions, it seems we share the path. So that we should do a similar thing. The current approach fixes that in the code

[PATCH] D88424: [clang][codegen] Remove the insertion of `correctly-rounded-divide-sqrt-fp-math` fn-attr.

2020-10-01 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG8c36eaf03772: [clang][opencl][codegen] Remove the insertion of `correctly-rounded-divide-sqrt… (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.

[PATCH] D92418: [hip] Fix host object creation from fatbin

2020-12-01 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: yaxunl, ashi1. Herald added a project: clang. Herald added a subscriber: cfe-commits. hliao requested review of this revision. - `__hip_fatbin` should a symbol in `.hip_fatbin` section. Repository: rG LLVM Github Monorepo https://reviews.llv

[PATCH] D92418: [hip] Fix host object creation from fatbin

2020-12-01 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Even there's no functionality change, the original one breaks the kernel extraction script, which is designed to find the `.hip_fatbin` section. That internal tool is still required to extract kernels from objects generated from RDC linking. Repository: rG LLVM Github

[PATCH] D92418: [hip] Fix host object creation from fatbin

2020-12-02 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd8949a8ad3ca: [hip] Fix host object creation from fatbin (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D92418/new/ https://reviews.llvm.

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-22 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: arsenm, tra, rjmccall, yaxunl. Herald added subscribers: cfe-commits, kerbowa, nhaehnle, jvesely. Herald added a project: clang. hliao requested review of this revision. Herald added a subscriber: wdng. - If an aggregate argument is indirectly ac

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 300985. hliao added a comment. Test case is enhanced to check that no kernel argument type is coerced. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89980/new/ https://reviews.llvm.org/D89980 Files: clang/lib/

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D89980#2348339 , @tra wrote: > Are there any tests to illustrate what this change does to IR or generated > code? the existing test `kernel-args.cu` is enhanced by adding a pointer in that aggregate kernel argument. Previously,

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 300989. hliao added a comment. Revise the comment and point the safety issue by coercing the kernel argument from a generic pointer to a global one. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89980/new/ https:

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu:30 -} - -// HOST: define void @_Z22__device_stub__kernel2Ri(i32* nonnull align 4 dereferenceable(4) %x) arsenm wrote: > This test should not be deleted. I want to s

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 301012. hliao added a comment. Add `amdgpu-kernel-arg-pointer-type.cu` back and revise its checks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89980/new/ https://reviews.llvm.org/D89980 Files: clang/lib/Code

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu:19 +// COMMON-LABEL: define amdgpu_kernel void @_Z7kernel1Pi(i32*{{.*}} %x) +// OPT: [[VAL:%.*]] = load i32, i32* %x, align 4 // OPT: [[INC:%.*]] = add nsw i32 [[VAL]], 1 --

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu:19 +// COMMON-LABEL: define amdgpu_kernel void @_Z7kernel1Pi(i32*{{.*}} %x) +// OPT: [[VAL:%.*]] = load i32, i32* %x, align 4 // OPT: [[INC:%.*]] = add nsw i32 [[VAL]], 1 --

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/CodeGenCUDA/amdgpu-kernel-arg-pointer-type.cu:19 +// COMMON-LABEL: define amdgpu_kernel void @_Z7kernel1Pi(i32*{{.*}} %x) +// OPT: [[VAL:%.*]] = load i32, i32* %x, align 4 // OPT: [[INC:%.*]] = add nsw i32 [[VAL]], 1 --

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Besides the unpromotable `alloca` issue due to indirect accesses, such coercion to GLOBAL pointer directly is not safe as, in HIP/CUDA, both CONSTANT and GLOBAL pointers would be passed as the kernel arguments. Without introducing a new address space combing GLOBAL/CONSTA

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-10-30 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Even GLOBAL may have a better addressing mode, the unpromotable `alloca` resolved in this change has an even significant performance issue. We could favor GLOBAL LOAD/STORE for kernel function as I proposed in other threads but, considering that an aggregate argument may

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D89980#2368506 , @arsenm wrote: > I think this is a dead end approach. I don't see the connection to the > original problem you are trying to solve. Can you send me an IR testcase that > this is supposed to help? That's probabl

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. The code could be simply converted to a kernel one following the same pattern: struct S { float *p; float a[64]; int n; }; __global__ void kernel(S s) { *s.p = s.a[s.n]; } Here's the LLVM IR after frontend define protec

[PATCH] D89980: [hip] Remove kernel argument coercion.

2020-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D89980#2371526 , @tra wrote: > @jlebar -- FYI. This looks pretty similar to the issue you've reported > recently for NVPTX. is that reported in bugs.llvm.org? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D87858: [hip] Add HIP scope atomic ops.

2021-01-25 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 319013. hliao added a comment. Herald added a subscriber: dexonsmith. Rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87858/new/ https://reviews.llvm.org/D87858 Files: clang/include/clang/AST/Expr.h cla

[PATCH] D87858: [hip] Add HIP scope atomic ops.

2021-01-25 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D87858/new/ https://reviews.llvm.org/D87858 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-01 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 320409. hliao added a comment. Rebase to the main branch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 Files: clang/include/clang/AST/DeclCXX.h clang/include/clang

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-01 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 320568. hliao added a comment. - Remove `DeviceManglingNumber` to reduce memory usage. - Add a table in ASTContext for device lambda mangling numbers if that lamba requires. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.ll

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-01 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 320679. hliao added a comment. Revise comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 Files: clang/include/clang/AST/ASTContext.h clang/include/clang/AST/De

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. PING for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. @rsmith, @rnk and @rjmccall, could you review the latest change addressing the memory usage issue? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D69322/new/ https://reviews.llvm.org/D69322 ___

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2021-02-03 Thread Michael Liao 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 rGa2fdf9d4d734: [hip][cuda] Enable extended lambda support on Windows. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D69322

[PATCH] D110089: [CUDA] Implement experimental support for texture lookups.

2021-09-21 Thread Michael Liao via Phabricator via cfe-commits
hliao accepted this revision. hliao added a comment. This revision is now accepted and ready to land. Cool! I like the idea of *compile-time* dispatch. LGTM except minor warnings from clang-tidy. Could you fix them before committing this change? Repository: rG LLVM Github Monorepo CHANGES SI

[PATCH] D97318: [clang][CodeGen] Allow fp16 arg pass by register

2021-02-25 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:2821 +} else if (k == BuiltinType::Float16 || k == BuiltinType::Half) { + // AMD64 does not support operations on _Float16 or __fp16 other than + // load and store. For load/store operations,

[PATCH] D97318: [clang][CodeGen] Allow fp16 arg pass by register

2021-02-25 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:2821 +} else if (k == BuiltinType::Float16 || k == BuiltinType::Half) { + // AMD64 does not support operations on _Float16 or __fp16 other than + // load and store. For load/store operations,

[PATCH] D107718: [cuda] Mark builtin texture/surface reference variable as 'externally_initialized'.

2021-08-08 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, yaxunl. Herald added a reviewer: a.sidorin. hliao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. - They need to be preserved even if there's no reference within the device code as t

[PATCH] D107718: [cuda] Mark builtin texture/surface reference variable as 'externally_initialized'.

2021-08-09 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:4441 if (Linkage != llvm::GlobalValue::InternalLinkage && - (D->hasAttr() || D->hasAttr())) + (D->hasAttr() || D->hasAttr() || + D->getType()->isCUDADeviceBuiltinSurfac

[PATCH] D107718: [cuda] Mark builtin texture/surface reference variable as 'externally_initialized'.

2021-08-09 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6ec36d18ec7b: [cuda] Mark builtin texture/surface reference variable as… (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107718/new/ http

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-06-29 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: yaxunl, bogner. Herald added subscribers: ormris, hiraditya. hliao requested review of this revision. Herald added projects: clang, LLVM. Herald added subscribers: llvm-commits, cfe-commits. - ``externally_initialized`` variables would be initial

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-06-29 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/test/CodeGenCUDA/host-used-device-var.cu:20 -// DEV-NEG-NOT: @v1 -__device__ int v1; BTW, as clang codegen tests, those checks should not rely on middle-end optimizations to work correctly. Comm

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-06-30 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 355764. hliao added a comment. Fix typo. Kindly PING for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105135/new/ https://reviews.llvm.org/D105135 Files: clang/test/CodeGenCUDA/host-used-device-var.cu

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-07-06 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 356721. hliao added a comment. Kindly PING for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105135/new/ https://reviews.llvm.org/D105135 Files: clang/test/CodeGenCUDA/host-used-device-var.cu clang/t

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-07-07 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 357053. hliao added a comment. Revert part of tests back and convert them into positive ones. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105135/new/ https://reviews.llvm.org/D105135 Files: clang/test/CodeGe

[PATCH] D105135: [Internalize] Preserve variables externally initialized.

2021-07-08 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4e5d9c88033f: [Internalize] Preserve variables externally initialized. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105135/new/ https:

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Herald added a subscriber: asavonic. Sorry for the late reply. Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:903-905 Optional InferAddressSpacesImpl::updateAddressSpace( -const Value &V, const ValueToAddrSpaceMapTy &InferredAddrSpace)

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 384433. hliao added a comment. Move the updating action into `updateAddrSpace` and return a boolean true if it's really updated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 384535. hliao added a comment. Updated. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org/D112041 Files: clang/test/CodeGen/thinlto-distributed-newpm.ll llvm/include/llvm/Ana

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-03 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D112041#3106936 , @nikic wrote: > I'd still like an answer to: > > In D112041#3073464 , @nikic wrote: > >> Is it actually necessary to thread this through AssumptionCache, given how >> I

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-04 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 384753. hliao added a comment. Rebase and kindly ping for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org/D112041 Files: clang/test/CodeGen/thinlto-distributed-newpm.

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-04 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: llvm/lib/Transforms/Scalar/InferAddressSpaces.cpp:196 void inferAddressSpaces(ArrayRef Postorder, - ValueToAddrSpaceMapTy *InferredAddrSpace) const; +

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-05 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 385083. hliao marked an inline comment as done. hliao added a comment. Rebase to the main branch. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org/D112041 Files: clang/test/Co

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-07 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 385378. hliao added a comment. Rebase and ping for further review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org/D112041 Files: clang/test/CodeGen/thinlto-distributed-newpm

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-08 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 385483. hliao added a comment. Rebase and kindly PING for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D112041/new/ https://reviews.llvm.org/D112041 Files: clang/test/CodeGen/thinlto-distributed-newpm.

[PATCH] D112041: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates.

2021-11-08 Thread Michael Liao 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 rGbf225939bc3a: [InferAddressSpaces] Support assumed addrspaces from addrspace predicates. (authored by hliao). Repository: rG LLVM Github Monorepo

[PATCH] D87858: [hip] Add HIP scope atomic ops.

2021-11-11 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D87858#3125630 , @yaxunl wrote: > Hi Michael, would you like to continue working on this, or let someone from > AMD to take over? Thanks. please take over it. I will abandon it so that you could start it over. Repository: rG

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-20 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 251777. hliao added a comment. Minor revising following reviewer's comment. Work on Sema checks and upload another review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76365/new/ https://reviews.llvm.org/D76365

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-20 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 5 inline comments as done. hliao added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:701-713 + if (getLangOpts().CUDAIsDevice) { +// As CUDA builtin surface/texture types are replaced, skip generating TBAA +// access info. +if (AccessT

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-24 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 252468. hliao marked an inline comment as done. hliao added a comment. Add Sema checks on CUDA device builtin surface/texture attributes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76365/new/ https://reviews.l

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-24 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 6 inline comments as done. hliao added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:701-713 + if (getLangOpts().CUDAIsDevice) { +// As CUDA builtin surface/texture types are replaced, skip generating TBAA +// access info. +if (AccessT

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-25 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 3 inline comments as done. hliao added inline comments. Comment at: clang/lib/Headers/__clang_cuda_runtime_wrapper.h:82-94 #undef __CUDACC__ #if CUDA_VERSION < 9000 #define __CUDABE__ #else +#define __CUDACC__ #define __CUDA_LIBDEVICE__ #endif

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-26 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 252758. hliao added a comment. Fix windows build and revise header change. - When including `drivers_types.h` or `host_defines.h` with `__CUDACC__`, the only difference is the additional attributes added. No additional change. - After including `host_defines.h

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-26 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/lib/Headers/__clang_cuda_runtime_wrapper.h:82-94 #undef __CUDACC__ #if CUDA_VERSION < 9000 #define __CUDABE__ #else +#define __CUDACC__ #define __CUDA_LIBDEVICE__ #endif

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-26 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 252828. hliao added a comment. Rebase to the master code Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76365/new/ https://reviews.llvm.org/D76365 Files: clang/include/clang/AST/Type.h clang/include/clang/Bas

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-26 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1944272 , @tra wrote: > LGTM. Next step is to figure out what various > __nv_tex_surf_handler(...) maps to for various strings (there are > ~110 of them in CUDA-10.2) and implement its replacement. I think we should > be

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-26 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6a9ad5f3f4ac: [cuda][hip] Add CUDA builtin surface/texture reference support. (authored by hliao). Changed prior to commit: https://reviews.llvm.org/D76365?vs=252828&id=252929#toc Repository: rG LLVM

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1946345 , @tra wrote: > Looks like the change breaks compilation for us: > > In file included from :1: > In file included from > llvm_unstable/toolchain/lib/clang/google3-trunk/include/__clang_cuda_runtime_wrapper.h:10

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1946407 , @tra wrote: > In D76365#1946345 , @tra wrote: > > > Looks like the change breaks compilation for us: > > > > In file included from :1: > > In file included from > > ll

[PATCH] D76948: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. This's revised change from https://reviews.llvm.org/D76365 after fixing Sema checks on the template partial specialization. With this change, I could compile the following sample code using surface reference. kernel.cu #include surface surf; #if defined(__cl

[PATCH] D76948: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao created this revision. hliao added reviewers: tra, rjmccall, yaxunl. Herald added a reviewer: a.sidorin. Herald added a project: clang. Herald added a subscriber: cfe-commits. hliao added a comment. This's revised change from https://reviews.llvm.org/D76365 after fixing Sema checks on the t

[PATCH] D76948: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76948#1946861 , @tra wrote: > Would it be possible to update the old review with the new diff? It would > make it easier to see the incremental changes you've made. If the old review > can be reopened that would be great as it

[PATCH] D76948: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76948#1946861 , @tra wrote: > Would it be possible to update the old review with the new diff? It would > make it easier to see the incremental changes you've made. If the old review > can be reopened that would be great as it

[PATCH] D76948: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao marked an inline comment as done. hliao added inline comments. Comment at: clang/test/SemaCUDA/bad-attributes.cu:74-75 + +typedef __attribute__((device_builtin_surface_type)) unsigned long long s0_ty; // expected-warning {{'device_builtin_surface_type' attribute only appli

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 253214. hliao added a comment. Fix Sema checks on partial template specialization. - Revise Sema checks on the template class. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76365/new/ https://reviews.llvm.org/D7

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1946925 , @hliao wrote: > Fix Sema checks on partial template specialization. > > - Revise Sema checks on the template class. The new revision is accepted, right? Just want to confirm as it seems you accept it before I p

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG5be9b8cbe2b2: [cuda][hip] Add CUDA builtin surface/texture reference support. (authored by hliao). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D76365/new/

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1947103 , @tra wrote: > In D76365#1946938 , @hliao wrote: > > > The new revision is accepted, right? Just want to confirm as it seems you > > accept it before I posted the new chang

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1947103 , @tra wrote: > In D76365#1946938 , @hliao wrote: > > > The new revision is accepted, right? Just want to confirm as it seems you > > accept it before I posted the new chang

[PATCH] D76365: [cuda][hip] Add CUDA builtin surface/texture reference support.

2020-03-27 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D76365#1947462 , @hliao wrote: > In D76365#1947103 , @tra wrote: > > > In D76365#1946938 , @hliao wrote: > > > > > The new revision is accepted, rig

[PATCH] D59321: AMDGPU: Teach toolchain to link rocm device libs

2020-04-01 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. Do we have a better way to avoid adding those empty bitcode files? Comment at: clang/lib/Driver/ToolChains/AMDGPU.h:29 + struct ConditionalLibrary { +SmallString<0> On; +SmallString<0> Off; may need to add `llvm` namespace prefix

[PATCH] D77238: [CUDA][NFC] Split math.h functions out of __clang_cuda_device_functions.h

2020-04-01 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. this patch breaks the test clang/test/Headers/nvptx_device_cmath_functions.cpp, could you please fix it ASAP? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D77238/new/ https://reviews.llvm.org/D77238 __

[PATCH] D59321: AMDGPU: Teach toolchain to link rocm device libs

2020-04-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. In D59321#1955646 , @arsenm wrote: > In D59321#1955405 , @hliao wrote: > > > Do we have a better way to avoid adding those empty bitcode files? > > > No, we need the files to exist for tests.

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-19 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 245461. hliao added a comment. Rebase to the latest trunk code. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-20 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 245682. hliao added a comment. Skip non-function or non-TU context so far as more cases need considering. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/i

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-20 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 2 inline comments as done. hliao added inline comments. Comment at: clang/include/clang/Sema/Sema.h:11442 + ContextDecl = getCUDACurrentNonLocalVariable(); +return ContextDecl; + } rjmccall wrote: > This is tricky because we could be in a n

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-20 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 245735. hliao marked an inline comment as done. hliao added a comment. Rebase the code to the latest trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-20 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 245747. hliao added a comment. Revise following reviewer comments. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Pa

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-21 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 245863. hliao added a comment. Rebase to the trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.c

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-24 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 246204. hliao added a comment. Rebase to the trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.c

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-26 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 246826. hliao added a comment. Rebase to the latest trunk. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/Pars

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-26 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. @rjmccall @rsmith @tra, could you review on this revision? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 ___ cfe-commits mailing list c

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-02-28 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 247248. hliao added a comment. Fix pre-merge checks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/Parse/ParseDecl.

[PATCH] D75423: [OpenCL] Mark pointers to constant address space as invariant

2020-03-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. invariant checking already takes account of loading from constant address space or memory (AA::pointsToConstantMemory), that's almost equivalent to adding invariant attributes. Why do we mark these constant loads with additional attributes? CHANGES SINCE LAST ACTION h

[PATCH] D75402: [HIP] Make sure, unused hip-pinned-shadow global var is kept within device code

2020-03-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. the assertion in addUsedGlobal should not be removed. that will remove the guard for potential bugs Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1919 void CodeGenModule::addUsedGlobal(llvm::GlobalValue *GV) { LLVMUsed.emplace_back(GV); -

[PATCH] D71227: [cuda][hip] Fix function overload resolution in the global initiailizer.

2020-03-02 Thread Michael Liao via Phabricator via cfe-commits
hliao updated this revision to Diff 247675. hliao added a comment. Remove unncessary condition checking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D71227/new/ https://reviews.llvm.org/D71227 Files: clang/include/clang/Sema/Sema.h clang/lib/

[PATCH] D75402: [HIP] Make sure, unused hip-pinned-shadow global var is kept within device code

2020-03-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:1919 void CodeGenModule::addUsedGlobal(llvm::GlobalValue *GV) { LLVMUsed.emplace_back(GV); hsmhsm wrote: > yaxunl wrote: > > hliao wrote: > > > This check should be removed complet

[PATCH] D75402: [HIP] Make sure, unused hip-pinned-shadow global var is kept within device code

2020-03-02 Thread Michael Liao via Phabricator via cfe-commits
hliao added a comment. BTW, why that variable cannot have an initializer? Suppose that initializer is a trivial one, initializing to 0, would that cause any issue in the compilation? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75402/new/ https:/

[PATCH] D69322: [hip][cuda] Enable extended lambda support on Windows.

2019-10-30 Thread Michael Liao via Phabricator via cfe-commits
hliao marked 3 inline comments as done. hliao added inline comments. Comment at: clang/include/clang/AST/MangleNumberingContext.h:57-58 + + /// Has device mangle numbering context. + virtual bool hasDeviceMangleNumberingContext() const { return false; } + rnk w

<    1   2   3   4   5   6   >