From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 78C1F7F026 for ; Fri, 11 Mar 2016 10:26:43 +0100 (CET) IronPort-PHdr: 9a23:vXV39xN677oxhB8UKyEl6mtUPXoX/o7sNwtQ0KIMzox0KPT/rarrMEGX3/hxlliBBdydsKIbzbqH+Pi8EUU7or+/81k6OKRWUBEEjchE1ycBO+WiTXPBEfjxciYhF95DXlI2t1uyMExSBdqsLwaK+i760zceF13FOBZvIaytQ8iJ35vxh7H5o8GbSj4LrQT+SIs6FA+xowTVu5teqqpZAYF19CH0pGBVcf9d32JiKAHbtR/94sCt4MwrqHwI6LoJvvRNWqTifqk+UacQTHF/azh0t4XXskzqSQKO4DMySGQNmRoAVwHB5RD8GJnrszDxtsJ51TmbM8ywRrcxD2eM9aBuHTrhkiRPDD449n7ajsg42KdAoBOnuBF7x6bWaYeYL+Zkc67BO9gdQDwSDY5qSyVdD9bkPMM0BO0bMLMd9tGlqg== Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mshinwell@janestreet.com; spf=Pass smtp.mailfrom=mshinwell@janestreet.com; spf=None smtp.helo=postmaster@mxout1.mail.janestreet.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of mshinwell@janestreet.com) identity=pra; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of mshinwell@janestreet.com designates 38.105.200.112 as permitted sender) identity=mailfrom; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="mshinwell@janestreet.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@mxout1.mail.janestreet.com) identity=helo; client-ip=38.105.200.112; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="mshinwell@janestreet.com"; x-sender="postmaster@mxout1.mail.janestreet.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: A0A8AACnjuJWjnDIaSZehH0GuBKCEwENgW2GDwKBLgc4FAEBAQEBAQEBEAEBAQEHFglQgi2CFQEBBBIRHQEBNwEPCwsNAgImAgIiEgEFARwGEyKIAgOgf4ExPjGKT2eEQQEEilgBAQEBAQEBAwEBAQEBAQETBgpyhRyEQoc6gTqXSI18jwKNMxEegQ8eAQGCOB6BUGqKUQEBAQ X-IPAS-Result: A0A8AACnjuJWjnDIaSZehH0GuBKCEwENgW2GDwKBLgc4FAEBAQEBAQEBEAEBAQEHFglQgi2CFQEBBBIRHQEBNwEPCwsNAgImAgIiEgEFARwGEyKIAgOgf4ExPjGKT2eEQQEEilgBAQEBAQEBAwEBAQEBAQETBgpyhRyEQoc6gTqXSI18jwKNMxEegQ8eAQGCOB6BUGqKUQEBAQ X-IronPort-AV: E=Sophos;i="5.24,320,1454972400"; d="scan'208";a="207181134" Received: from mxout1.mail.janestreet.com ([38.105.200.112]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Mar 2016 10:26:42 +0100 Received: from tot-qpr-mailcore2.delacy.com ([172.27.56.106] helo=tot-qpr-mailcore2) by mxout1.mail.janestreet.com with esmtps (TLSv1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1aeJLF-00058Q-SU for caml-list@inria.fr; Fri, 11 Mar 2016 04:26:41 -0500 X-JS-Flow: external Received: by tot-qpr-mailcore2 with JS-mailcore (0.1) (envelope-from ) id BW4o9R-AAAB6W-aE; 2016-03-11 04:26:41.835448-05:00 Received: from mail-ob0-f171.google.com ([209.85.214.171]) by mxgoog2.mail.janestreet.com with esmtps (UNKNOWN:AES128-GCM-SHA256:128) (Exim 4.72) (envelope-from ) id 1aeJLF-0005uV-LC for caml-list@inria.fr; Fri, 11 Mar 2016 04:26:41 -0500 Received: by mail-ob0-f171.google.com with SMTP id fp4so107405895obb.2 for ; Fri, 11 Mar 2016 01:26:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=janestreet.com; s=google; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=qXG5dSKE+fh60cT5AuYBJFEbtmq0JTOeVTEHVONmdyQ=; b=Uxlpd5e18aOvyudk5+Ki4Zlv38bSYpQ3HlUfxDfnodkuweQXx0iOoGtCu3+Ql7aoNL rBYxcr3mwmjqUnHX8ZB2LCX3F8XXvQ33LpG7E3Pm+rW5PLZHQcZZyQkBCjrUM5FAp/zg 0UwUpXB0mFibCq5fItzup7PHb1jiE873sR/xU= 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=qXG5dSKE+fh60cT5AuYBJFEbtmq0JTOeVTEHVONmdyQ=; b=H/sCRq13wKVerYjXcYHxMU9XN2mlhjvgn3XQXpN+4H5m+eA/FjfmX4u1RymmusOV86 NuODHOkAe2cvbtxiLbZtORQLv6nz5oLO2DGpv++tKOJ4Zu8zovXDkSX3Tbbv4nXnFAfG R9I83sAPT76IAmK8LTDg+yteqb2VlEf3VzMgb5g+LOPXZuhQ6Z+hV6cOvM9kYf5lvBbY gZQ1paVMwy086A7rlELnKXOjHwSloq8jGuoHwKN/fy6Ehjqz1/jf+NZDCgMPn+1S5ZJ9 5awX7gbYNN6j9mvlzmNQ8KpWljzNUuKDsmpVgEoKfPRhoFiIBubmeiFs7N8vymQVzHhL JAOg== X-Gm-Message-State: AD7BkJIjT9+4wWcR2MFMu7c+lCntll7NG8lfDdqp8uRIoegmF9XSmvn2GMLQAq6rNVaY18YXkmvqSnGa45FH5uLmN6hLdeY2yL7xsWDsTr1BY6sADRw8GHmVFgqMR8L5D6i9yNaoWJpvPEJLnbXW X-Received: by 10.182.196.37 with SMTP id ij5mr4883946obc.24.1457688401270; Fri, 11 Mar 2016 01:26:41 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.182.196.37 with SMTP id ij5mr4883937obc.24.1457688401140; Fri, 11 Mar 2016 01:26:41 -0800 (PST) Received: by 10.202.216.214 with HTTP; Fri, 11 Mar 2016 01:26:41 -0800 (PST) In-Reply-To: <56E28B5F.2030002@lexifi.com> References: <56DF57FA.9070309@lexifi.com> <56E1D523.7000701@laposte.net> <1457650315.13223.42.camel@e130.lan.sumadev.de> <56E28B5F.2030002@lexifi.com> Date: Fri, 11 Mar 2016 09:26:41 +0000 Message-ID: From:Mark Shinwell To:Alain Frisch Cc:Gerd Stolpmann , Pierre Chambart , Markus Mottl , OCaml List Content-Type: text/plain; charset=UTF-8 X-JS-Processed-by: mailcore X-Validation-by: mshinwell@janestreet.com Subject: Re: [Caml-list] Re: Status of Flambda in OCaml 4.03 Not at present. Although the technique of using stubs is heavily used in Flambda for other optimisations (for example where the argument list of a function is going to be modified). Mark On 11 March 2016 at 09:09, Alain Frisch wrote: > 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