From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 1E8A7BC37 for ; Thu, 3 Sep 2009 12:15:24 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Au4AAD80n0oSBwdQkWdsb2JhbACbPAEBAQEJCwoHEwWuW4c7iEqEGwU X-IronPort-AV: E=Sophos;i="4.44,324,1249250400"; d="sig'?scan'208";a="45900415" Received: from biscayne-one-station.mit.edu ([18.7.7.80]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Sep 2009 12:15:23 +0200 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by biscayne-one-station.mit.edu (8.13.6/8.9.2) with ESMTP id n83AFJ8d010622 for ; Thu, 3 Sep 2009 06:15:19 -0400 (EDT) Received: from [18.33.7.209] ([18.33.7.209]) (authenticated bits=0) (User authenticated as farr@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id n83AFId3010296 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT) for ; Thu, 3 Sep 2009 06:15:18 -0400 (EDT) Message-Id: <3FD35494-8478-4F88-9282-6B9F68D608F9@mit.edu> From: Will M Farr To: caml-list@inria.fr In-Reply-To: <4A9F9015.2010408@inria.fr> Content-Type: multipart/signed; protocol="application/pgp-signature"; micalg=pgp-sha1; boundary="Apple-Mail-40-935287143" Content-Transfer-Encoding: 7bit Mime-Version: 1.0 (Apple Message framework v936) Subject: Re: [Caml-list] Optimizing Float Ref's Date: Thu, 3 Sep 2009 06:15:10 -0400 References: <4A9F9015.2010408@inria.fr> X-Pgp-Agent: GPGMail 1.2.0 (v56) X-Mailer: Apple Mail (2.936) X-Scanned-By: MIMEDefang 2.42 X-Spam: no; 0.00; ref's:01 ref's:01 unboxed:01 unboxed:01 inlining:01 inlined:01 ocaml:01 dims:01 reproduces:01 compiler:01 wrote:01 stack:01 stack:01 caml-list:01 omitted:01 X-Attachments: type="application/pgp-signature" name="PGP.sig" name="PGP.sig" This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --Apple-Mail-40-935287143 Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Xavier, Thanks for the comments. I thought that float ref's were unboxed by default! In fact, I find that breaking out the code into a stand- alone example which loops through matrix multiplies only indeed does not have any calls to "caml_modify"; everything is unboxed and stored on the stack (I'm on x86) as you say. It must be the remainder of my application that is producing the calls to caml_modify (the profile I was using was embedded in a larger application with lots of inlining going on, so maybe something that calls caml_modify is getting inlined around the matrix multiply and confusing the profiler). Thanks, Will On Sep 3, 2009, at 5:44 AM, Xavier Leroy wrote: >> I'm running OCaml 3.11.1, and I noticed something strange in some >> native code for matrix multiply today. The code was >> [...] >> [Local float ref being unboxed or not? ] > > You omitted the definition of "dims", but after adding the obvious > definition, the float ref "sum" is indeed completely unboxed and is > kept in a float register (on x86-64 bits) or stack location (on x86-32 > bits). No "modify" takes place in the inner loop. So, I don't > understand the problem you observed. Feel free to post a report on > the BTS with a *complete* piece of code that reproduces the problem. > >> But, I thought that float ref's were automatically unboxed by the >> compiler when they didn't escape the local context. > > Yes, if all uses of the float ref are unboxed, which is the case in > your code. > > - Xavier Leroy --Apple-Mail-40-935287143 content-type: application/pgp-signature; x-mac-type=70674453; name=PGP.sig content-description: This is a digitally signed message part content-disposition: inline; filename=PGP.sig content-transfer-encoding: 7bit -----BEGIN PGP SIGNATURE----- Version: GnuPG/MacGPG2 v2.0.12 (Darwin) iEYEARECAAYFAkqflzUACgkQ1IoZbWY+dGxqlgCggc/SNYV16NlqoD5ouRaiOeL5 7q0AoJqSCLRcVOp7XWWY/82Uc69cwOkl =uRRS -----END PGP SIGNATURE----- --Apple-Mail-40-935287143--