I recently imported the first working version of the Linear Scan Register Allocator for the OCaml Native Code Compiler ocamlopt into the linear-scan-register-allocator branch of my ocaml-experimental repository. The register allocator was implemented for ocamlopt by Marcell Fischbach as part of his diploma thesis. It presents a first step towards a (better) native OCaml toplevel ocamlnat. Use the following command to checkout the source code:

$ git clone -b linear-scan-register-allocator git://github.com/bmeurer/ocaml-experimental.git ocaml-linscan

The implementation of the linear scan register allocator can be found in asmcomp/interval.ml, asmcomp/interval.mli, asmcomp/linscan.ml and asmcomp/linscan.mli (integrated into ocamlopt via asmcomp/asmgen.ml).

Some initial timing results are available here, here, and here. See bug 5324 for additional details.