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: PGP.sig
Description: This is a digitally signed message part

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs

Reply via email to