[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] 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 Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Comment at: test/CodeGenOpenCL/blocks.cl:30 + // COMMON: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 }>, <{ i32,

[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] 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-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia 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::fromQuantity( remove one

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

2017-09-22 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 116363. yaxunl edited the summary of this revision. yaxunl added a comment. Add custom fields to block and target hooks to fill them. https://reviews.llvm.org/D37822 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRu

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

2017-09-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl added a comment. In https://reviews.llvm.org/D37822#877903, @Anastasia wrote: > In https://reviews.llvm.org/D37822#877572, @yaxunl wrote: > > > In https://reviews.llvm.org/D37822#873876, @Anastasia wrote: > > > > > In https://reviews.llvm.org/D37822#872446, @yaxunl wrote: > > > > > > > In

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

2017-09-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 116277. yaxunl marked 6 inline comments as done. yaxunl added a comment. Revise by Anastasia's comments. https://reviews.llvm.org/D37822 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRuntime.h test/CodeGen/blocks

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

2017-09-21 Thread Brian Sumner via Phabricator via cfe-commits
b-sumner added a comment. In https://reviews.llvm.org/D37822#877903, @Anastasia wrote: > In https://reviews.llvm.org/D37822#877572, @yaxunl wrote: > > > In https://reviews.llvm.org/D37822#873876, @Anastasia wrote: > > > > > In https://reviews.llvm.org/D37822#872446, @yaxunl wrote: > > > > > > > I

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

2017-09-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D37822#877572, @yaxunl wrote: > In https://reviews.llvm.org/D37822#873876, @Anastasia wrote: > > > In https://reviews.llvm.org/D37822#872446, @yaxunl wrote: > > > > > In https://reviews.llvm.org/D37822#872291, @Anastasia wrote: > > > > > > >

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

2017-09-21 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 4 inline comments as done. yaxunl added a comment. In https://reviews.llvm.org/D37822#873876, @Anastasia wrote: > In https://reviews.llvm.org/D37822#872446, @yaxunl wrote: > > > In https://reviews.llvm.org/D37822#872291, @Anastasia wrote: > > > > > Could you please explain a bit mor

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

2017-09-18 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D37822#872446, @yaxunl wrote: > In https://reviews.llvm.org/D37822#872291, @Anastasia wrote: > > > Could you please explain a bit more why the alignment have to be put > > explicitly in the struct? I am just not very convinced this is genera

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

2017-09-15 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl marked 2 inline comments as done. yaxunl added a comment. In https://reviews.llvm.org/D37822#872291, @Anastasia wrote: > Could you please explain a bit more why the alignment have to be put > explicitly in the struct? I am just not very convinced this is general enough. The captured var

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

2017-09-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Could you please explain a bit more why the alignment have to be put explicitly in the struct? I am just not very convinced this is general enough. Comment at: lib/CodeGen/CGBlocks.cpp:314 assert(elementTypes.empty()); - elementTypes.push_back(

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

2017-09-14 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl updated this revision to Diff 115222. yaxunl added a comment. Fix bug about calling blocks. https://reviews.llvm.org/D37822 Files: lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGOpenCLRuntime.cpp lib/CodeGen/CGOpenCLRuntime.h test/CodeGen/blocks-opencl.cl test/CodeGenOpenCL/blocks.cl

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

2017-09-13 Thread Yaxun Liu via Phabricator via cfe-commits
yaxunl created this revision. Currently block is translated to a structure equivalent to struct Block { void *isa; int flags; int reserved; void *invoke; void *descriptor; }; Except `invoke`, which is the pointer to the block invoke function, all other fields are useless