Inching towards an LLVM backend

Several months ago, I started working again on Campy. Since then, I’ve had to rewrite quite a bit of the source in order to make use of LLVM for code generation. So, Campy can now compile and execute a good subset for an x86/x64 target, which is a small but important step towards the goal of executing C# on a GPU. A significant part of the work was simply exposing a C# wrapper library for LLVM. That wrapper class targets Windows, Ubuntu, and Android, which as far as I can tell surpasses anything offered in NuGet. That library is Swigged.llvm, which you can find here.

The next few steps are to refine the compiler further and to target a NVIDIA GPU. In addition, I will need to write a layer to expose the SSA analysis in LLVM in order to take advantage of that to determine what functions/methods must be compiled for the GPU. There is much work to be done, but it is worth the effort.

Leave a Reply

Your email address will not be published. Required fields are marked *

This blog is kept spam free by WP-SpamFree.