caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Vincent HUGOT" <vincent.hugot@gmail.com>
To: caml-list@inria.fr
Subject: Re: [Caml-list] The verdict on "%identity"
Date: Tue, 20 Nov 2012 20:03:18 +0100	[thread overview]
Message-ID: <op.wn25vsx8ticpyh@seth> (raw)
In-Reply-To: <CAPFanBFUkri75W2vFqS5dNN4BUWw7W7-CPQ9HnwwdCEwtqjtYw@mail.gmail.com>

Is there some place where this fabulous -dmcc switch is documented?
ocamlopt's man and --help pages, as well as the manual, are utterly  
uninformative (either don't mention it or say simply "undocumented").

V.



On Tue, 20 Nov 2012 17:19:34 +0100, Gabriel Scherer  
<gabriel.scherer@gmail.com> wrote:

> This is good advice in general, and using ocamlobjinfo to get inlining
> information from the .cmx is indeed a very good idea.
>
> Regarding -dcmm vs. -S, I generally use -dcmm myself (much more
> readable), but it is not the right tool in this case. The cmm produced
> for my test.ml code does make a difference between the three styles:
>      (let testA/1046 (let x/1075 "camlTest__3" x/1075)
>        (store (+a "camlTest" 20) testA/1046))
>      (let testB/1047 (let prim/1076 "camlTest__2" prim/1076)
>        (store (+a "camlTest" 24) testB/1047))
>      (let testD/1048 "camlTest__1"
>         (store (+a "camlTest" 28) testD/1048))
>
> In fact, the removal of the trivial (let x = foo in x) does not happen
> during the inlining passes in closure.ml, but much later at the
> register allocation phase, where there is indeed a strong preference
> for eg. testA/1046 and x/1705 to be given the same register, and the
> useless move is erased. I make no claim of how robust this behavior
> will be in a different case (eg. with higher register pressure), but
> I'm not sure I really care.
> I'd rather have people study the behavior on the compiler the real
> performance-critical applications and suggest potential style changes
> in the program (or optimization changes in the compiler) in cases
> where this really make a performance difference. Writing code in a
> certain way because "the generated code is nicer" is usually not worth
> the trouble.

  reply	other threads:[~2012-11-20 19:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-19 17:49 Dario Teixeira
2012-11-19 18:02 ` Török Edwin
2012-11-19 18:18   ` Dario Teixeira
2012-11-19 18:28     ` David House
2012-11-20  9:53       ` Gabriel Scherer
2012-11-20 10:25       ` Pierre Chambart
2012-11-20 16:19         ` Gabriel Scherer
2012-11-20 19:03           ` Vincent HUGOT [this message]
2012-11-20 20:43           ` Dario Teixeira

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=op.wn25vsx8ticpyh@seth \
    --to=vincent.hugot@gmail.com \
    --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).