From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id IAA22350; Tue, 20 Aug 2002 08:25:57 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id IAA22726 for ; Tue, 20 Aug 2002 08:25:57 +0200 (MET DST) Received: from comtv.ru (comtv.ru [217.10.32.4]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g7K6PuP19020 for ; Tue, 20 Aug 2002 08:25:56 +0200 (MET DST) Received: from [10.0.66.9] ([10.0.66.9] verified) by comtv.ru (CommuniGate Pro SMTP 3.5.9) with ESMTP-TLS id 4154914; Tue, 20 Aug 2002 10:25:55 +0400 Date: Tue, 20 Aug 2002 10:25:22 +0400 (MSD) From: malc X-X-Sender: malc@home.oyster.ru To: Thorsten Ohl cc: caml-list@inria.fr Subject: Re: [Caml-list] Inlining across functors (was: O'Caml vs C++: a little benchmark) In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 20 Aug 2002, malc wrote: > On Mon, 19 Aug 2002, Thorsten Ohl wrote: > > > Xavier Leroy writes: > > > > > Just for the record: ocamlopt does perform inlining across > > > compilation units (via the information stored in .cmx files). What > > > it doesn't do, however, is inlining and specialization of recursive > > > function definitions. > > > > However, it appears that it doesn't inline across functors. For > > example, in > snip > > > > Is this because the signature M can make no guarantee that op is never > > a recursive function? Do all functor applications fall under the `no > > inlining and specialization of recursive function definitions' clause? > > Yes. With http://algol.prosalg.no/~malc/code/patches/specfun.tar.gz > (patch against 3.04) you will get this instead: > > *** Linearized code > Opt_f2_72: > A/11[%ecx] := [env/10[%ecx] + 12] > A/12[%ecx] := [A/11[%ecx]] > tailcall "Opt_f_62" R/0[%eax] > R/1[%ebx] > R/2[%ecx] Whoops.. Again a reminder to think before posting.. The real linearized code with specfun would be: *** Linearized code Opt_f_76: n/10[%eax] := a/8[%eax] + b/9[%ebx] + -1 return R/0[%eax] *** Linearized code Opt_f2_84: n/10[%eax] := a/8[%eax] + b/9[%ebx] + -1 return R/0[%eax] (Forgot to specify -specialize on command line.. doh) -- mailto:malc@pulsesoft.com ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners