Skip to content

Commit

Permalink
feat: Add new optimization passes
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jul 15, 2023
1 parent c72d453 commit 88d297c
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/passes.ml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ let dae = "dae"
(** removes arguments to calls in an lto-like manner, and optimizes where we removed *)
let dae_optimizing = "dae-optimizing"

(** refine and merge abstract (never-created) types *)
let abstract_type_refining = "abstract-type-refining"

(** reduce # of locals by coalescing *)
let coalesce_locals = "coalesce-locals"

Expand Down Expand Up @@ -199,6 +202,10 @@ let monomorphize_always = "monomorphize-always"
(** combines multiple memories into a single memory *)
let multi_memory_lowering = "multi-memory-lowering"

(** combines multiple memories into a single memory, trapping if the read or write is larger than the length of the memory's data *)
let multi_memory_lowering_with_bounds_checks =
"multi-memory-lowering-with-bounds-checks"

(** name list *)
let nm = "nm"

Expand Down Expand Up @@ -287,6 +294,9 @@ let remove_unused_nonfunction_module_elements =
(** removes names from locations that are never branched to *)
let remove_unused_names = "remove-unused-names"

(** remove unused private GC types *)
let remove_unused_types = "remove-unused-types"

(** sorts functions by access frequency *)
let reorder_functions = "reorder-functions"

Expand Down Expand Up @@ -386,6 +396,12 @@ let trap_mode_clamp = "trap-mode-clamp"
(** replace trapping operations with js semantics *)
let trap_mode_js = "trap-mode-js"

(** merge types to their supertypes where possible *)
let type_merging = "type-merging"

(** create new nominal types to help other optimizations *)
let type_ssa = "type-ssa"

(** removes local.tees, replacing them with sets and gets *)
let untee = "untee"

Expand Down
15 changes: 15 additions & 0 deletions src/passes.mli
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ val dae : t
val dae_optimizing : t
(** removes arguments to calls in an lto-like manner, and optimizes where we removed *)

val abstract_type_refining : t
(** refine and merge abstract (never-created) types *)

val coalesce_locals : t
(** reduce # of locals by coalescing *)

Expand Down Expand Up @@ -198,6 +201,9 @@ val monomorphize_always : t
val multi_memory_lowering : t
(** combines multiple memories into a single memory *)

val multi_memory_lowering_with_bounds_checks : t
(** combines multiple memories into a single memory, trapping if the read or write is larger than the length of the memory's data *)

val nm : t
(** name list *)

Expand Down Expand Up @@ -285,6 +291,9 @@ val remove_unused_nonfunction_module_elements : t
val remove_unused_names : t
(** removes names from locations that are never branched to *)

val remove_unused_types : t
(** remove unused private GC types *)

val reorder_functions : t
(** sorts functions by access frequency *)

Expand Down Expand Up @@ -384,6 +393,12 @@ val trap_mode_clamp : t
val trap_mode_js : t
(** replace trapping operations with js semantics *)

val type_merging : t
(** merge types to their supertypes where possible *)

val type_ssa : t
(** create new nominal types to help other optimizations *)

val untee : t
(** removes local.tees, replacing them with sets and gets *)

Expand Down

0 comments on commit 88d297c

Please sign in to comment.