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 8864E7FF9F for ; Tue, 8 Mar 2016 23:53:45 +0100 (CET) IronPort-PHdr: 9a23:HcX7LR0XajPkKgYYsmDT+DRfVm0co7zxezQtwd8ZsekWIvad9pjvdHbS+e9qxAeQG96LtLQU1qL/iOPJZy8p2d65qncMcZhBBVcuqP49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL2PbrnD61zMOABK3bVMzfbSqXN6Px+2MlMmMuLTrKz1SgzS8Zb4gZD6Xli728vcsvI15N6wqwQHIqHYbM85fxGdvOE7B102kvpT41NdZ/i9Ro/Ms8dJbGeW/JvxgDO8QMDNzFmkv59Dw/TzEUReLri8ZW38VjwEOBg/Z8BXSUZL4sy+8ve14jm3SGub/SLR8fTW58+8/QxbtjGIDNiUl2GDRkM15yqxB9kGPvRt6lqfQaYCTfNRkf7jWfZtOTG5IX8AXWTZAGYi8R48CH+sPPKBTqIyr9AhGlge3GQT5XLCn8TRPnHKjmPRii+k= Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=alain.frisch@lexifi.com; spf=None smtp.mailfrom=alain.frisch@lexifi.com; spf=None smtp.helo=postmaster@mx20.yaziba.net Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mx20.yaziba.net) identity=helo; client-ip=85.233.204.164; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="postmaster@mx20.yaziba.net"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0AJAQCtVt9Wk6TM6VVcwUKGDwKBRTwQAQEBAQEBAQEQAQEBAQkLCQkhL4ItghUBAQQjFUARCxgCAgUWCwICCQMCAQIBRQYBDAgBAYgkr1+PIwEBCAEBAQEce4UchEKHOoE6BZcqgUqMJIkqhVGOVAI3gj+BUYpoAQEB X-IPAS-Result: A0AJAQCtVt9Wk6TM6VVcwUKGDwKBRTwQAQEBAQEBAQEQAQEBAQkLCQkhL4ItghUBAQQjFUARCxgCAgUWCwICCQMCAQIBRQYBDAgBAYgkr1+PIwEBCAEBAQEce4UchEKHOoE6BZcqgUqMJIkqhVGOVAI3gj+BUYpoAQEB X-IronPort-AV: E=Sophos;i="5.22,558,1449529200"; d="scan'208";a="206687533" Received: from mx20.yaziba.net ([85.233.204.164]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 08 Mar 2016 23:53:45 +0100 Received: from mta20.int.yaziba.net (mta20.int.yaziba.net [10.4.20.31]) by mx20.yaziba.net (mx10.yaziba.net) with ESMTP id 5918E1A75EE; Tue, 8 Mar 2016 23:53:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTP id 969DBCA683; Tue, 8 Mar 2016 23:53:44 +0100 (CET) X-Virus-Scanned: amavisd-new at mta20.int.yaziba.net Received: from mta20.int.yaziba.net ([127.0.0.1]) by localhost (mta20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id o1abWAIyBvp0; Tue, 8 Mar 2016 23:53:44 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta20.int.yaziba.net (Postfix) with ESMTP id 78327CA762; Tue, 8 Mar 2016 23:53:44 +0100 (CET) X-Virus-Scanned: amavisd-new at mta20.int.yaziba.net Received: from mta20.int.yaziba.net ([127.0.0.1]) by localhost (mta20.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Q-xRJo6a_1WA; Tue, 8 Mar 2016 23:53:44 +0100 (CET) Received: from [192.168.1.13] (LFbn-1-535-219.w86-245.abo.wanadoo.fr [86.245.27.219]) by mta20.int.yaziba.net (Postfix) with ESMTPSA id 56E98CA683; Tue, 8 Mar 2016 23:53:44 +0100 (CET) To: Markus Mottl , OCaml List References: From: Alain Frisch Message-ID: <56DF57FA.9070309@lexifi.com> Date: Tue, 8 Mar 2016 23:53:46 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-DRWEB-SCAN: ok X-VRSPAM-SCORE: -100 X-VRSPAM-STATE: legit X-VRSPAM-CAUSE: gggruggvucftvghtrhhoucdtuddrfeekjedrkeehgddthecutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpjgetkgfkueetnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjegrtddtfeejnecuhfhrohhmpeetlhgrihhnucfhrhhishgthhcuoegrlhgrihhnrdhfrhhishgthheslhgvgihifhhirdgtohhmqeenucfkphepkeeirddvgeehrddvjedrvdduleenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Status of Flambda in OCaml 4.03 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 >