caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Will M Farr <farr@MIT.EDU>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Optimizing Float Ref's
Date: Thu, 3 Sep 2009 06:15:10 -0400	[thread overview]
Message-ID: <3FD35494-8478-4F88-9282-6B9F68D608F9@mit.edu> (raw)
In-Reply-To: <4A9F9015.2010408@inria.fr>

[-- Attachment #1: Type: text/plain, Size: 1533 bytes --]

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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 203 bytes --]

  reply	other threads:[~2009-09-03 10:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-28 20:32 Will M Farr
2009-08-30 19:43 ` [Caml-list] " Yaron Minsky
2009-08-31 14:09   ` Till Varoquaux
2009-08-31 14:51     ` Will M Farr
2009-08-31 17:30   ` Jon Harrop
2009-08-31 17:15 ` Jon Harrop
2009-09-03  9:44 ` Xavier Leroy
2009-09-03 10:15   ` Will M Farr [this message]
2010-03-31 17:21   ` Dmitry Bely
     [not found]     ` <p2tc7e4e9f1003311055xce0919wac2118aa3c05f1cb@mail.gmail.com>
2010-03-31 18:28       ` Dmitry Bely
2010-03-31 18:59     ` Alain Frisch
2010-03-31 19:18       ` Dmitry Bely
     [not found]         ` <m2lfbd71dab1003311252v5bda5d13vc2146d2d24270847@mail.gmail.com>
2010-03-31 20:00           ` Dmitry Bely
2010-04-14 18:13         ` Goswin von Brederlow

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3FD35494-8478-4F88-9282-6B9F68D608F9@mit.edu \
    --to=farr@mit.edu \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).