English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
Ocaml back-end
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2008-12-06 (12:48)
From: Gilles Pirio <gilles.ocaml@g...>
Subject: Ocaml back-end
NOTE: sorry for double posting but I've been informed that my initial post
(in google group - I usually read the group from there) would not be
forwarded to the caml list as I naively thought...


Hi all

I've been busy changing/implementing (new) passes in ocamlopt back-end
for my own target. A collateral of that is that it improves the
generated code for x86 -- ocamlopt is great but isn't exactly an
optimizing compiler :) Simple constant propagation and invariant code
motion sometimes doesn't happen. Below is trivial example -- the if i/
9 >s 201 test may be removed at some stage. I've seen lots of things
like it. This generates inefficient code (on x86 and ARM at least).
I've had up to 30% speed improvement. Of course, the speed can also be
improved by modifying the Ocaml code itself, so I'm not claiming what
I've done is a major improvement at all.

  { + R/0[%eax]}
  a/8 := R/0[%eax]
  i/9 := 1
  {a/8* i/9}
    {a/8* i/9 + i/9}
    if i/9 >s 201 then

Short questions --
(1) Any optimizing option I would be unaware of? Inlining option
doesn't help much.
(2) Any way to contribute this work back to Ocaml community (on a
separate cvs branch?) or is this kind of work planned by the core
Ocaml team?