Skip to content

Commit

Permalink
flambda-backend: To upstream: use flambda_o3 attribute in stdlib
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell authored and poechsel committed Jun 25, 2021
1 parent 403b82e commit 7d08e0e
Show file tree
Hide file tree
Showing 66 changed files with 171 additions and 60 deletions.
3 changes: 0 additions & 3 deletions stdlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ CAMLC=$(CAMLRUN) $(COMPILER)
COMPFLAGS=-strict-sequence -absname -w +a-4-9-41-42-44-45-48-66 \
-g -warn-error A -bin-annot -nostdlib -principal \
-safe-string -strict-formats -nopervasives -no-alias-deps
ifeq "$(FLAMBDA)" "true"
OPTCOMPFLAGS += -O3
endif
OPTCOMPILER=$(ROOTDIR)/ocamlopt$(EXE)
CAMLOPT=$(CAMLRUN) $(OPTCOMPILER)
CAMLDEP=$(BOOT_OCAMLC) -depend
Expand Down
2 changes: 2 additions & 0 deletions stdlib/arg.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type key = string
type doc = string
type usage_msg = string
Expand Down
2 changes: 2 additions & 0 deletions stdlib/array.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* An alias for the type of arrays. *)
type 'a t = 'a array

Expand Down
2 changes: 2 additions & 0 deletions stdlib/arrayLabels.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [ArrayLabels]: labelled Array module *)

[@@@ocaml.nolabels]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/bigarray.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [Bigarray]: large, multi-dimensional, numerical arrays *)

(* These types in must be kept in sync with the tables in
Expand Down
2 changes: 2 additions & 0 deletions stdlib/bool.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type t = bool = false | true

external not : bool -> bool = "%boolnot"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/buffer.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Extensible buffers *)

[@@@ocaml.inline 3]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/bytes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Byte sequence operations *)

(* WARNING: Some functions in this file are duplicated in string.ml for
Expand Down
2 changes: 2 additions & 0 deletions stdlib/bytesLabels.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [BytesLabels]: labelled Bytes module *)

[@@@ocaml.nolabels]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/callback.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Registering OCaml values with the C runtime for later callbacks *)

external register_named_value : string -> Obj.t -> unit
Expand Down
2 changes: 2 additions & 0 deletions stdlib/camlinternalFormat.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

[@@@ocaml.warning "Ae"]

open CamlinternalFormatBasics
Expand Down
2 changes: 2 additions & 0 deletions stdlib/camlinternalLazy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Internals of forcing lazy values. *)

[@@@ocaml.afl_inst_ratio 0]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/camlinternalMod.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

external make_forward : Obj.t -> Obj.t -> unit = "caml_obj_make_forward"

type shape =
Expand Down
2 changes: 2 additions & 0 deletions stdlib/camlinternalOO.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

[@@@ocaml.inline 0]
[@@@ocaml.afl_inst_ratio 0]

Expand Down
2 changes: 2 additions & 0 deletions stdlib/char.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Character operations *)

external code: char -> int = "%identity"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/complex.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Complex numbers *)

type t = { re: float; im: float }
Expand Down
2 changes: 2 additions & 0 deletions stdlib/digest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Message digest (MD5) *)

type t = string
Expand Down
2 changes: 2 additions & 0 deletions stdlib/ephemeron.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

module type SeededS = sig
include Hashtbl.SeededS
val clean: 'a t -> unit
Expand Down
2 changes: 2 additions & 0 deletions stdlib/filename.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

let generic_quote quotequote s =
let l = String.length s in
let b = Buffer.create (l + 20) in
Expand Down
2 changes: 2 additions & 0 deletions stdlib/float.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

[@@@ocaml.nolabels]

external neg : float -> float = "%negfloat"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/format.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* A pretty-printing facility and definition of formatters for 'parallel'
(i.e. unrelated or independent) pretty-printing on multiple out channels. *)

Expand Down
2 changes: 2 additions & 0 deletions stdlib/fun.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

external id : 'a -> 'a = "%identity"
let const c _ = c
let flip f x y = f y x
Expand Down
2 changes: 2 additions & 0 deletions stdlib/gc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type stat = {
minor_words : float;
promoted_words : float;
Expand Down
2 changes: 2 additions & 0 deletions stdlib/genlex.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type token =
Kwd of string
| Ident of string
Expand Down
2 changes: 2 additions & 0 deletions stdlib/hashtbl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Hash tables *)

(* We do dynamic hashing, and resize the table and rehash the elements
Expand Down
2 changes: 2 additions & 0 deletions stdlib/int.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type t = int

let zero = 0
Expand Down
2 changes: 2 additions & 0 deletions stdlib/int32.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [Int32]: 32-bit integers *)

external neg : int32 -> int32 = "%int32_neg"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/int64.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [Int64]: 64-bit integers *)

external neg : int64 -> int64 = "%int64_neg"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/lazy.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [Lazy]: deferred computations *)


Expand Down
2 changes: 2 additions & 0 deletions stdlib/lexing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* The run-time library for lexers generated by camllex *)

type position = {
Expand Down
2 changes: 2 additions & 0 deletions stdlib/list.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* An alias for the type of lists. *)
type 'a t = 'a list = [] | (::) of 'a * 'a list

Expand Down
2 changes: 2 additions & 0 deletions stdlib/listLabels.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [ListLabels]: labelled List module *)

[@@@ocaml.nolabels]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/map.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

module type OrderedType =
sig
type t
Expand Down
2 changes: 2 additions & 0 deletions stdlib/marshal.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type extern_flags =
No_sharing
| Closures
Expand Down
2 changes: 2 additions & 0 deletions stdlib/moreLabels.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [MoreLabels]: meta-module for compatibility labelled libraries *)

[@@@ocaml.nolabels]
Expand Down
2 changes: 2 additions & 0 deletions stdlib/nativeint.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Module [Nativeint]: processor-native integers *)

external neg: nativeint -> nativeint = "%nativeint_neg"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/obj.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* Operations on internal representations of values *)

type t
Expand Down
2 changes: 2 additions & 0 deletions stdlib/oo.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

let copy = CamlinternalOO.copy
external id : < .. > -> int = "%field1"
let new_method = CamlinternalOO.public_method_label
Expand Down
2 changes: 2 additions & 0 deletions stdlib/option.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

type 'a t = 'a option = None | Some of 'a

let none = None
Expand Down
2 changes: 2 additions & 0 deletions stdlib/parsing.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(* The parsing engine *)

open Lexing
Expand Down
2 changes: 2 additions & 0 deletions stdlib/pervasives.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

(** @deprecated Use {!Stdlib} *)

external raise : exn -> 'a = "%raise"
Expand Down
2 changes: 2 additions & 0 deletions stdlib/printexc.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

open Printf

type t = exn = ..
Expand Down
2 changes: 2 additions & 0 deletions stdlib/printf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

[@@@ocaml.warning "Ae"]

open CamlinternalFormatBasics
Expand Down
2 changes: 2 additions & 0 deletions stdlib/queue.ml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@

open! Stdlib

[@@@ocaml.flambda_o3]

exception Empty

type 'a cell =
Expand Down
Loading

0 comments on commit 7d08e0e

Please sign in to comment.