Skip to content

Commit

Permalink
flambda-backend: Make stack allocation the default (ocaml-flambda#1013)
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell authored Dec 8, 2022
1 parent 98debd5 commit 06c189a
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 13 deletions.
6 changes: 3 additions & 3 deletions configure

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

6 changes: 3 additions & 3 deletions 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 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 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 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")

0 comments on commit 06c189a

Please sign in to comment.