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 DE2C57FE53 for ; Thu, 10 Mar 2016 02:43:52 +0100 (CET) IronPort-PHdr: 9a23:hmDMPhP7PBT6NS/Chkwl6mtUPXoX/o7sNwtQ0KIMzox0KPXzrarrMEGX3/hxlliBBdydsKIbzbqJ+PqwEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxh7/5oc2bSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t/vQqALbQACTynwZW2QQ2loUUkmWpC39C6b2riL//sB0wi+dLIWiXLcoUDGo5r1tTw7AhyIONjp/+2bS3J9elqVe9TeovR9i2MbxZ52JMLIqe6rHfs4BA29GQtpVfyNEC4K4KYAICrxSbq5js4Dhqg5W/lOFDg62Cbaql2ZF Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=markus.mottl@gmail.com; spf=Pass smtp.mailfrom=markus.mottl@gmail.com; spf=None smtp.helo=postmaster@mail-oi0-f41.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of markus.mottl@gmail.com) identity=pra; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of markus.mottl@gmail.com designates 209.85.218.41 as permitted sender) identity=mailfrom; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="markus.mottl@gmail.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@mail-oi0-f41.google.com) identity=helo; client-ip=209.85.218.41; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="postmaster@mail-oi0-f41.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AOAgAh0eBWkinaVdFeg1k0Xg8GqFaBTpBDgW0hhW4CgUMHORMBAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBBBIRHQEUBxILAQMMBgULDQICCR0CAiEBAREBBQEKEgYTEhCHbAEDEg6iIIExPjGLNoFqgleFTAoZJwMKUYN0AQEBAQEBAQEBAQEBAQEBARQBBQoFbYUchEKCPYR9gToFhh0Mh32JEoFLhBqGGYF1gi+MTocShg4RHoEPIgOCMx6Bbh4uiVMBAQE X-IPAS-Result: A0AOAgAh0eBWkinaVdFeg1k0Xg8GqFaBTpBDgW0hhW4CgUMHORMBAQEBAQEBARABAQEBBwsLCSEvgi2CFQEBBBIRHQEUBxILAQMMBgULDQICCR0CAiEBAREBBQEKEgYTEhCHbAEDEg6iIIExPjGLNoFqgleFTAoZJwMKUYN0AQEBAQEBAQEBAQEBAQEBARQBBQoFbYUchEKCPYR9gToFhh0Mh32JEoFLhBqGGYF1gi+MTocShg4RHoEPIgOCMx6Bbh4uiVMBAQE X-IronPort-AV: E=Sophos;i="5.24,313,1454972400"; d="scan'208";a="167906514" Received: from mail-oi0-f41.google.com ([209.85.218.41]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Mar 2016 02:43:35 +0100 Received: by mail-oi0-f41.google.com with SMTP id c203so50195727oia.2 for ; Wed, 09 Mar 2016 17:43:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=HxzS1xVBWxnQKx6T5m9qez2Hq5acNQLJk/odRCNAWyw=; b=D6tLGUMuYM8D9dY/QAWfI14INBffk45BkqT/RK9s6Ap6PULu/wOE2aDgxkSw8/ouu6 adEPzc9NNg0iAizv6svpvfNTrv4cED1hhl61/r0KyS5ZkDp8+RtcmHVsX2P3y8LxUrit APEF5fsw6/DoP2sRb73BssqCTm6gB/rwBCCIqh3RAc3nE3rqNl90mAAf1XJRe5HVfp7W MzMwtu33SXbeLwHJM4OLxCkQK2NDw4vdBQVvI6hIOaK3r3OJjcOhZw09VyNUg9u+c1th El2wJlKfRHfjN5B11KeoK9RC4VFxH1pKPdOQDck/M2dr4ahVGe3onr3lv7Rj2ujv2eXr 4EUQ== 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=HxzS1xVBWxnQKx6T5m9qez2Hq5acNQLJk/odRCNAWyw=; b=B20xY9Q+jlwYVYOCphgPrM/nVHq5HbU3/Y6JOgrJJ2ENe29Qyzc3qPMi53zylJvyjw Tng6LhfpLvlFeYMofdWotvUFpQl/a/fatSqrqqLkxN2I8dH9cq7GpfHnN1oR9outKE4X Ywl8ypF7D/OPYIumSn3e3juiDh0LpRGtWWGCOHx2I78w1n1PGrbuD9vcdA2vhDB6adTC AWGJX+sWk4/iOyAIAVfWphy9MPNo+83QES8K5y8+nuybf1JsaYHwgWD0bY+8ZlvoMfJW YiwHAl+PZ2B2Y9I3tvc8UV/1BB3JdFfZlOvjR4ogr6PiP0MtOjv3zAsfKp2BJpr/ZHqe 997Q== X-Gm-Message-State: AD7BkJKptwDt8U18fl+KrcLZ1iNcnUw6nzgW6XgpX6BPxxRezx1Qix9jPizXtSNFGOxLl181a2XLoml0+tLMYA== MIME-Version: 1.0 X-Received: by 10.202.90.212 with SMTP id o203mr393555oib.117.1457574213400; Wed, 09 Mar 2016 17:43:33 -0800 (PST) Received: by 10.182.128.164 with HTTP; Wed, 9 Mar 2016 17:43:33 -0800 (PST) In-Reply-To: References: <56DF57FA.9070309@lexifi.com> Date: Wed, 9 Mar 2016 20:43:33 -0500 Message-ID: From: Markus Mottl To: Yotam Barnoy Cc: Mark Shinwell , Alain Frisch , OCaml List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 I agree with Yotam. Assuming that Flambda produces correct code and doesn't cause any serious performance issues either with the generated code or with excessive compile times, I'd prefer building it into the compiler by default. I'd be fine if I had to pass an extra flag at compile time to actually run Flambda optimizers, but it should at least be available. It doesn't have to be perfect to be useful. On Wed, Mar 9, 2016 at 8:32 PM, Yotam Barnoy wrote: > While we await the manual, can you explain what you mean by 'enabled at > configure time'? Will a -flambda -O-something argument passed to the normal > 4.03 compiler enable flambda optimizations? Flambda is clearly the star of > the 4.03 release, so not enabling it using command line options seems > counter-intuitive (if this is the case). > > -Yotam > > On Wed, Mar 9, 2016 at 7:59 PM, Markus Mottl wrote: >> >> I've just tested Flambda, and it seems to already be doing a pretty >> decent job on some non-trivial examples (e.g. inlining combinations of >> functors and first class functions). I hope there will be a stable >> 4.03 OPAM switch that enables it. I'm looking forward to being able >> to write more elegant, abstract code that's still efficient. >> >> Regards, >> Markus >> >> On Wed, Mar 9, 2016 at 2:14 AM, Mark Shinwell >> wrote: >> > 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 >> >> >> >> -- >> 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 > > -- Markus Mottl http://www.ocaml.info markus.mottl@gmail.com