An LLVM backend for Sparse
[Posted August 29, 2011 by corbet]
| From: |
| Pekka Enberg <penberg-AT-kernel.org> |
| To: |
| linux-sparse-AT-vger.kernel.org |
| Subject: |
| [ANNOUNCE] LLVM backend for Sparse |
| Date: |
| Sun, 28 Aug 2011 09:08:40 +0300 (EEST) |
| Message-ID: |
| <alpine.DEB.2.00.1108280904070.7603@localhost6.localdomain6> |
| Cc: |
| Christopher Li <sparse-AT-chrisli.org>, Jeff Garzik <jeff-AT-garzik.org>,
Linus Torvalds <torvalds-AT-linux-foundation.org>,
Josh Triplett <josh-AT-joshtriplett.org> |
| Archive‑link: | |
Article |
Hi everyone,
Jeff Garzik and myself have been hacking on LLVM backed for Sparse. The sources
are available on Github:
git clone git://github.com/penberg/sparse-llvm.git
You can use sparse-llvm with the 'sparsec' shells script provided in the source
tree. It has a GCC compatible command line interface and uses GCC for linking.
For example, you can try to build sparse with sparse-llvm like this:
make CC=sparsec
Developers who are interested in looking at the LLVM output can use the
'sparse-llvm' command as follows:
sparse-llvm foo.c | llvm-dis
The backend is already capable of generating code for simple C code on various
platforms. Supported C features include:
* Function calls
* Switch statements
* if-else statements
* Arithmetic operations
* Bitwise operations
* Floating point arithmetic
There's many features that are not supported so if you see an error message
such as this while compiling a C file:
sparse-llvm: sparse-llvm.c:165: pseudo_type: Assertion `0' failed.
don't panic because it simply means you're attempting to use an unsupported
feature. Help implementing them is more than welcome!
Pekka
--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html