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 83DDB7F026 for ; Fri, 11 Mar 2016 10:09:53 +0100 (CET) IronPort-PHdr: 9a23:WsTRORKrf9hyKulw/9mcpTZWNBhigK39O0sv0rFitYgVKPvxwZ3uMQTl6Ol3ixeRBMOAu60C27qd6f+xEUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxh7D5ocKCKyxzxxODIppKZC2sqgvQssREyaBDEY0WjiXzn31TZu5NznlpL1/A1zz158O34YIxu38I46Fp34d6XK77Z6U1S6BDRHRjajhtpZ6jiR6WaAKV5TMnUmQQjRdMB0CR6Qr6X5Huvy/+nuh03iSBIdf7QKxyUjOnueMjZxLyhG88Kzk96GTejMo42KNdrhWJqBFlz8vPfIaRLP93eKWbcd5MFkRbWcMEfihIA4X0QZEOFOEBdbJRq4D8oR0AtxqlDgmEAO7/yzFJwHTx2PtpgKwaDQja0Vl4TJo1u3POoYCwbf9KXA== Authentication-Results: mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=pra; client-ip=85.233.204.164; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of alain.frisch@lexifi.com) identity=mailfrom; client-ip=85.233.204.164; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="alain.frisch@lexifi.com"; x-sender="alain.frisch@lexifi.com"; x-conformance=sidf_compatible Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mx20.yaziba.net) identity=helo; client-ip=85.233.204.164; receiver=mail3-smtp-sop.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: A0CaAADoiuJWk6TM6VVevRWEDoYPAoE1PBABAQEBAQEBARABAQEBCQsJCSEvgi2CFQEBBCMVQAEQCw4KAgIFFgsCAgkDAgECAUUGAQwIAQGIJK5bjx4BAQEBAQUBAQEBAQEafIUchEKHOoE6BZdDgU+MLYkvhVOObwI3gj+BUYs6AQEB X-IPAS-Result: A0CaAADoiuJWk6TM6VVevRWEDoYPAoE1PBABAQEBAQEBARABAQEBCQsJCSEvgi2CFQEBBCMVQAEQCw4KAgIFFgsCAgkDAgECAUUGAQwIAQGIJK5bjx4BAQEBAQUBAQEBAQEafIUchEKHOoE6BZdDgU+MLYkvhVOObwI3gj+BUYs6AQEB X-IronPort-AV: E=Sophos;i="5.24,320,1454972400"; d="scan'208";a="168140386" Received: from mx20.yaziba.net ([85.233.204.164]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/ADH-AES256-SHA; 11 Mar 2016 10:09:52 +0100 Received: from mta10.int.yaziba.net (mta10.int.yaziba.net [10.4.20.30]) by mx20.yaziba.net (mx10.yaziba.net) with ESMTP id 05DC51A76D9; Fri, 11 Mar 2016 10:09:52 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id 18994CA67B; Fri, 11 Mar 2016 10:09:52 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id egUorUMvHekO; Fri, 11 Mar 2016 10:09:51 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mta10.int.yaziba.net (Postfix) with ESMTP id D4EC31389C4; Fri, 11 Mar 2016 10:09:51 +0100 (CET) X-Virus-Scanned: amavisd-new at mta10.int.yaziba.net Received: from mta10.int.yaziba.net ([127.0.0.1]) by localhost (mta10.int.yaziba.net [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id zfHn2il88YpL; Fri, 11 Mar 2016 10:09:51 +0100 (CET) Received: from [10.0.210.182] (unknown [185.23.92.144]) by mta10.int.yaziba.net (Postfix) with ESMTPSA id A072DCA67B; Fri, 11 Mar 2016 10:09:51 +0100 (CET) To: Mark Shinwell , Gerd Stolpmann References: <56DF57FA.9070309@lexifi.com> <56E1D523.7000701@laposte.net> <1457650315.13223.42.camel@e130.lan.sumadev.de> Cc: Pierre Chambart , Markus Mottl , OCaml List From: Alain Frisch Message-ID: <56E28B5F.2030002@lexifi.com> Date: Fri, 11 Mar 2016 10:09:51 +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: gggruggvucftvghtrhhoucdtuddrfeekjedrkeelgddtudcutefuodetggdotefrucfrrhhofhhilhgvmecuggftfghnshhusghstghrihgsvgdpjgetkgfkueetnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefuvfhfhffkffgfgggjtgfgsehtjegrtddtfeejnecuhfhrohhmpeetlhgrihhnucfhrhhishgthhcuoegrlhgrihhnrdhfrhhishgthheslhgvgihifhhirdgtohhmqeenucfkphepudekhedrvdefrdelvddrudeggeenucfrrghrrghmpehmohguvgepshhmthhpohhuth X-VRSPAM-EXTCAUSE: mhhouggvpehsmhhtphhouhht Subject: Re: [Caml-list] Re: Status of Flambda in OCaml 4.03 On 11/03/2016 09:59, Mark Shinwell wrote: > Also, for a function like the one you gave containing: > > if then else > > one of the reasons this should be kept in the .cmx files is because, > when the compiler comes to examine whether to inline it, it may be > able to fully evaluate . In particular when it's true then the > large expression can be eliminated completely (so long as is > not side-effecting). Another example is functions containing a large > match, where we may end up knowing which case is to be taken. For such cases, it is interesting to compile the function as a small stub that checks the condition or the match and jumps (tail call) into the proper sub-body. Only the stub (and potentially small enough sub-bodies) would be inlined, and the cmx would not need to store the large sub-bodies. Such approach was already taken for optional arguments, and I think that flambda already generalizes it. Would the case above be treated like that? Alain