(Machine) code generation experiments in Python, roughly centered around LLVM IR
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
tests
.gitignore
README
adot2dot
clang2llvm
dot.py
graph.py
graph_color.py
interference.py
liveness.py
llvm2c.py
llvm2exe
llvm2icode.py
llvm2py.py
parse.py
phi_resolver.py
pllvm.py
reg_alloc.py
reg_alloc_old_draft.py
run-tests.sh
run.sh

README

The ultimate goal of this project is to make it easy to develop a
code generation backend in Python for an arbitrary CPU, taking LLVM IR
as input.

However, the code is currently very far away from that aim, and just
contains some hacks towards:

1. Graph-based register allocation.
2. Parsing LLVM IR into Python-native objects, with output support,
aiming towards 100% roundtrip.
3. Utilities to transform LLVM encoded as Python objects, for example,
converting out of SSA form.

These separate features are not 100% complete either, so it may be useful:

1. As a starting base if you wanted to do something similar (I wish I
hadn't had to start from scratch myself).
2. As an example for llvmpy (http://llvmpy.org) usage.


See also: https://github.com/pfalcon/graph-llvm-ir