Skip to content

Commit 0e8b9f0

Browse files
authored
flambda-backend: Extend conditions to include flambda2 (#115)
* Extend conditions to include flambda2. * Make `[@unrolled]` flambda2-compatible. * Add CR to enable test for flambda2 compilers.
1 parent 99870c8 commit 0e8b9f0

File tree

4 files changed

+4
-3
lines changed

4 files changed

+4
-3
lines changed

lambda/translattribute.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ let is_inline_attribute = function
2323

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

2929
let is_specialise_attribute = function

lambda/translcore.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -667,7 +667,7 @@ and transl_exp0 ~in_new_scope ~scopes e =
667667
ap_probe = Some {name};
668668
}
669669
in
670-
begin match Config.flambda with
670+
begin match Config.flambda || Config.flambda2 with
671671
| true ->
672672
Llet(Strict, Pgenval, funcid, Lfunction handler, Lapply app)
673673
| false ->

parsing/builtin_attributes.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ let nolabels_attribute attr =
345345
let flambda_o3_attribute attr =
346346
clflags_attribute_without_payload' attr
347347
~name:"flambda_o3"
348-
~f:(fun () -> if Config.flambda then Clflags.set_o3 ())
348+
~f:(fun () -> if Config.flambda || Config.flambda2 then Clflags.set_o3 ())
349349

350350
let inline_attribute attr =
351351
if String.equal attr.attr_name.txt "inline"

testsuite/tests/float-unboxing/float_subst_boxed_number.ml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ let () =
176176
check_noalloc "unbox only if useful" unbox_only_if_useful;
177177
check_noalloc "ignore useless args" ignore_useless_args;
178178

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

0 commit comments

Comments
 (0)