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 28A937FE53 for ; Thu, 10 Mar 2016 01:59:15 +0100 (CET) IronPort-PHdr: 9a23:H3OcZBDUV6EO7EOmcMZJUyQJP3N1i/DPJgcQr6AfoPdwSP/7pcbcNUDSrc9gkEXOFd2CrakU1KyG7Ou6CSQp2tWojjMrSNR0TRgLiMEbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpQAbFhi3DwdpPOO9QteU1JTokbDtsMeDKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ7djgTYVQaE+lcbV2wXlFIIX1mEv1nGWcLUuzH5/tF92S+FMMnyBeQxQjSj6bhmTBvAii4BOiUl6mzalop7i6cN8zy7oBkq5ofOY5yOfN95Yr/ZNYcfTHBCQ90XUitdHoeUYI4GDu5HNuFd+dqu72ASpAezUFH/TNjkzSVF0zqrhKA= 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-f43.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.43; 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.43 as permitted sender) identity=mailfrom; client-ip=209.85.218.43; 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-f43.google.com) identity=helo; client-ip=209.85.218.43; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="markus.mottl@gmail.com"; x-sender="postmaster@mail-oi0-f43.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AcAgBrxuBWiyvaVdFeg1k0bQaoVoFOkEOBbSGFbgKBQgc6EgEBAQEBAQEBEAEBAQgLCwkfMYItghUBAQQSER0BFAcSCwEDDAYFCwMKAgIJHQICIQEBEQEFAQoSBhMIChCHbAEDEg6iKYExPjGLNoFqgleFTAoZJwMKUYN0AQEBAQEBAQECAQEBAQEBFAEFCgVthRyEQoI9hH2BOgWGHQyHfYkSgUuEGoYZgXWCL4xOhxKGDhEegQ8nAYIwHoFuHi6JUwEBAQ X-IPAS-Result: A0AcAgBrxuBWiyvaVdFeg1k0bQaoVoFOkEOBbSGFbgKBQgc6EgEBAQEBAQEBEAEBAQgLCwkfMYItghUBAQQSER0BFAcSCwEDDAYFCwMKAgIJHQICIQEBEQEFAQoSBhMIChCHbAEDEg6iKYExPjGLNoFqgleFTAoZJwMKUYN0AQEBAQEBAQECAQEBAQEBFAEFCgVthRyEQoI9hH2BOgWGHQyHfYkSgUuEGoYZgXWCL4xOhxKGDhEegQ8nAYIwHoFuHi6JUwEBAQ X-IronPort-AV: E=Sophos;i="5.24,313,1454972400"; d="scan'208";a="167903611" Received: from mail-oi0-f43.google.com ([209.85.218.43]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Mar 2016 01:59:13 +0100 Received: by mail-oi0-f43.google.com with SMTP id c203so49561082oia.2 for ; Wed, 09 Mar 2016 16:59:13 -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=ABWkwNWhSNT/9XnV1hwlCb/niafrcfe+b24PITsZplY=; b=D/+waqAeMdKv0Brr9X17kB1NkFRWOpVMF5f0NlZDdvkpcJ4D88Fz+Q0m93+3ooYi/1 zBUnj1q5CG0CP1eadFhvU3GgiGuyAU5wAiYpSBYBmhmam+dvjcc6cTx5eEPQR5COF87N KoCoalYL180rOp1gdbCcNSWjOMiKfVhNCB5JyDlZIeJCXONBD7TR+HECJjlQuCRE6sTA HAePai8AvsQAg3Kf4+n5EUI5jsDVhZ4r8Ia4tC7MlxAybb0PVni4Y2tP0EhGFTPuwwAp tsDMEL30uoJnBd01yHFjvJxSugfR9WDb0tZQdsSQIljLUTE3DNwaSHO/orPXyz3h+pzb NZ/Q== 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=ABWkwNWhSNT/9XnV1hwlCb/niafrcfe+b24PITsZplY=; b=MpqUxb4+DZCg8/osBZYknRnwbwnayB/sz2eBao5+nd3e7NCnw2j7DOsXoGg/EGl8Uz VTa1tmL/Z+BSpKehXyj90efYyd9SOIP/bCNGB03SEJs9cT7rDZseSswrHcFBkoui9iWM SHQz+vjmZks1xa6yBO7a87lMlve/e4kvQyaJ9guAtIsssLkk1xCk/NltVU2EdN9pXV5c LBIiAZSYLVlnCBOxXLNkVFl95TYp03h1LVfp5N81CtLyxKB1qE5xibJ0spOrAdsli39S zr9v3Hivvl+bpBV5HLFrEptYOJCoZTjvl4VYasuUnqKA0ugXIH35+H+MHbDTAUEWNveh qKmA== X-Gm-Message-State: AD7BkJL9DX/ebNs7JwUTUlC9QLr/WQHhpwKo5DrgtnyUH5QaSX9oz+AtUNkd6cDxcIbKGcfE2ugMoB0i6SLNkg== MIME-Version: 1.0 X-Received: by 10.202.90.212 with SMTP id o203mr319314oib.117.1457571552346; Wed, 09 Mar 2016 16:59:12 -0800 (PST) Received: by 10.182.128.164 with HTTP; Wed, 9 Mar 2016 16:59:12 -0800 (PST) In-Reply-To: References: <56DF57FA.9070309@lexifi.com> Date: Wed, 9 Mar 2016 19:59:12 -0500 Message-ID: From: Markus Mottl To: Mark Shinwell Cc: Alain Frisch , OCaml List Content-Type: text/plain; charset=UTF-8 Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 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