package ocaml-base-compiler

  1. Overview
  2. Docs
Official 4.06.0 release

Install

Dune Dependency

Authors

Maintainers

Sources

4.06.0.tar.gz
sha256=011879c913e8f988ecdac020b205e2baa4023052efed25013bdb9a6b0d5c6a80
md5=4f3906e581181c5435078ffe3e485e3f

doc/ocamloptcomp/Unbox_specialised_args/index.html

Module Unbox_specialised_args

When approximations of specialised arguments indicate that they are closures or blocks, add more specialised arguments corresponding to the projections from such blocks (with definitions of such projections lifted out), such that the original specialised arguments may later be eliminated.

This in particular enables elimination of closure allocations in examples such as:

let rec map f = function | -> | a::l -> let r = f a in r :: map f l

let g x = map (fun y -> x + y) 1; 2; 3; 4

Here, the specialised version of map initially has a specialised argument f; and upon inlining there will be a projection of x from the closure of f. This pass adds a new specialised argument to carry that projection, at which point the closure of f is redundant.

OCaml

Innovation. Community. Security.