From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 20613BBD7 for ; Wed, 3 Aug 2005 09:16:19 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j737GIJW019134 for ; Wed, 3 Aug 2005 09:16:18 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id JAA31527 for ; Wed, 3 Aug 2005 09:16:18 +0200 (MET DST) Received: from will.iki.fi (will.iki.fi [217.169.64.20]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j737GHjK019131 for ; Wed, 3 Aug 2005 09:16:17 +0200 Received: from [10.0.20.56] (fa-3-0-0.fw.exomi.com [217.169.64.99]) by will.iki.fi (Postfix) with ESMTP id 534D4137; Wed, 3 Aug 2005 10:16:17 +0300 (EEST) Message-ID: <42F06F3C.6060508@exomi.com> Date: Wed, 03 Aug 2005 10:16:12 +0300 From: Ville-Pertti Keinonen User-Agent: Mozilla Thunderbird 1.0.6 (X11/20050721) X-Accept-Language: en-us, en MIME-Version: 1.0 To: John Carr Cc: caml-list@inria.fr Subject: Re: [Caml-list] Function Inlining References: <200508021503.j72F35hR011108@all-night-tool.mit.edu> In-Reply-To: <200508021503.j72F35hR011108@all-night-tool.mit.edu> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 42F06F42.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 42F06F41.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 inlining:01 omitted:01 stack:01 asmcomp:01 compiler:01 transl:01 ...:98 wrote:01 constants:01 module:03 perhaps:03 optimization:03 optimization:03 intermediate:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 John Carr wrote: > the assembly code would look like (with tag values omitted for clarity): ... That definitely looks good. > This solves the stack overflow problem. I'm not convinced that > the asmcomp phase of the compiler is the right place to do this > optimization. Perhaps it should be moved to the intermediate > phase where the top level module optimization is done now. One problem with this might be that you don't even have any kind of constant folding done at that point (I assume you're referring to the transl* phase), so you'd either have to duplicate that functionality or limit it to simple constants.