caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Status of Flambda in OCaml 4.03
@ 2016-03-08 22:10 Markus Mottl
  2016-03-08 22:53 ` Alain Frisch
  0 siblings, 1 reply; 23+ messages in thread
From: Markus Mottl @ 2016-03-08 22:10 UTC (permalink / raw)
  To: OCaml List

Hi,

I'm trying out OCaml 4.03.0+beta1 right now and wanted to test Flambda
optimizations.  But looking at the generated assembly, it doesn't seem
to be doing much if anything on the simple test examples that I
thought would benefit.

To give an example of what I expected to see, lets consider this code:

-----
let map_pair f (x, y) = f x, f y

let succ x = x + 1
let map_pair_succ1 pair = map_pair succ pair
let map_pair_succ2 (x, y) = succ x, succ y
-----

I would have thought that the "succ" function would be inlined in
"map_pair_succ1" as the compiler would do for "map_pair_succ2".
But the generated code looks like this:

-----
L101:
  movq  %rax, %rdi
  movq  %rdi, 8(%rsp)
  movq  %rbx, (%rsp)
  movq  8(%rbx), %rax
  movq  (%rdi), %rsi
  movq  %rdi, %rbx
  call  *%rsi
L102:
  movq  %rax, 16(%rsp)
  movq  (%rsp), %rax
  movq  (%rax), %rax
  movq  8(%rsp), %rbx
  movq  (%rbx), %rdi
  call  *%rdi
-----

Is Flambda supposed to work out of the box with the current beta?
What flags or annotations should I use for testing?  Any showcase
examples I should try out that are expected to be improved?

Regards,
Markus

-- 
Markus Mottl        http://www.ocaml.info        markus.mottl@gmail.com

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2016-04-17 15:43 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-03-08 22:10 [Caml-list] Status of Flambda in OCaml 4.03 Markus Mottl
2016-03-08 22:53 ` Alain Frisch
2016-03-09  3:55   ` Markus Mottl
2016-03-09  7:14     ` Mark Shinwell
2016-03-10  0:59       ` Markus Mottl
2016-03-10  1:32         ` Yotam Barnoy
2016-03-10  1:43           ` Markus Mottl
2016-03-10  7:20             ` Mark Shinwell
2016-03-10 15:32               ` Markus Mottl
2016-03-10 15:49                 ` Gabriel Scherer
2016-04-17  8:43                   ` Jesper Louis Andersen
2016-04-17  8:59                     ` Mohamed Iguernlala
2016-04-17 15:43                       ` Markus Mottl
2016-03-10 20:12                 ` [Caml-list] <DKIM> " Pierre Chambart
2016-03-10 21:08                   ` Markus Mottl
2016-03-10 22:51                   ` Gerd Stolpmann
2016-03-11  8:59                     ` Mark Shinwell
2016-03-11  9:05                       ` Mark Shinwell
2016-03-11  9:09                       ` Alain Frisch
2016-03-11  9:26                         ` Mark Shinwell
2016-03-11 14:48                           ` Yotam Barnoy
2016-03-11 15:09                             ` Jesper Louis Andersen
2016-03-11 16:58                       ` Markus Mottl

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).