Skip to content

Commit

Permalink
flambda-backend: Add flambda2 -O3 and -Oclassic CI jobs, third attempt (
Browse files Browse the repository at this point in the history
  • Loading branch information
mshinwell authored Jun 14, 2023
1 parent ef161b9 commit 284889c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lambda/matching.ml
Original file line number Diff line number Diff line change
Expand Up @@ -1955,7 +1955,7 @@ let inline_lazy_force_cond arg pos loc =
ap_result_layout = Lambda.layout_lazy_contents;
ap_region_close = pos;
ap_mode = alloc_heap;
ap_inlined = Default_inlined;
ap_inlined = Never_inlined;
ap_specialised = Default_specialise;
ap_probe=None
},
Expand Down
2 changes: 2 additions & 0 deletions testsuite/tests/backtrace/backtrace2.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
(* TEST
* skip
reason = "Backtraces are broken by the use of reraise"
flags = "-g"
ocamlrunparam += ",b=1"
*)
Expand Down
2 changes: 1 addition & 1 deletion testsuite/tests/lib-obj/with_tag.ml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ let allocs =

let () =
assert (allocs (fun () -> Obj.with_tag 1 (Obj.repr (A ("hello", 10.)))) = 0);
assert (allocs (fun () -> Obj.with_tag 1 (Obj.repr (ref 10))) = 2)
assert (allocs (fun [@inline never] () -> Obj.with_tag 1 (Obj.repr (ref 10))) = 2)

let () =
print_endline "ok"
3 changes: 2 additions & 1 deletion testsuite/tests/misc/ephetest2.ml
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ type env = {
varephe_false : varephe Stack.t;
}

let new_env () = {
(* Uses opaque_identity to inhibit static allocation under flambda2 *)
let new_env () = Sys.opaque_identity {
vars = Hashtbl.create 100;
ephes = Stack.create ();
varephe_true = Stack.create ();
Expand Down
3 changes: 2 additions & 1 deletion testsuite/tests/misc/ephetest2_new.ml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ type env = {
varephe_false : varephe Stack.t;
}

let new_env () = {
(* Uses opaque_identity to inhibit static allocation under flambda2 *)
let new_env () = Sys.opaque_identity {
vars = Hashtbl.create 100;
ephes = Stack.create ();
varephe_true = Stack.create ();
Expand Down
13 changes: 6 additions & 7 deletions testsuite/tests/typing-local/loop_regions.ml
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,14 @@ let nonloc_while_body () =
[offset1; !offset_loop; offset2]

(* Local while condition should allocate in parent *)
let loc_while_cond () =
let[@inline never] loc_while_cond () =
let offset_loop = ref (-1) in
let offset1 = local_stack_offset () in
while [%exclave] (
let z = local_ (Some (Sys.opaque_identity 42)) in
let _ = (opaque_local z) in
offset_loop := local_stack_offset ();
false
Sys.opaque_identity false
)
do
()
Expand All @@ -87,22 +87,21 @@ let loc_while_cond () =
[offset1; !offset_loop; offset2]

(* Nonlocal while condition should allocate in its own region *)
let nonloc_while_cond () =
let[@inline never] nonloc_while_cond () =
let offset_loop = ref (-1) in
let offset1 = local_stack_offset () in
while
let z = local_ (Some (Sys.opaque_identity 42)) in
let _ = (opaque_local z) in
offset_loop := local_stack_offset ();
false
Sys.opaque_identity false
do
()
done;
let offset2 = local_stack_offset () in
[offset1; !offset_loop; offset2]


let loc_func () =
let[@inline never] loc_func () =
let offset_func = ref (-1) in
let fun_exclave r =
[%exclave] (
Expand All @@ -116,7 +115,7 @@ let loc_func () =
[offset1; !offset_func; offset2]


let nonloc_func () =
let[@inline never] nonloc_func () =
let offset_func = ref (-1) in
let fun_nonexclave r =
let z = local_ (Some (Sys.opaque_identity 42)) in
Expand Down

0 comments on commit 284889c

Please sign in to comment.