Skip to content

Commit 59abd4b

Browse files
committed
Merge branch 'nroberts/mixed-blocks' into nroberts/mixed-blocks-runtime-4
2 parents fb73f82 + ef9a081 commit 59abd4b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

79 files changed

+14300
-14253
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ This repository is for more experimental work, of production quality, on the mid
44
and backend of the OCaml compiler.
55
This is also the home of the Flambda 2 optimiser and the Cfg backend.
66

7-
The Flambda backend is currently based on OCaml 4.14.1.
7+
The Flambda backend is currently based on OCaml 5.1 and supports both the OCaml 4
8+
and OCaml 5 runtime systems.
89

910
The following gives basic instructions for getting set up. Please see
1011
[`HACKING.md`](HACKING.md) for more detailed instructions if you want to develop in this repo.

backend/CSEgen.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ method class_of_operation op =
7171
| Iintop _ -> Op_pure
7272
| Iintop_imm(_, _) -> Op_pure
7373
| Iintop_atomic _ -> Op_store true
74-
| Icompf _
74+
| Ifloatop _
7575
| Icsel _
76-
| Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf | Iscalarcast _
76+
| Iscalarcast _
7777
| Ivalueofint | Iintofvalue | Ivectorcast _ -> Op_pure
7878
| Ispecific _ -> Op_other
7979
| Iname_for_debugger _ -> Op_other

backend/amd64/CSE.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ method! class_of_operation op =
4343
| Ipause
4444
| Iprefetch _ -> Op_other
4545
end
46-
| Imove | Ispill | Ireload | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
47-
| Icompf _
46+
| Imove | Ispill | Ireload
47+
| Ifloatop _
4848
| Icsel _
4949
| Ivalueofint | Iintofvalue | Ivectorcast _ | Iscalarcast _
5050
| Iconst_int _ | Iconst_float _ | Iconst_symbol _ | Iconst_vec128 _
@@ -85,8 +85,8 @@ class cfg_cse = object
8585
| Ipause
8686
| Iprefetch _ -> Op_other
8787
end
88-
| Move | Spill | Reload | Negf | Absf | Addf | Subf | Mulf | Divf
89-
| Compf _
88+
| Move | Spill | Reload
89+
| Floatop _
9090
| Csel _
9191
| Valueofint | Intofvalue | Vectorcast _ | Scalarcast _
9292
| Const_int _ | Const_float _ | Const_symbol _ | Const_vec128 _

backend/amd64/emit.mlp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,7 @@ let output_epilogue f =
676676

677677
(* Floating-point constants *)
678678

679-
let float_constants = ref ([] : (int64 * int) list)
679+
let float_constants = ref ([] : (int64 * label) list)
680680

681681
let add_float_constant cst =
682682
try
@@ -692,7 +692,7 @@ let emit_float_constant f lbl =
692692

693693
(* Vector constants *)
694694

695-
let vec128_constants = ref ([] : (Cmm.vec128_bits * int) list)
695+
let vec128_constants = ref ([] : (Cmm.vec128_bits * label) list)
696696

697697
let add_vec128_constant bits =
698698
try
@@ -1471,17 +1471,17 @@ let emit_instr fallthrough i =
14711471
instr_for_intop op (int n) (res i 0)
14721472
| Lop(Iintop_atomic{op; size; addr}) ->
14731473
emit_atomic i op size addr
1474-
| Lop(Icompf cmp) ->
1474+
| Lop(Ifloatop(Icompf cmp)) ->
14751475
let cond, need_swap = float_cond_and_need_swap cmp in
14761476
let a0, a1 = if need_swap then arg i 1, arg i 0 else arg i 0, arg i 1 in
14771477
I.cmpsd cond a1 a0;
14781478
I.movq a0 (res i 0);
14791479
I.neg (res i 0)
1480-
| Lop(Inegf) ->
1480+
| Lop(Ifloatop(Inegf)) ->
14811481
I.xorpd (mem64_rip VEC128 (emit_symbol "caml_negf_mask")) (res i 0)
1482-
| Lop(Iabsf) ->
1482+
| Lop(Ifloatop(Iabsf)) ->
14831483
I.andpd (mem64_rip VEC128 (emit_symbol "caml_absf_mask")) (res i 0)
1484-
| Lop(Iaddf | Isubf | Imulf | Idivf as floatop) ->
1484+
| Lop(Ifloatop(Iaddf | Isubf | Imulf | Idivf as floatop)) ->
14851485
instr_for_floatop floatop (arg i 1) (res i 0)
14861486
| Lop(Iintofvalue | Ivalueofint | Ivectorcast Bits128) ->
14871487
move i.arg.(0) i.res.(0)

backend/amd64/proc.ml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -449,8 +449,7 @@ let destroyed_at_oper = function
449449
| Iop(Istore((Byte_unsigned | Byte_signed | Sixteen_unsigned | Sixteen_signed
450450
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val
451451
| Double | Onetwentyeight_aligned | Onetwentyeight_unaligned), _, _))
452-
| Iop(Imove | Ispill | Ireload | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
453-
| Icompf _
452+
| Iop(Imove | Ispill | Ireload | Ifloatop _
454453
| Icsel _
455454
| Ivalueofint | Iintofvalue
456455
| Ivectorcast _ | Iscalarcast _
@@ -502,8 +501,7 @@ let destroyed_at_basic (basic : Cfg_intf.S.basic) =
502501
| Intop_imm ((Iadd | Isub | Imul | Imulh _ | Iand | Ior | Ixor
503502
| Ilsl | Ilsr | Iasr | Ipopcnt | Iclz _ | Ictz _),_)
504503
| Intop_atomic _
505-
| Negf | Absf | Addf | Subf | Mulf | Divf
506-
| Compf _
504+
| Floatop _
507505
| Csel _
508506
| Valueofint | Intofvalue
509507
| Vectorcast _
@@ -581,9 +579,8 @@ let is_destruction_point ~(more_destruction_points : bool) (terminator : Cfg_int
581579
let safe_register_pressure = function
582580
Iextcall _ -> if win64 then if fp then 7 else 8 else 0
583581
| Ialloc _ | Ipoll _ | Imove | Ispill | Ireload
584-
| Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
585582
| Ivalueofint | Iintofvalue | Ivectorcast _
586-
| Icompf _ | Iscalarcast _
583+
| Ifloatop _ | Iscalarcast _
587584
| Icsel _
588585
| Iconst_int _ | Iconst_float _ | Iconst_symbol _ | Iconst_vec128 _
589586
| Icall_ind | Icall_imm _ | Itailcall_ind | Itailcall_imm _
@@ -610,7 +607,7 @@ let max_register_pressure =
610607
consumes ~int:(1 + num_destroyed_by_plt_stub) ~float:0
611608
| Iintop(Icomp _) | Iintop_imm((Icomp _), _) ->
612609
consumes ~int:1 ~float:0
613-
| Istore(Single, _, _) | Icompf _ ->
610+
| Istore(Single, _, _) | Ifloatop (Icompf _) ->
614611
consumes ~int:0 ~float:1
615612
| Ispecific(Isimd op) ->
616613
(match Simd_proc.register_behavior op with
@@ -635,7 +632,7 @@ let max_register_pressure =
635632
| Thirtytwo_unsigned | Thirtytwo_signed | Word_int | Word_val
636633
| Double | Onetwentyeight_aligned | Onetwentyeight_unaligned),
637634
_, _)
638-
| Imove | Ispill | Ireload | Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf
635+
| Imove | Ispill | Ireload | Ifloatop (Inegf | Iabsf | Iaddf | Isubf | Imulf | Idivf)
639636
| Icsel _
640637
| Ivalueofint | Iintofvalue | Ivectorcast _ | Iscalarcast _
641638
| Iconst_int _ | Iconst_float _ | Iconst_symbol _ | Iconst_vec128 _

backend/amd64/regalloc_stack_operands.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ let unary_operation_argument_or_result_on_stack
163163

164164
let basic (map : spilled_map) (instr : Cfg.basic Cfg.instruction) =
165165
begin match instr.desc with
166-
| Op (Addf | Subf | Mulf | Divf) ->
166+
| Op (Floatop (Iaddf | Isubf | Imulf | Idivf)) ->
167167
may_use_stack_operand_for_second_argument map instr ~num_args:2 ~res_is_fst:true
168168
| Op (Specific (Isimd op)) ->
169169
(match Simd_proc.register_behavior op with
@@ -224,7 +224,7 @@ let basic (map : spilled_map) (instr : Cfg.basic Cfg.instruction) =
224224
| Op (Specific (Irdtsc | Irdpmc))
225225
| Op (Intop (Ipopcnt | Iclz _| Ictz _))
226226
| Op (Intop_atomic _)
227-
| Op (Move | Spill | Reload | Negf | Absf | Const_float _ | Const_vec128 _ | Compf _
227+
| Op (Move | Spill | Reload | Floatop (Inegf | Iabsf | Icompf _) | Const_float _ | Const_vec128 _
228228
| Stackoffset _ | Load _ | Store _ | Name_for_debugger _ | Probe_is_enabled _
229229
| Valueofint | Intofvalue | Opaque | Begin_region | End_region | Dls_get | Poll | Alloc _)
230230
| Op (Specific (Isextend32 | Izextend32 | Ilea _

backend/amd64/reload.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ method! reload_operation op arg res =
114114
Ilsl, Ilsr, Iasr: arg(1) already forced in regs *)
115115
(arg, res)
116116
| Iintop_imm ((Ipopcnt | Iclz _ | Ictz _), _) -> assert false
117-
| Iintop(Imul) | Iaddf | Isubf | Imulf | Idivf ->
117+
| Iintop(Imul) | Ifloatop(Iaddf | Isubf | Imulf | Idivf) ->
118118
(* First argument (= result) must be in register, second arg
119119
can reside in the stack *)
120120
if stackp arg.(0)
@@ -189,8 +189,8 @@ method! reload_operation op arg res =
189189
| Ipause
190190
| Ilfence | Isfence | Imfence
191191
| Iprefetch _ | Ibswap _)
192-
| Imove|Ispill|Ireload|Inegf|Iabsf|Iconst_float _|Iconst_vec128 _|Icall_ind|Icall_imm _
193-
| Icompf _
192+
| Imove|Ispill|Ireload|Iconst_float _|Iconst_vec128 _|Icall_ind|Icall_imm _
193+
| Ifloatop (Icompf _|Inegf|Iabsf)
194194
| Itailcall_ind|Itailcall_imm _|Iextcall _|Istackoffset _|Iload _
195195
| Istore (_, _, _)|Ialloc _|Iname_for_debugger _|Iprobe _|Iprobe_is_enabled _
196196
| Ivalueofint | Iintofvalue | Iopaque | Ivectorcast _

backend/amd64/selection.ml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ let _xmm0v () = phys_reg Vec128 100
9797
let pseudoregs_for_operation op arg res =
9898
match op with
9999
(* Two-address binary operations: arg.(0) and res.(0) must be the same *)
100-
Iintop(Iadd|Isub|Imul|Iand|Ior|Ixor) | Iaddf|Isubf|Imulf|Idivf ->
100+
Iintop(Iadd|Isub|Imul|Iand|Ior|Ixor) | Ifloatop(Iaddf|Isubf|Imulf|Idivf) ->
101101
([|res.(0); arg.(1)|], res)
102102
| Iintop_atomic {op = Compare_and_swap; size = _; addr = _} ->
103103
(* first arg must be rax *)
@@ -111,7 +111,7 @@ let pseudoregs_for_operation op arg res =
111111
(arg, res)
112112
(* One-address unary operations: arg.(0) and res.(0) must be the same *)
113113
| Iintop_imm((Iadd|Isub|Imul|Iand|Ior|Ixor|Ilsl|Ilsr|Iasr), _)
114-
| Iabsf | Inegf
114+
| Ifloatop(Iabsf | Inegf)
115115
| Ispecific(Ibswap { bitwidth = (Thirtytwo | Sixtyfour) }) ->
116116
(res, res)
117117
(* For xchg, args must be a register allowing access to high 8 bit register
@@ -136,7 +136,7 @@ let pseudoregs_for_operation op arg res =
136136
([| rax; rcx |], [| rax |])
137137
| Iintop(Imod) ->
138138
([| rax; rcx |], [| rdx |])
139-
| Icompf cond ->
139+
| Ifloatop(Icompf cond) ->
140140
(* CR gyorsh: make this optimization as a separate PR. *)
141141
(* We need to temporarily store the result of the comparison in a
142142
float register, but we don't want to clobber any of the inputs
@@ -405,7 +405,7 @@ method select_floatarith commutative regular_op mem_op args =
405405
(Ispecific(Ifloatarithmem(mem_op, addr)),
406406
[arg2; arg1])
407407
| [arg1; arg2] ->
408-
(regular_op, [arg1; arg2])
408+
(Ifloatop regular_op, [arg1; arg2])
409409
| _ ->
410410
assert false
411411

backend/arm64/emit.mlp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -494,17 +494,17 @@ module BR = Branch_relaxation.Make (struct
494494
| Lop (Ibeginregion | Iendregion) ->
495495
Misc.fatal_error "Local allocations not supported on this architecture"
496496
| Lop (Iintop (Icomp _)) -> 2
497-
| Lop (Icompf _) -> 2
497+
| Lop (Ifloatop (Icompf _)) -> 2
498498
| Lop (Iintop_imm (Icomp _, _)) -> 2
499499
| Lop (Iintop Imod) -> 2
500500
| Lop (Iintop (Imulh _)) -> 1
501501
| Lop (Iintop _) -> 1
502502
| Lop (Iintop_imm _) -> 1
503-
| Lop (Iabsf | Inegf | Ispecific Isqrtf) -> 1
503+
| Lop (Ifloatop (Iabsf | Inegf) | Ispecific Isqrtf) -> 1
504504
| Lop (Ivalueofint | Iintofvalue) -> 1
505505
| Lop (Ivectorcast _) -> 1
506506
| Lop (Iscalarcast _) -> 1
507-
| Lop (Iaddf | Isubf | Imulf | Idivf | Ispecific Inegmulf) -> 1
507+
| Lop (Ifloatop (Iaddf | Isubf | Imulf | Idivf) | Ispecific Inegmulf) -> 1
508508
| Lop (Iopaque) -> 0
509509
| Lop (Ispecific (Imuladdf | Inegmuladdf | Imulsubf | Inegmulsubf)) -> 1
510510
| Lop (Ispecific (Ishiftarith _)) -> 1
@@ -866,7 +866,7 @@ let emit_instr i =
866866
| Lop(Iintop(Icomp cmp)) ->
867867
` cmp {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`;
868868
` cset {emit_reg i.res.(0)}, {emit_string (name_for_comparison cmp)}\n`
869-
| Lop(Icompf cmp) ->
869+
| Lop(Ifloatop(Icompf cmp)) ->
870870
let comp = name_for_float_comparison cmp in
871871
` fcmp {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`;
872872
` cset {emit_reg i.res.(0)}, {emit_string comp}\n`
@@ -886,10 +886,10 @@ let emit_instr i =
886886
| Lop(Iintop_imm(op, n)) ->
887887
let instr = name_for_int_operation op in
888888
` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, #{emit_int n}\n`
889-
| Lop(Iabsf | Inegf | Ispecific Isqrtf as op) ->
889+
| Lop(Ifloatop (Iabsf | Inegf) | Ispecific Isqrtf as op) ->
890890
let instr = (match op with
891-
| Iabsf -> "fabs"
892-
| Inegf -> "fneg"
891+
| Ifloatop Iabsf -> "fabs"
892+
| Ifloatop Inegf -> "fneg"
893893
| Ispecific Isqrtf -> "fsqrt"
894894
| _ -> assert false) in
895895
` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}\n`
@@ -906,12 +906,12 @@ let emit_instr i =
906906
| _ ->
907907
assert false
908908
end
909-
| Lop(Iaddf | Isubf | Imulf | Idivf | Ispecific Inegmulf as op) ->
909+
| Lop(Ifloatop (Iaddf | Isubf | Imulf | Idivf) | Ispecific Inegmulf as op) ->
910910
let instr = (match op with
911-
| Iaddf -> "fadd"
912-
| Isubf -> "fsub"
913-
| Imulf -> "fmul"
914-
| Idivf -> "fdiv"
911+
| Ifloatop Iaddf -> "fadd"
912+
| Ifloatop Isubf -> "fsub"
913+
| Ifloatop Imulf -> "fmul"
914+
| Ifloatop Idivf -> "fdiv"
915915
| Ispecific Inegmulf -> "fnmul"
916916
| _ -> assert false) in
917917
` {emit_string instr} {emit_reg i.res.(0)}, {emit_reg i.arg.(0)}, {emit_reg i.arg.(1)}\n`

backend/cfg/cfg.ml

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -57,9 +57,7 @@ let rec of_cmm_codegen_option : Cmm.codegen_option list -> codegen_option list =
5757
match hd with
5858
| No_CSE -> No_CSE :: of_cmm_codegen_option tl
5959
| Reduce_code_size -> Reduce_code_size :: of_cmm_codegen_option tl
60-
| Use_linscan_regalloc | Ignore_assert_all Zero_alloc | Assume _ | Check _
61-
->
62-
of_cmm_codegen_option tl)
60+
| Use_linscan_regalloc | Assume _ | Check _ -> of_cmm_codegen_option tl)
6361

6462
type t =
6563
{ blocks : basic_block Label.Tbl.t;
@@ -270,13 +268,7 @@ let dump_op ppf = function
270268
| Intop_imm (op, n) -> Format.fprintf ppf "intop %s %d" (intop op) n
271269
| Intop_atomic { op; size = _; addr = _ } ->
272270
Format.fprintf ppf "intop atomic %s" (intop_atomic op)
273-
| Negf -> Format.fprintf ppf "negf"
274-
| Absf -> Format.fprintf ppf "absf"
275-
| Addf -> Format.fprintf ppf "addf"
276-
| Subf -> Format.fprintf ppf "subf"
277-
| Mulf -> Format.fprintf ppf "mulf"
278-
| Divf -> Format.fprintf ppf "divf"
279-
| Compf _ -> Format.fprintf ppf "compf"
271+
| Floatop op -> Format.fprintf ppf "floatop %a" Printmach.floatop op
280272
| Csel _ -> Format.fprintf ppf "csel"
281273
| Valueofint -> Format.fprintf ppf "valueofint"
282274
| Intofvalue -> Format.fprintf ppf "intofvalue"
@@ -478,13 +470,7 @@ let is_pure_operation : operation -> bool = function
478470
| Intop _ -> true
479471
| Intop_imm _ -> true
480472
| Intop_atomic _ -> false
481-
| Negf -> true
482-
| Absf -> true
483-
| Addf -> true
484-
| Subf -> true
485-
| Mulf -> true
486-
| Divf -> true
487-
| Compf _ -> true
473+
| Floatop _ -> true
488474
| Csel _ -> true
489475
| Vectorcast _ -> true
490476
| Scalarcast _ -> true
@@ -545,10 +531,9 @@ let is_noop_move instr =
545531
| Op
546532
( Const_int _ | Const_float _ | Const_symbol _ | Const_vec128 _
547533
| Stackoffset _ | Load _ | Store _ | Intop _ | Intop_imm _
548-
| Intop_atomic _ | Negf | Absf | Addf | Subf | Mulf | Divf | Compf _
549-
| Opaque | Valueofint | Intofvalue | Scalarcast _ | Probe_is_enabled _
550-
| Specific _ | Name_for_debugger _ | Begin_region | End_region | Dls_get
551-
| Poll | Alloc _ )
534+
| Intop_atomic _ | Floatop _ | Opaque | Valueofint | Intofvalue
535+
| Scalarcast _ | Probe_is_enabled _ | Specific _ | Name_for_debugger _
536+
| Begin_region | End_region | Dls_get | Poll | Alloc _ )
552537
| Reloadretaddr | Pushtrap _ | Poptrap | Prologue ->
553538
false
554539

backend/cfg/cfg_comballoc.ml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -46,10 +46,10 @@ let rec find_next_allocation : cell option -> allocation option =
4646
| Op
4747
( Move | Spill | Reload | Const_int _ | Const_float _ | Const_symbol _
4848
| Const_vec128 _ | Stackoffset _ | Load _ | Store _ | Intop _
49-
| Intop_imm _ | Intop_atomic _ | Negf | Absf | Addf | Subf | Mulf | Divf
50-
| Compf _ | Csel _ | Valueofint | Intofvalue | Vectorcast _
51-
| Scalarcast _ | Probe_is_enabled _ | Opaque | Begin_region | End_region
52-
| Specific _ | Name_for_debugger _ | Dls_get | Poll )
49+
| Intop_imm _ | Intop_atomic _ | Floatop _ | Csel _ | Valueofint
50+
| Intofvalue | Vectorcast _ | Scalarcast _ | Probe_is_enabled _ | Opaque
51+
| Begin_region | End_region | Specific _ | Name_for_debugger _ | Dls_get
52+
| Poll )
5353
| Reloadretaddr | Pushtrap _ | Poptrap | Prologue ->
5454
find_next_allocation (DLL.next cell))
5555

@@ -97,13 +97,12 @@ let find_compatible_allocations :
9797
`Pushtrap` case may be too conservative) *)
9898
{ allocations = List.rev allocations; next_cell = Some cell }
9999
| Op
100-
( Move | Spill | Reload | Negf | Absf | Addf | Subf | Mulf | Divf
101-
| Valueofint | Intofvalue | Vectorcast _ | Opaque | Const_int _
102-
| Const_float _ | Const_vec128 _ | Const_symbol _ | Stackoffset _
103-
| Load _
100+
( Move | Spill | Reload | Floatop _ | Valueofint | Intofvalue
101+
| Vectorcast _ | Opaque | Const_int _ | Const_float _ | Const_vec128 _
102+
| Const_symbol _ | Stackoffset _ | Load _
104103
| Store (_, _, _)
105-
| Compf _ | Csel _ | Specific _ | Name_for_debugger _
106-
| Probe_is_enabled _ | Scalarcast _ | Dls_get
104+
| Csel _ | Specific _ | Name_for_debugger _ | Probe_is_enabled _
105+
| Scalarcast _ | Dls_get
107106
| Intop
108107
( Iadd | Isub | Imul | Idiv | Imod | Iand | Ior | Ixor | Ilsl
109108
| Ilsr | Iasr | Ipopcnt | Imulh _ | Iclz _ | Ictz _ | Icomp _ )

backend/cfg/cfg_cse.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ class cse_generic =
8484
| Intop _ -> Op_pure
8585
| Intop_imm (_, _) -> Op_pure
8686
| Intop_atomic _ -> Op_store true
87-
| Compf _ | Csel _ | Negf | Absf | Addf | Subf | Mulf | Divf
88-
| Scalarcast _ | Valueofint | Intofvalue | Vectorcast _ ->
87+
| Floatop _ | Csel _ | Scalarcast _ | Valueofint | Intofvalue
88+
| Vectorcast _ ->
8989
Op_pure
9090
| Specific _ -> Op_other
9191
| Name_for_debugger _ -> Op_other

backend/cfg/cfg_equivalence.ml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,14 +239,8 @@ let check_operation : location -> Cfg.operation -> Cfg.operation -> unit =
239239
when Mach.equal_integer_operation left_op right_op
240240
&& Int.equal left_imm right_imm ->
241241
()
242-
| Negf, Negf -> ()
243-
| Absf, Absf -> ()
244-
| Addf, Addf -> ()
245-
| Subf, Subf -> ()
246-
| Mulf, Mulf -> ()
247-
| Divf, Divf -> ()
248-
| Compf left_comp, Compf right_comp
249-
when Cmm.equal_float_comparison left_comp right_comp ->
242+
| Floatop left_op, Floatop right_op
243+
when Mach.equal_float_operation left_op right_op ->
250244
()
251245
| Valueofint, Valueofint -> ()
252246
| Intofvalue, Intofvalue -> ()

0 commit comments

Comments
 (0)