I am proud to announce that AMD is Open Sourcing AMDIL Code Generator for LLVM 2.9. While this version is not for uptake into LLVM mainline, it does build and is compatible with LLVM 2.9. This is the first step of the process, so I know there will be issues that show up. In the next few months, we will be providing more unit tests and an LLVM 3.0 compatible version, and finally a TOT version for inclusion into the tree. I look forward to any constructive feedback and will as answer any questions that I can. For information on the sections of an AMD OpenCL binary, please refer here: http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=115 The attached zip file provides the code generator, a patch to LLVM 2.9 that adds the target triple, and a few tests. Again this version is not for submission into the tree, but for people to experiment, examine and provide feedback outside of AMD. Here are a list of the major known issues: LLVM-IR that isn't generated from AMD's OpenCL frontend does not produce any AMDIL. Testing is sparse(I'm working on it) No support for most OpenCL math functions. It is up to the library writers to map from OpenCL function calls to AMDIL intrinsic. Minor post processing of AMDIL is required for AMDIL source to be accepted by calclCompile/clBuildProgramFromBinary. The source is the documentation. Only supports compute shader generation. The output of the code generator is currently compatible with OpenCL 1.0/1.1 only when processing LLVM-IR from OpenCL binaries generated by AMD APP SDK 2.5 or later with the clBuildProgramSource options "-fbin-llvmir -fno-bin-amdil -fno-bin-exe". Enjoy, Micah Villmow OpenCL GPU Compiler Engineer AMD Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/ad81010a/attachment.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: AMDIL_code_generator.zip Type: application/x-zip-compressed Size: 486431 bytes Desc: AMDIL_code_generator.zip URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/ad81010a/attachment.bin>
For future reference, the zip file can also be downloaded from here: http://people.freedesktop.org/~tstellar/AMDIL_code_generator.zip From: llvmdev-bounces at cs.uiuc.edu [mailto:llvmdev-bounces at cs.uiuc.edu] On Behalf Of Villmow, Micah Sent: Monday, December 12, 2011 8:09 AM To: LLVM Developers Mailing List Subject: [LLVMdev] AMD IL Code Generator Backend for OpenCL I am proud to announce that AMD is Open Sourcing AMDIL Code Generator for LLVM 2.9. While this version is not for uptake into LLVM mainline, it does build and is compatible with LLVM 2.9. This is the first step of the process, so I know there will be issues that show up. In the next few months, we will be providing more unit tests and an LLVM 3.0 compatible version, and finally a TOT version for inclusion into the tree. I look forward to any constructive feedback and will as answer any questions that I can. For information on the sections of an AMD OpenCL binary, please refer here: http://developer.amd.com/support/KnowledgeBase/Lists/KnowledgeBase/DispForm.aspx?ID=115 The attached zip file provides the code generator, a patch to LLVM 2.9 that adds the target triple, and a few tests. Again this version is not for submission into the tree, but for people to experiment, examine and provide feedback outside of AMD. Here are a list of the major known issues: LLVM-IR that isn't generated from AMD's OpenCL frontend does not produce any AMDIL. Testing is sparse(I'm working on it) No support for most OpenCL math functions. It is up to the library writers to map from OpenCL function calls to AMDIL intrinsic. Minor post processing of AMDIL is required for AMDIL source to be accepted by calclCompile/clBuildProgramFromBinary. The source is the documentation. Only supports compute shader generation. The output of the code generator is currently compatible with OpenCL 1.0/1.1 only when processing LLVM-IR from OpenCL binaries generated by AMD APP SDK 2.5 or later with the clBuildProgramSource options "-fbin-llvmir -fno-bin-amdil -fno-bin-exe". Enjoy, Micah Villmow OpenCL GPU Compiler Engineer AMD Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111212/676eb161/attachment.html>
Daniels, Marcus G
2011-Dec-13 15:18 UTC
[LLVMdev] AMD IL Code Generator Backend for OpenCL
On Dec 12, 2011, at 9:09 AM, Villmow, Micah wrote: LLVM-IR that isn’t generated from AMD’s OpenCL frontend does not produce any AMDIL. Is this because of the way metadata is handled? If so, will that technique be documented? Or can it be reasonably inferred from the source code? Thanks, Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111213/a59aa103/attachment.html>
We are working on getting the documentation cleaned up to the point where it can be released. If you look at the test cases, you can infer what needs to be done. Basically since this is targeted for OpenCL, we annotate OpenCL kernels slightly different than normal functions and that is what causes the code to be generated. That being said, on my list of things to do is fix this so that any function will be generated correctly and also create calling conventions that differentiate between kernels and non-kernels. Micah From: Daniels, Marcus G [mailto:mdaniels at lanl.gov] Sent: Tuesday, December 13, 2011 7:19 AM To: Villmow, Micah Cc: LLVM Developers Mailing List Subject: Re: [LLVMdev] AMD IL Code Generator Backend for OpenCL On Dec 12, 2011, at 9:09 AM, Villmow, Micah wrote: LLVM-IR that isn't generated from AMD's OpenCL frontend does not produce any AMDIL. Is this because of the way metadata is handled? If so, will that technique be documented? Or can it be reasonably inferred from the source code? Thanks, Marcus -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20111213/bfa22f71/attachment.html>