2015-05-16 6:42 GMT+01:00 Chris Lattner <clattner at apple.com>:> > > On May 15, 2015, at 9:53 AM, Chris Bieneman <beanz at apple.com> wrote: > > > > +1 to lib/Target/SPIRV/(Reader|Writer) > > > > I really like this idea. I’ve talked with some people on both the LLVM and Khronos sides and I really think adding SPIR-V support to LLVM as an optional program serialization format would be fantastic. I think it would make it even easier for LLVM-based tools to be integrated into GPU authoring and execution pipelines. > > I’m not that familiar with SPIRV, but if it really is a serialization format, then why isn’t it a parallel to llvm/lib/Bitcode?+1 livm/lib/SPIRV like llvm/lib/Bitcode and addition of llvm instrinsics for SPIR-V.
Thanks all for the very helpful suggestions. In a sense, SPIR-V is like an alternative binary format for LLVM, since an LLVM bitcode can be converted to SPIR-V and vice versa. On the other hand, SPIR-V is like a target, since it can be consumed by OpenCL and Vulkan platform. I am thinking maybe the functionality of the bi-way conversion can be kept at llvm/lib/Bitcode/SPIRV, which will facilitate OpenCL vendors to do conversions between LLVM and SPIR-V. On the other hand, we create a llvm/Target/SPIR-V, which uses llvm/lib/Bitcode/SPIRV to generate SPIR-V. The SPIR-V target allows Clang and other LLVM front ends to target generic OpenCL/Vulkan platforms. Sam -----Original Message----- From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of jingu kang Sent: Saturday, May 16, 2015 6:03 AM To: Chris Lattner Cc: LLVM Developers Mailing List Subject: Re: [LLVMdev] [RFC] Upstreaming LLVM/SPIR-V converter 2015-05-16 6:42 GMT+01:00 Chris Lattner <clattner at apple.com>:> > > On May 15, 2015, at 9:53 AM, Chris Bieneman <beanz at apple.com> wrote: > > > > +1 to lib/Target/SPIRV/(Reader|Writer) > > > > I really like this idea. I’ve talked with some people on both the LLVM and Khronos sides and I really think adding SPIR-V support to LLVM as an optional program serialization format would be fantastic. I think it would make it even easier for LLVM-based tools to be integrated into GPU authoring and execution pipelines. > > I’m not that familiar with SPIRV, but if it really is a serialization format, then why isn’t it a parallel to llvm/lib/Bitcode?+1 livm/lib/SPIRV like llvm/lib/Bitcode and addition of llvm instrinsics for SPIR-V. _______________________________________________ LLVM Developers mailing list LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
2015-05-16 20:21 GMT+01:00 Liu, Yaxun (Sam) <Yaxun.Liu at amd.com>:> On the other hand, we create a llvm/Target/SPIR-V, which uses llvm/lib/Bitcode/SPIRV to generate SPIR-V. The SPIR-V target allows Clang and other LLVM front ends to target generic OpenCL/Vulkan platforms.it looks like Clang and other LLVM front ends generate LLVM IR for SPIR-V and llvm/Target/SPIR-V backend consumes it. I wonder whether SPIR-V needs its own optimization or something like that? If SPIR-V needs it, +1 llvm/Target/SPIR-V. but If not, why not directly use llvm/lib/Bitcode/SPIRV to write SPIR-V binary from front ends?
> On May 16, 2015, at 12:21 PM, Liu, Yaxun (Sam) <Yaxun.Liu at amd.com> wrote: > > I am thinking maybe the functionality of the bi-way conversion can be kept at llvm/lib/Bitcode/SPIRV, which will facilitate OpenCL vendors to do conversions between LLVM and SPIR-V. On the other hand, we create a llvm/Target/SPIR-V, which uses llvm/lib/Bitcode/SPIRV to generate SPIR-V. The SPIR-V target allows Clang and other LLVM front ends to target generic OpenCL/Vulkan platforms.I don’t think Chris was suggesting lib/Bitcode/SPIRV. That wouldn’t make a lot of sense, since Bitcode != SPIR-V. FWIW, I agree with Chris that it makes sense as a parallel to lib/Bitcode. SPIR-V is (almost) an alternate encoding of LLVM IR, with a few things added/removed, and it makes sense to treat it in a similar manner to our normal serialization format. —Owen -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150517/42a98623/attachment.html>