perf: uniformize ocamlopt_flags

we don't need codegen which depends on >= 4.03, it's assumed. Also
include a reasonable value for `-inline` when flambda isn't available.
This commit is contained in:
Simon Cruanes 2022-02-03 18:54:59 -05:00
parent 7ec9e50f74
commit 8c9d7016b8
No known key found for this signature in database
GPG key ID: 4AC01D0849AA62B6
8 changed files with 7 additions and 38 deletions

View file

@ -19,7 +19,6 @@
(modules :standard \ mkshims)
(flags :standard -warn-error -a+8 -w -32 -safe-string -strict-sequence -nolabels -open
CCMonomorphic)
(ocamlopt_flags (:include ../flambda.flags))
(libraries seq either containers.monomorphic))
(ocamllex (modules CCSexp_lex))

View file

@ -4,5 +4,4 @@
(public_name containers-data)
(wrapped false)
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string -open CCShims_)
(ocamlopt_flags :standard (:include ../flambda.flags))
(libraries containers))

View file

@ -1,15 +1,10 @@
(executable
(name mkflags)
(modules mkflags)
(libraries dune.configurator))
(env
(_ (flags :standard -warn-error -3)))
(rule
(targets flambda.flags)
(mode fallback)
(action (run ./mkflags.exe)))
(_
(flags :standard -warn-error -3 -color always)
(ocamlopt_flags :standard -O3 -unbox-closures -unbox-closures-factor 20
-inline 100)
))
(executable
(name mdx_runner)

View file

@ -1,19 +0,0 @@
module C = Configurator.V1
let () =
C.main ~name:"mkflags" (fun c ->
let version = C.ocaml_config_var_exn c "version" in
let major, minor =
Scanf.sscanf version "%u.%u"
(fun major minor -> major, minor)
in
let after_4_3 = (major, minor) >= (4, 3) in
let sexp =
if after_4_3 then (
["-O3"; "-unbox-closures"; "-unbox-closures-factor"; "20"; "-color"; "always"]
) else (
["-inline"; "100"]
) in
C.Flags.write_sexp "flambda.flags" sexp
)

View file

@ -14,5 +14,4 @@
(public_name containers.monomorphic)
(modules CCMonomorphic CCMonomorphicShims_)
(wrapped false)
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
(ocamlopt_flags :standard (:include ../flambda.flags)))
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string))

View file

@ -5,6 +5,5 @@
(wrapped false)
(optional)
(flags :standard -warn-error -a+8 -w -32 -safe-string -open CCShims_)
(ocamlopt_flags :standard (:include ../flambda.flags))
(libraries containers threads))

View file

@ -5,5 +5,4 @@
(public_name containers.top)
(wrapped false)
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
(ocamlopt_flags :standard (:include ../flambda.flags))
(libraries compiler-libs.common containers containers.unix))

View file

@ -5,6 +5,4 @@
(wrapped false)
(optional)
(flags :standard -w +a-4-42-44-48-50-58-32-60@8 -safe-string)
(ocamlopt_flags :standard (:include ../flambda.flags))
(libraries unix)
)
(libraries unix))