From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id AF1617FE53 for ; Wed, 9 Mar 2016 08:14:25 +0100 (CET) IronPort-PHdr: 9a23:LYV1/RGgHWJdutao1unNS51GYnF86YWxBRYc798ds5kLTJ74p86wAkXT6L1XgUPTWs2DsrQf27WQ4/2rCD1IyK3CmU5BWaQEbwUCh8QSkl5oK+++Imq/EsTXaTcnFt9JTl5v8iLzG0FUHMHjew+a+SXqvnYsExnyfTB4Ov7yUtaLyZ/niKbiptaCMk1hv3mUX/BbFF2OtwLft80b08NJC50a7V/3mEZOYPlc3mhyJFiezF7W78a0+4N/oWwL46pyv+YJa6jxfrw5QLpEF3xmdjltvIy4gyLeVhOC7WcwVWAfkxwAQ1SUrUKyYpCklyLgtfdmkAydIdHyBeQxUC6h8rwtTRj0lCMvODsw8WWRgct12vF1uhWk8jl22Y2cW4GUMuVzeqeVKdYBRWtHQctVUwRDC4WxdJcVAucde+1fqt+u9BM1sRKiCFz0V6vUwThSiyqzgPQ3 Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=mshinwell@janestreet.com; spf=Pass smtp.mailfrom=mshinwell@janestreet.com; spf=None smtp.helo=postmaster@mxout1.mail.janestreet.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of mshinwell@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of mshinwell@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0D5AAD6zN9WjnDIaSZchAxtBqoskiwXCoVuAoE7BzwQAQEBAQEBAQEQAQEBAQcWCVCCLYIVAQEEEhEdAQETGQsBDwsLDQICCR0CAiEBEgEFAQoSBhMSEIdtAxIDC6IdgTE+MYpPZ4RBAQSGEwMKhEkBAQEBAQEBAQIBAQEBAQEBAQERBgpxhRyEQoI9hEULLROBJ4YiDJEGhWWGF4F1gi+MTIcPhg0RHoEPN4IhHoFQaolTAQEB X-IPAS-Result: A0D5AAD6zN9WjnDIaSZchAxtBqoskiwXCoVuAoE7BzwQAQEBAQEBAQEQAQEBAQcWCVCCLYIVAQEEEhEdAQETGQsBDwsLDQICCR0CAiEBEgEFAQoSBhMSEIdtAxIDC6IdgTE+MYpPZ4RBAQSGEwMKhEkBAQEBAQEBAQIBAQEBAQEBAQERBgpxhRyEQoI9hEULLROBJ4YiDJEGhWWGF4F1gi+MTIcPhg0RHoEPN4IhHoFQaolTAQEB X-IronPort-AV: E=Sophos;i="5.24,310,1454972400"; d="scan'208";a="167753649" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 09 Mar 2016 08:14:24 +0100 Received: from tot-qpr-mailcore1.delacy.com ([172.27.56.68] helo=tot-qpr-mailcore1) by mxout1.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1adYK7-0001kx-2n for caml-list@inria.fr; Wed, 09 Mar 2016 02:14:23 -0500 X-JS-Flow: external Received: by tot-qpr-mailcore1 with JS-mailcore (0.1) (envelope-from ) id BW381P-AAAAl6-Av; 2016-03-09 02:14:23.024742-05:00 Received: from mail-ob0-f181.google.com ([209.85.214.181]) by mxgoog1.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1adYK6-0001e8-S8 for caml-list@inria.fr; Wed, 09 Mar 2016 02:14:22 -0500 Received: by mail-ob0-f181.google.com with SMTP id m7so38181912obh.3 for ; Tue, 08 Mar 2016 23:14:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=pIOQNr+fL0zavYn2M3XfYkcbITJSSjlHAxrwoRtwuOs=; b=ZuJVOPTeZw2qrQ1Zr9rMjIBGDDx8LvLUqYEX99wcBJjX4vQ62SMWhSIuOFqr0k4xaa 6DlS/1tFZKew/i55NhZHEBqH1SgsOgYhK6foH2yuGCH6QwruvCgwhPrJKj8Mctzm+lY/ HD7b0aoWw1UEHbsv4z94TghFd5IXDQ1TQAkfo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=pIOQNr+fL0zavYn2M3XfYkcbITJSSjlHAxrwoRtwuOs=; b=Pbq+KJU564H/3fPsYThyt26MacSqFpWTDiwZuNhfrOO7+1cu11iY+8+zqWDSDEERPd k0pn8lBTh7bl9OEd7h9mt5oD3LWoajbjuekh71dHLV644EwInj1nEIgLa1UKLnqiAQ+l HXMisQk39S+oNSkozV6dssusICL/6Anbhti7wqDbQ7+v5QYwqriLhtSHitbCCgjePIHl FcEfyQdd6ucngBFH/BPZt7kc77sSBtckKn8PrNYL5VIl493SSaAuAD0IoyYon6p+NyxC dMWTPaDpH94YHwj/K3BEEC7y60ROXGx/Y5H55O8k68FLzoMOp+Ck/ZNuElc0yVPr6hkn Z2tA== X-Gm-Message-State: AD7BkJKd/Oexqpqp4PYg/R6EWj2WyW7dAhss0aXKIWhd+47NNW5ve7uM5G4CFfA/OcCcrj1Qrat13nv953eVath9cblgtKQOQT/zCWAF/is8ra8CvjyMIiEBS3RjU3MKPQUU3M36y5EVYNTFfvpQ X-Received: by 10.60.63.210 with SMTP id i18mr15927198oes.44.1457507662457; Tue, 08 Mar 2016 23:14:22 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.60.63.210 with SMTP id i18mr15927194oes.44.1457507662354; Tue, 08 Mar 2016 23:14:22 -0800 (PST) Received: by 10.202.216.214 with HTTP; Tue, 8 Mar 2016 23:14:22 -0800 (PST) In-Reply-To: References: <56DF57FA.9070309@lexifi.com> Date: Wed, 9 Mar 2016 07:14:22 +0000 Message-ID: From:Mark Shinwell To:Markus Mottl Cc:Alain Frisch , OCaml List Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore X-Validation-by: mshinwell@janestreet.com Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 It will not be enabled by default in 4.03. For the majority of programs, in the current state, it should improve performance (mainly by lowering allocation). It should never generate wrong code. However we know of examples that don't improve as much as we would like, which we will try to address for 4.04. There will be a draft version of the new Flambda manual chapter available shortly (hopefully this week). Amongst other things this documents what you found about the configure options and the flags' operation. Mark On 9 March 2016 at 03:55, Markus Mottl wrote: > Hi Alain, > > I see, thanks. It was a little confusing, because the command line > options for tuning flambda were still available even without Flambda > being enabled. > > Will Flambda be enabled by default in OCaml 4.03 or is it still > considered to be too experimental? It could turn out to become one of > the most impactful new features in terms of how I write code. > > Regards, > Markus > > On Tue, Mar 8, 2016 at 5:53 PM, Alain Frisch wrote: >> Hi Markus, >> >> flambda needs to be enabled explicitly at configure time with the "-flambda" >> flag. The new optimizer will then be used unconditionally, and you can >> tweak it using command-line parameters passed to ocamlopt (see "ocamlopt >> -h"). >> >> >> Alain >> >> >> On 08/03/2016 23:10, Markus Mottl wrote: >>> >>> Hi, >>> >>> I'm trying out OCaml 4.03.0+beta1 right now and wanted to test Flambda >>> optimizations. But looking at the generated assembly, it doesn't seem >>> to be doing much if anything on the simple test examples that I >>> thought would benefit. >>> >>> To give an example of what I expected to see, lets consider this code: >>> >>> ----- >>> let map_pair f (x, y) = f x, f y >>> >>> let succ x = x + 1 >>> let map_pair_succ1 pair = map_pair succ pair >>> let map_pair_succ2 (x, y) = succ x, succ y >>> ----- >>> >>> I would have thought that the "succ" function would be inlined in >>> "map_pair_succ1" as the compiler would do for "map_pair_succ2". >>> But the generated code looks like this: >>> >>> ----- >>> L101: >>> movq %rax, %rdi >>> movq %rdi, 8(%rsp) >>> movq %rbx, (%rsp) >>> movq 8(%rbx), %rax >>> movq (%rdi), %rsi >>> movq %rdi, %rbx >>> call *%rsi >>> L102: >>> movq %rax, 16(%rsp) >>> movq (%rsp), %rax >>> movq (%rax), %rax >>> movq 8(%rsp), %rbx >>> movq (%rbx), %rdi >>> call *%rdi >>> ----- >>> >>> Is Flambda supposed to work out of the box with the current beta? >>> What flags or annotations should I use for testing? Any showcase >>> examples I should try out that are expected to be improved? >>> >>> Regards, >>> Markus >>> >> > > > > -- > Markus Mottl http://www.ocaml.info markus.mottl@gmail.com > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs