Skip to content

Commit

Permalink
Extend conditions to include flambda2 (ocaml-flambda#115)
Browse files Browse the repository at this point in the history
* Extend conditions to include flambda2.

* Make `[@unrolled]` flambda2-compatible.

* Add CR to enable test for flambda2 compilers.
  • Loading branch information
xclerc committed Jul 26, 2021
1 parent d00eeba commit 0cc87aa
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ocaml/lambda/translattribute.ml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let is_inline_attribute = function

let is_inlined_attribute = function
| {txt=("inlined"|"ocaml.inlined")} -> true
| {txt=("unrolled"|"ocaml.unrolled")} when Config.flambda -> true
| {txt=("unrolled"|"ocaml.unrolled")} when Config.flambda || Config.flambda2 -> true
| _ -> false

let is_specialise_attribute = function
Expand Down
2 changes: 1 addition & 1 deletion ocaml/lambda/translcore.ml
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ and transl_exp0 ~in_new_scope ~scopes e =
ap_probe = Some {name};
}
in
begin match Config.flambda with
begin match Config.flambda || Config.flambda2 with
| true ->
Llet(Strict, Pgenval, funcid, Lfunction handler, Lapply app)
| false ->
Expand Down
2 changes: 1 addition & 1 deletion ocaml/parsing/builtin_attributes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ let nolabels_attribute attr =
let flambda_o3_attribute attr =
clflags_attribute_without_payload' attr
~name:"flambda_o3"
~f:(fun () -> if Config.flambda then Clflags.set_o3 ())
~f:(fun () -> if Config.flambda || Config.flambda2 then Clflags.set_o3 ())

let inline_attribute attr =
if String.equal attr.attr_name.txt "inline"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ let () =
check_noalloc "unbox only if useful" unbox_only_if_useful;
check_noalloc "ignore useless args" ignore_useless_args;

(* CR xclerc for lukemaurer: enable these test for both flambda 1 and 2. *)
if Config.flambda then begin
check_noalloc "float and int32 record" unbox_record;
check_noalloc "eliminate intermediate immutable float record"
Expand Down

0 comments on commit 0cc87aa

Please sign in to comment.