Skip to content

For testing #3833

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 56 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
f7586bc
Propagate effects info to Cfg.external_call_operation (#3765)
mshinwell Mar 31, 2025
cb8c355
Mark Obj_dup as not having effects and handle in Cfg (#3766)
mshinwell Mar 31, 2025
9cecf95
github ci jobs with debug runtime for macos (#3744)
gretay-js Mar 31, 2025
4d1240f
github ci actions on arm64 linux (#3745)
gretay-js Mar 31, 2025
65c8bc8
Merge `_utils` module (backend) (#3767)
xclerc Mar 31, 2025
ddd6e08
Avoid uncaught `Not_found` arising from free vars in probes (#3776)
lukemaurer Apr 1, 2025
f7364cf
Remove .mlp File from the Arm Backend (#3771)
spiessimon Apr 1, 2025
8e1748e
Add cfg invariants pass (#657)
gretay-js Apr 1, 2025
da0a241
Remove Select_utils.common_selector (#3783)
mshinwell Apr 2, 2025
dcd0d26
Revert "Merge atomic counter inc/dec functions and use them consisten…
mshinwell Apr 2, 2025
51104de
Rename sub_cfg instance variable -> current_sub_cfg (#3788)
mshinwell Apr 2, 2025
22d7822
Remove backend/dune (#3786)
gretay-js Apr 2, 2025
f025167
Revert "Avoid checking pending actions in Condition.wait (#3741)" (#3…
stedolan Apr 2, 2025
5f3b444
Pass around "sub_cfg" in Cfg_selectgen (#3792)
mshinwell Apr 2, 2025
d914311
Refactor stack classes (#3784)
xclerc Apr 2, 2025
9e0a8fe
Delete uses of `Reg.anonymous` (#3793)
TheNumbat Apr 3, 2025
3fd4b3b
Remove the current_sub_cfg instance variable (#3795)
mshinwell Apr 3, 2025
1a9ec8f
Clean up regalloc jobs (CI) (#3787)
xclerc Apr 3, 2025
f3b0cfb
Use caml_array_blit for %arrayblit on Pgenarray and Paddrarray (#3760)
mshinwell Apr 3, 2025
488f30e
Introduce Or_never_returns in Cfg_selectgen (#3798)
mshinwell Apr 3, 2025
82d9705
Compiler Compare Script (#3779)
spiessimon Apr 3, 2025
6f69bbe
Add new interface for target-specific selection code (#3800)
mshinwell Apr 3, 2025
3f67408
Cfg_selectgen emit_expr tidyups etc (#3799)
mshinwell Apr 3, 2025
bb6b65a
Move code from Cfg_selectgen to Select_utils etc (#3801)
mshinwell Apr 3, 2025
cf91b80
Cfg_selectgen: move code around (#3802)
mshinwell Apr 3, 2025
ce76ff7
New version of Cfg_selectgen.emit_stores (#3803)
mshinwell Apr 4, 2025
c7d2ec1
Remove objects from CSE code (#3806)
mshinwell Apr 4, 2025
ca1b65f
Remove objects from instruction selection code (#3782)
mshinwell Apr 4, 2025
ce96f37
Extend ARM DSL and use it for the emission of more instructions (Part…
spiessimon Apr 4, 2025
986dc5f
Specific instructions cannot raise (#3811)
gretay-js Apr 4, 2025
ee49613
Use the same verbose parameter for all register allocators (#3769)
xclerc Apr 7, 2025
8c435c3
Tidying up in Cfg_selectgen (#3815)
mshinwell Apr 7, 2025
c233e29
Improve compiler comparison script (#3818)
spiessimon Apr 7, 2025
d6f1350
Remove all objects from ocamltest (#3821)
lukemaurer Apr 8, 2025
dde9349
Remove Cmm.kind_for_unboxing (#3817)
mshinwell Apr 8, 2025
cd16a28
Remove cvt_emit (#3816)
spiessimon Apr 8, 2025
ba8ed94
Tweak logging code of register allocators (#3822)
xclerc Apr 8, 2025
d67ee12
Simplify the logging logic (register allocators) (#3777)
xclerc Apr 8, 2025
e7ad7a7
Merge `Simple_operation` into `Operation` (#3805)
xclerc Apr 8, 2025
f2aaa29
Remove reference to `simple_operation.ml*` in `.ocamlformat-enable` (…
xclerc Apr 8, 2025
d877934
Fix Weak.set on arm64 (and other relaxed architectures) (#3819)
stedolan Apr 8, 2025
5d6a0f6
Move `Substitution` to a dedicated top-level module (#3700)
xclerc Apr 9, 2025
1772d2b
Small cleanup changes in emit.ml (#3827)
spiessimon Apr 9, 2025
ea238dc
Linscan: use doubly-linked lists for intervals (#3737)
xclerc Apr 9, 2025
252c53e
Linscan: keep only the doubly-linked lists (#3751)
xclerc Apr 9, 2025
d106170
Extend ARM DSL and use it for the emission of more instructions (Part…
spiessimon Apr 9, 2025
2c028b3
Refactor peephole pass (#3797)
gretay-js Apr 9, 2025
be12560
Avoid polymorphic comparison in `backend` (#3649)
xclerc Apr 9, 2025
4fc47a8
Format emit.ml (#3831)
gretay-js Apr 9, 2025
1f6e829
Fix a soundness bug in Simplif (#3832)
stedolan Apr 10, 2025
12ea397
runtime events: disable flaky test (#3830)
gretay-js Apr 10, 2025
5ef70c1
Cfg_simplify pass (#3768)
gretay-js Apr 10, 2025
09d0685
no need for sigwait check as posix signals suffice (#3256)
avsm Apr 10, 2025
b731c0c
Enable cfg invariants and dead trap handler elimination by default
gretay-js Apr 2, 2025
85d4e30
Fix bug in flag
gretay-js Apr 21, 2025
d756cef
Remove fatal_error
gretay-js Apr 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Remove objects from CSE code (#3806)
  • Loading branch information
mshinwell authored and gretay-js committed Apr 21, 2025
commit c7d2ec12743eb095bc8d26e03f1527588d71c123
1 change: 1 addition & 0 deletions asmcomp/asmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,7 @@ let available_regs ~stack_slots ~f x =

let compile_cfg ppf_dump ~funcnames fd_cmm cfg_with_layout =
let register_allocator = register_allocator fd_cmm in
let module CSE = Cfg_cse.Cse_generic (CSE) in
let cfg_with_infos =
cfg_with_layout
++ (fun cfg_with_layout ->
Expand Down
46 changes: 20 additions & 26 deletions backend/amd64/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,45 +12,40 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)
[@@@ocaml.warning "+4"]
[@@@ocaml.warning "+a-30-40-41-42"]

open! Int_replace_polymorphic_compare
open! Int_replace_polymorphic_compare [@@ocaml.warning "-66"]

(* CSE for the AMD64 *)

open Arch

let of_simd_class (cl : Simd.operation_class) : Cfg_cse.op_class =
let of_simd_class (cl : Simd.operation_class) : Cfg_cse_target_intf.op_class =
match cl with
| Pure -> Op_pure
| Load { is_mutable = true } -> Op_load Mutable
| Load { is_mutable = false } -> Op_load Immutable

class cfg_cse = object

inherit Cfg_cse.cse_generic as super

method! class_of_operation
: Operation.t -> Cfg_cse.op_class
= fun op ->
let class_of_operation (op : Operation.t)
: Cfg_cse_target_intf.class_of_operation_result =
match op with
| Specific spec ->
| Specific spec ->
begin match spec with
| Ilea _ | Isextend32 | Izextend32 -> Op_pure
| Istore_int(_, _, is_asg) -> Op_store is_asg
| Ioffset_loc(_, _) -> Op_store true
| Ifloatarithmem _ -> Op_load Mutable
| Ibswap _ -> super#class_of_operation op
| Ilea _ | Isextend32 | Izextend32 -> Class Op_pure
| Istore_int(_, _, is_asg) -> Class (Op_store is_asg)
| Ioffset_loc(_, _) -> Class (Op_store true)
| Ifloatarithmem _ -> Class (Op_load Mutable)
| Ibswap _ -> Use_default
| Irdtsc | Irdpmc
| Ilfence | Isfence | Imfence -> Op_other
| Ilfence | Isfence | Imfence -> Class Op_other
| Isimd op ->
of_simd_class (Simd.class_of_operation op)
Class (of_simd_class (Simd.class_of_operation op))
| Isimd_mem (op,_addr) ->
of_simd_class (Simd.Mem.class_of_operation op)
Class (of_simd_class (Simd.Mem.class_of_operation op))
| Ipause
| Icldemote _
| Iprefetch _ -> Op_other
end
| Iprefetch _ -> Class Op_other
end
| Move | Spill | Reload
| Floatop _
| Csel _
Expand All @@ -61,9 +56,8 @@ class cfg_cse = object
| Intop _ | Intop_imm _ | Intop_atomic _
| Name_for_debugger _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Poll | Dls_get
-> super#class_of_operation op

end
-> Use_default

let cfg_with_layout cfg_with_layout =
(new cfg_cse)#cfg_with_layout cfg_with_layout
let is_cheap_operation _op
: Cfg_cse_target_intf.is_cheap_operation_result =
Use_default
109 changes: 54 additions & 55 deletions backend/arm64/CSE.ml
Original file line number Diff line number Diff line change
Expand Up @@ -12,67 +12,66 @@
(* special exception on linking described in the file LICENSE. *)
(* *)
(**************************************************************************)

[@@@ocaml.warning "+a-40-41-42"]

(* CSE for ARM64 *)

open! Int_replace_polymorphic_compare

let of_simd_class (cl : Simd.operation_class) : Cfg_cse.op_class =
let of_simd_class (cl : Simd.operation_class) : Cfg_cse_target_intf.op_class =
match cl with
| Pure -> Op_pure

class cfg_cse = object

inherit Cfg_cse.cse_generic as super

method! class_of_operation op =
match op with
| Specific spec ->
(match spec with
| Ifar_poll
| Ifar_alloc _
| Ishiftarith _
| Imuladd
| Imulsub
| Inegmulf
| Imuladdf
| Inegmuladdf
| Imulsubf
| Inegmulsubf
| Isqrtf
| Ibswap _
| Imove32
| Isignext _ -> Op_pure
| Isimd op -> of_simd_class (Simd.class_of_operation op))
| Move | Spill | Reload
| Floatop _
| Csel _
| Reinterpret_cast _ | Static_cast _
| Const_int _ | Const_float32 _ | Const_float _
| Const_symbol _ | Const_vec128 _
| Stackoffset _ | Load _ | Store _ | Alloc _
| Intop _ | Intop_imm _ | Intop_atomic _
| Name_for_debugger _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Poll | Dls_get
-> super#class_of_operation op

method! is_cheap_operation op =
match op with
| Const_int n -> Nativeint.compare n 65535n <= 0 && Nativeint.compare n 0n >= 0
| Specific _
| Move | Spill | Reload
| Floatop _
| Csel _
| Reinterpret_cast _ | Static_cast _
| Const_float32 _ | Const_float _
| Const_symbol _ | Const_vec128 _
| Stackoffset _ | Load _ | Store _ | Alloc _
| Intop _ | Intop_imm _ | Intop_atomic _
| Name_for_debugger _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Poll | Dls_get
-> false

end
let class_of_operation (op : Operation.t)
: Cfg_cse_target_intf.class_of_operation_result =
match op with
| Specific spec ->
let op_class : Cfg_cse_target_intf.op_class =
match spec with
| Ifar_poll
| Ifar_alloc _
| Ishiftarith _
| Imuladd
| Imulsub
| Inegmulf
| Imuladdf
| Inegmuladdf
| Imulsubf
| Inegmulsubf
| Isqrtf
| Ibswap _
| Imove32
| Isignext _ -> Op_pure
| Isimd op -> of_simd_class (Simd.class_of_operation op)
in
Class op_class
| Move | Spill | Reload
| Floatop _
| Csel _
| Reinterpret_cast _ | Static_cast _
| Const_int _ | Const_float32 _ | Const_float _
| Const_symbol _ | Const_vec128 _
| Stackoffset _ | Load _ | Store _ | Alloc _
| Intop _ | Intop_imm _ | Intop_atomic _
| Name_for_debugger _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Poll | Dls_get
-> Use_default

let cfg_with_layout cfg_with_layout =
(new cfg_cse)#cfg_with_layout cfg_with_layout
let is_cheap_operation (op : Operation.t)
: Cfg_cse_target_intf.is_cheap_operation_result =
match op with
| Const_int n ->
Cheap (Nativeint.compare n 65535n <= 0 && Nativeint.compare n 0n >= 0)
| Specific _
| Move | Spill | Reload
| Floatop _
| Csel _
| Reinterpret_cast _ | Static_cast _
| Const_float32 _ | Const_float _
| Const_symbol _ | Const_vec128 _
| Stackoffset _ | Load _ | Store _ | Alloc _
| Intop _ | Intop_imm _ | Intop_atomic _
| Name_for_debugger _ | Probe_is_enabled _ | Opaque
| Begin_region | End_region | Poll | Dls_get
-> Cheap false
Loading