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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 7518F7FE53 for ; Thu, 10 Mar 2016 02:33:20 +0100 (CET) IronPort-PHdr: 9a23:US5Dox8ffD3aL/9uRHKM819IXTAuvvDOBiVQ1KB92uIcTK2v8tzYMVDF4r011RmSDdqdu60P0bqempujcFJDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXsq3G/pQQfBg/4fVIsYL+lRciC0I/th6ibwN76XUZhvHKFe7R8LRG7/036l/I9ps9cEJs30QbDuXBSeu5blitCLFOXmAvgtI/rpMYwuwwZgf8q9tZBXKPmZOx4COUAVHV1BVso/9XmvgXvSg6G531UEjlH00kAPw+QyRjgXYrq+g79qvZ5kH2fNNf1UKtyXDO+86NDRxrhiSNBPDk8pjL5kMt12ZNcvBuk7zZ22YjTccnBJf1id6bXdMkcQntpUcNYVigHCYS5OdhcR9EdNPpV+tGu72AFqgGzUEzxXe4= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=yotambarnoy@gmail.com; spf=Pass smtp.mailfrom=yotambarnoy@gmail.com; spf=None smtp.helo=postmaster@mail-yw0-f169.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of yotambarnoy@gmail.com) identity=pra; client-ip=209.85.161.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of yotambarnoy@gmail.com designates 209.85.161.169 as permitted sender) identity=mailfrom; client-ip=209.85.161.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="yotambarnoy@gmail.com"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-yw0-f169.google.com) identity=helo; client-ip=209.85.161.169; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="yotambarnoy@gmail.com"; x-sender="postmaster@mail-yw0-f169.google.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0DLAAAhzuBWkqmhVdFehA1tBqokkEOBbSGFbgKBQwc5EwEBAQEBAQEBEAEBAQEHCwsJIS+CLYIUAQEBAwESER0BFAcSCwEDAQsGAwILDQ0dAgIhAQERAQUBChIGExIQh2wBAwoIDpJej0GBMT4xizaBaoJXhU0KGScDClGDdAEBAQEBBQEBAQEBAQEBEgEFCgWGCYRCgj2CKoJTgToFhh0Mh32JEoVlhhmBdYIvjE6HEoYOER6BDw8TAYI1HoFuHi6JUwEBAQ X-IPAS-Result: A0DLAAAhzuBWkqmhVdFehA1tBqokkEOBbSGFbgKBQwc5EwEBAQEBAQEBEAEBAQEHCwsJIS+CLYIUAQEBAwESER0BFAcSCwEDAQsGAwILDQ0dAgIhAQERAQUBChIGExIQh2wBAwoIDpJej0GBMT4xizaBaoJXhU0KGScDClGDdAEBAQEBBQEBAQEBAQEBEgEFCgWGCYRCgj2CKoJTgToFhh0Mh32JEoVlhhmBdYIvjE6HEoYOER6BDw8TAYI1HoFuHi6JUwEBAQ X-IronPort-AV: E=Sophos;i="5.24,313,1454972400"; d="scan'208,217";a="206910428" Received: from mail-yw0-f169.google.com ([209.85.161.169]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 10 Mar 2016 02:33:19 +0100 Received: by mail-yw0-f169.google.com with SMTP id h129so55850344ywb.1 for ; Wed, 09 Mar 2016 17:33:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+aQVXFYWGGVfdawHMoYYviFore8sY+ddX1aqpgbj8UM=; b=hHY1yXXe7iOUqK8/fL8AIHN3QiFxTLNoyFyBfxTe/krsnJAGQkEV06FpQ3+0utwHFz 1laNdgy/Z97+cB1npY0D2VwwrrvrDpeyuoaI/JiKqyKawKYMR5xsZkw7rz9kpF6ylXKd IxUASI+kmjGTZo5GJBelcK+VZoq3Ho5wdzTmQEt81pQ9Cezydk2sa8+jZbo5k06XAq1H Z0FPgHA79fojHurHQq+VR6HIbrkNpgyr/jxfN2R7td1WYx/cVH8fcGldUteFcRTFXW7p z6KAMXOkU3y48skijx49aTd8PgvJUtPGrlMchsES5cqfvTCoZDYR9ODbVaozFx3gtm3A YrRQ== 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:from:date :message-id:subject:to:cc; bh=+aQVXFYWGGVfdawHMoYYviFore8sY+ddX1aqpgbj8UM=; b=aeu7iI+KdF/Tbmn05TzJYHwUQHgDQ6tCSISBhWOwMBaCoeywVGr5P7esqv3MDPpUYN Ep/aqQIURRGpn1pNm11hqftWkCi/+fNlNdIY7oq0ZZ46NUdk5AyfM8O02ESzuJ/JQlXT xmqhIVYEFKdJ0PONAtWzi61uxFNiiO/aYzZegLUd2NymSdJctXZHiETKr7KfWMRYHpbZ Bjj+5kwrAEHyMAFOHQFadJdj9t8rgHdcblF9UeuHx9NwY9NU/Grn1VVyAX8hZuOgFn89 SjwL6/u7XpO5MeIEbRVC4cZCEyb3yeZfem8UtZjoS77cmFH95LgWI1hKhFMmDPlPymh2 vIgA== X-Gm-Message-State: AD7BkJIbLuJuSx5t9Pni2Uum5/xRGLcTvW+6qtyhzP2XZv5m0w14IfmzNxB+lT+rShwE/NbGtL2OLGdm1UazFA== X-Received: by 10.13.237.132 with SMTP id w126mr490302ywe.211.1457573597851; Wed, 09 Mar 2016 17:33:17 -0800 (PST) MIME-Version: 1.0 Received: by 10.37.13.3 with HTTP; Wed, 9 Mar 2016 17:32:58 -0800 (PST) In-Reply-To: References: <56DF57FA.9070309@lexifi.com> From: Yotam Barnoy Date: Wed, 9 Mar 2016 20:32:58 -0500 Message-ID: To: Markus Mottl Cc: Mark Shinwell , Alain Frisch , OCaml List Content-Type: multipart/alternative; boundary=94eb2c08812888b746052da7cc70 Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 --94eb2c08812888b746052da7cc70 Content-Type: text/plain; charset=UTF-8 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 > --94eb2c08812888b746052da7cc70 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
While we await the manual, can you explain what you mean b= y 'enabled at configure time'? Will a -flambda -O-something argumen= t 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 l= ine options seems counter-intuitive (if this is the case).

-Yotam

On Wed, Mar 9, 2016 at 7:59 PM, Markus Mottl <markus.mottl@gmail.= com> wrote:
I've just t= ested 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).=C2=A0 I hope there will be a stable
4.03 OPAM switch that enables it.=C2=A0 I'm looking forward to being ab= le
to write more elegant, abstract code that's still efficient.

Regards,
Markus

On Wed, Mar 9, 2016 at 2:14 AM, Mark Shinwell <mshinwell@janestreet.com> wrote:
> It will not be enabled by default in 4.03.=C2=A0 For the majority of > programs, in the current state, it should improve performance (mainly<= br> > by lowering allocation).=C2=A0 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).=C2=A0 Amongst other things th= is
> documents what you found about the configure options and the flags'= ;
> operation.
>
> Mark
>
> On 9 March 2016 at 03:55, Markus Mottl <markus.mottl@gmail.com> wrote:
>> Hi Alain,
>>
>> I see, thanks.=C2=A0 It was a little confusing, because the comman= d line
>> options for tuning flambda were still available even without Flamb= da
>> being enabled.
>>
>> Will Flambda be enabled by default in OCaml 4.03 or is it still
>> considered to be too experimental?=C2=A0 It could turn out to beco= me 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 <alain.frisch@lexifi.com> wrote:
>>> Hi Markus,
>>>
>>> flambda needs to be enabled explicitly at configure time with = the "-flambda"
>>> flag.=C2=A0 The new optimizer will then be used unconditionall= y, 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.=C2=A0 But looking at the generated assembly= , it doesn't seem
>>>> to be doing much if anything on the simple test examples t= hat I
>>>> thought would benefit.
>>>>
>>>> To give an example of what I expected to see, lets conside= r this code:
>>>>
>>>> -----
>>>> let map_pair f (x, y) =3D f x, f y
>>>>
>>>> let succ x =3D x + 1
>>>> let map_pair_succ1 pair =3D map_pair succ pair
>>>> let map_pair_succ2 (x, y) =3D succ x, succ y
>>>> -----
>>>>
>>>> I would have thought that the "succ" function wo= uld be inlined in
>>>> "map_pair_succ1" as the compiler would do for &q= uot;map_pair_succ2".
>>>> But the generated code looks like this:
>>>>
>>>> -----
>>>> L101:
>>>>=C2=A0 =C2=A0 movq=C2=A0 %rax, %rdi
>>>>=C2=A0 =C2=A0 movq=C2=A0 %rdi, 8(%rsp)
>>>>=C2=A0 =C2=A0 movq=C2=A0 %rbx, (%rsp)
>>>>=C2=A0 =C2=A0 movq=C2=A0 8(%rbx), %rax
>>>>=C2=A0 =C2=A0 movq=C2=A0 (%rdi), %rsi
>>>>=C2=A0 =C2=A0 movq=C2=A0 %rdi, %rbx
>>>>=C2=A0 =C2=A0 call=C2=A0 *%rsi
>>>> L102:
>>>>=C2=A0 =C2=A0 movq=C2=A0 %rax, 16(%rsp)
>>>>=C2=A0 =C2=A0 movq=C2=A0 (%rsp), %rax
>>>>=C2=A0 =C2=A0 movq=C2=A0 (%rax), %rax
>>>>=C2=A0 =C2=A0 movq=C2=A0 8(%rsp), %rbx
>>>>=C2=A0 =C2=A0 movq=C2=A0 (%rbx), %rdi
>>>>=C2=A0 =C2=A0 call=C2=A0 *%rdi
>>>> -----
>>>>
>>>> Is Flambda supposed to work out of the box with the curren= t beta?
>>>> What flags or annotations should I use for testing?=C2=A0 = Any showcase
>>>> examples I should try out that are expected to be improved= ?
>>>>
>>>> Regards,
>>>> Markus
>>>>
>>>
>>
>>
>>
>> --
>> Markus Mottl=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.ocaml.info=C2= =A0 =C2=A0 =C2=A0 =C2=A0 markus.m= ottl@gmail.com
>>
>> --
>> Caml-list mailing list.=C2=A0 Subscription management and archives= :
>> https://sympa.inria.fr/sympa/arc/caml-list
>> Beginner's list: http://groups.yahoo.com/g= roup/ocaml_beginners
>> Bug reports: http://caml.inria.fr/bin/caml-bugs



--
Markus Mottl=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://www.ocaml.info=C2=A0 =C2=A0 = =C2=A0 =C2=A0 markus.mottl@gmail.= com

--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocam= l_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

--94eb2c08812888b746052da7cc70--