From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.4 required=5.0 tests=HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 9B161BBAF for ; Sat, 6 Dec 2008 13:48:29 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AnABAE8DOklIDszgjWdsb2JhbACCcJAiPgEBAQEJCQoJDwWuCIszAQQ X-IronPort-AV: E=Sophos;i="4.33,724,1220220000"; d="scan'208";a="20001607" Received: from qb-out-0506.google.com ([72.14.204.224]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Dec 2008 13:48:28 +0100 Received: by qb-out-0506.google.com with SMTP id q18so401888qba.43 for ; Sat, 06 Dec 2008 04:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to :subject:mime-version:content-type; bh=nYKk/6xfCmhF28YPqZe7fthsjNIBIdy3ulsAI6NCiSs=; b=hu4eHfEBhepBUs1S8gWSVysFoGUq1YxXglbaUYafkCAyODkg2ckoy8rPSghJAXKbHK q3VzP9DWjTcjtmlAzac0VYi/g6Bo2mTjrSZY4mGchy8trcbtYXFniviSkGpfJmbc7XeA m6B4jruGu6lig/yfZBzri8POrqY9RG6YQmXb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=cklS8EvbvXitGiKSwAg8q2ICSfRAo1xDyS92vtX37ZrXzCaFEBzydKUIzsYcQcq1FL rwGkoCsA+lAwPe/pvhRxnv2MCcHz4caxzSVz4AS4P53Ui84/S2UJDpxAqDVlymxK7TyF j/byVW3+6FSp2Xrv+11gfF1p8lDmUxcl7rCzs= Received: by 10.142.50.15 with SMTP id x15mr504472wfx.80.1228567707812; Sat, 06 Dec 2008 04:48:27 -0800 (PST) Received: by 10.142.200.1 with HTTP; Sat, 6 Dec 2008 04:48:27 -0800 (PST) Message-ID: <605bf2750812060448u787862c9xdc2528cb61bc01d7@mail.gmail.com> Date: Sat, 6 Dec 2008 12:48:27 +0000 From: "Gilles Pirio" To: caml-list@yquem.inria.fr Subject: Ocaml back-end MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_3301_918721.1228567707806" X-Spam: no; 0.00; ocaml:01 ocaml:01 ocamlopt:01 ocamlopt:01 compiler:01 trivial:01 inlining:01 cvs:01 compiler:01 trivial:01 inlining:01 cvs:01 collateral:98 collateral:98 short:01 ------=_Part_3301_918721.1228567707806 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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. camlA__matchdtree_63(R/0[%eax]) { + R/0[%eax]} a/8 := R/0[%eax] {a/8*} i/9 := 1 {a/8* i/9} catch {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? Thanks, G<> ------=_Part_3301_918721.1228567707806 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline 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.

camlA__matchdtree_63(R/0[%eax])
  { + R/0[%eax]}
  a/8 := R/0[%eax]
  {a/8*}
  i/9 := 1
  {a/8* i/9}
  catch
    {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?

Thanks,
G<>
------=_Part_3301_918721.1228567707806--