From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA24236 for caml-redistribution; Thu, 4 Feb 1999 15:46:48 +0100 (MET) 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 PAA25836 for ; Thu, 4 Feb 1999 15:06:42 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id PAA26129; Thu, 4 Feb 1999 15:05:59 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA16968; Thu, 4 Feb 1999 15:05:59 +0100 (MET) Message-ID: <19990204150559.61903@pauillac.inria.fr> Date: Thu, 4 Feb 1999 15:05:59 +0100 From: Xavier Leroy To: Anton Moscal , caml-list@inria.fr Subject: Re: O'Caml native code can be easily improved in size by 10% References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: ; from Anton Moscal on Tue, Feb 02, 1999 at 06:06:14PM +0300 Sender: weis > [Combining heap allocations inside one basic block] This is an excellent idea. (I considered it briefly a long time ago, while working on Gallium, an early precursor of the OCaml native-code compiler, but the effects weren't really significant on the small benchmarks that I used then.) I'll implement it a bit differently than in your patch: instead of grouping the allocations late (in Linearize), I'd rather group them during instruction selection (Selectgen). One advantage is that the optimization you describe (not reading youg_ptr again for each sub-allocation) then comes "for free". Another advantage is that we don't need to modify all code emitters... > And the last: on x86 and m68k architectures `selection.ml' contains the > following method: > the alternative > Cconst_int n -> (Ispecific(Istore_int(n, addr)), Ctuple []) > processes storing of the Cconst_int immediate constants, but ignores the > Cconst_natint constants. Good point. I guess this part of the code wasn't updated when "big constants" (Cconst_natint) were introduced. The right thing to do is to put a Nativeint.t, not an int, as argument of Istore_int and Ipush_int. All this will be in 2.02. Combined with other optimizations I'm working on, 2.02 should show some significant improvements in execution speed and code size. Thanks for your feedback, - Xavier Leroy