Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stack allocation the default #1013

Merged
merged 3 commits into from
Dec 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ jobs:
use_runtime: d
ocamlrunparam: "v=0,V=1"

- name: closure_cfg_local
config: --enable-middle-end=closure --enable-stack-allocation --enable-poll-insertion
- name: closure_cfg
config: --enable-middle-end=closure --enable-poll-insertion
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1

Expand All @@ -32,8 +32,8 @@ jobs:
os: ubuntu-latest
ocamlparam: ''

- name: flambda1_cfg_local
config: --enable-middle-end=flambda --enable-stack-allocation --enable-poll-insertion
- name: flambda1_cfg
config: --enable-middle-end=flambda --enable-poll-insertion
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1

Expand All @@ -49,8 +49,8 @@ jobs:
os: ubuntu-latest
ocamlparam: ''

- name: flambda2_cfg_local
config: --enable-middle-end=flambda2 --enable-stack-allocation
- name: flambda2_cfg
config: --enable-middle-end=flambda2
os: ubuntu-latest
ocamlparam: _,ocamlcfg=1

Expand Down
6 changes: 3 additions & 3 deletions ocaml/configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions ocaml/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -2035,10 +2035,10 @@ AS_IF([test x"$DEFAULT_STRING" = "xunsafe"],
[default_safe_string=false],
[default_safe_string=true])

AS_IF([test x"$enable_stack_allocation" = "xyes"],
AS_IF([test x"$enable_stack_allocation" = "xno"],
[stack_allocation=false],
[AC_DEFINE([STACK_ALLOCATION])
stack_allocation=true],
[stack_allocation=false])
stack_allocation=true])

AS_IF([test x"$enable_poll_insertion" = "xyes"],
[AC_DEFINE([POLL_INSERTION])
Expand Down
1 change: 1 addition & 0 deletions ocaml/testsuite/tests/typing-local/loop_regions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
*)

external local_stack_offset : unit -> int = "caml_local_stack_offset"
let local_stack_offset () = local_stack_offset () / (Sys.word_size / 8)
external opaque_local : ('a[@local_opt]) -> ('a[@local_opt]) = "%opaque"

let print_offsets (name,allocs) =
Expand Down
12 changes: 6 additions & 6 deletions ocaml/testsuite/tests/typing-local/loop_regions.stack.reference
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
local for: [0; 16; 16]
non-local for: [0; 16; 0]
local while body: [0; 16; 16]
nonlocal while body: [0; 16; 0]
local while cond: [0; 16; 16]
nonlocal while cond: [0; 16; 0]
local for: [0; 2; 2]
non-local for: [0; 2; 0]
local while body: [0; 2; 2]
nonlocal while body: [0; 2; 0]
local while cond: [0; 2; 2]
nonlocal while cond: [0; 2; 0]
2 changes: 1 addition & 1 deletion ocaml/testsuite/tests/typing-local/pr902.ml
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ let () =
let p = to_be_overapplied () () () 42 () in
let end_offset = local_stack_offset () in
assert (is_local p);
let ok = end_offset - start_offset = 64 in
let ok = end_offset - start_offset = Sys.word_size (* eight words *) in
Printf.printf "PR902: %s\n" (if ok then "ok" else "FAIL")