Skip to content

Commit

Permalink
feat: Add gufa & gufa_optimizing passes (#180)
Browse files Browse the repository at this point in the history
  • Loading branch information
phated committed Jan 18, 2023
1 parent becd3b8 commit 7395a1f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 5 deletions.
10 changes: 8 additions & 2 deletions src/passes.ml
Expand Up @@ -87,11 +87,17 @@ let generate_stack_ir = "generate-stack-ir"
(** refine the types of globals *)
let global_refining = "global-refining"

(** globally optimize struct values *)
let gsi = "gsi"

(** globally optimize GC types *)
let gto = "gto"

(** globally optimize struct values *)
let gsi = "gsi"
(** Grand Unified Flow Analysis: optimize the entire program using information about what content can actually appear in each location *)
let gufa = "gufa"

(** GUFA plus local optimizations in functions we modified *)
let gufa_optimizing = "gufa-optimizing"

(** apply more specific subtypes to type fields where possible *)
let type_refining = "type-refining"
Expand Down
10 changes: 8 additions & 2 deletions src/passes.mli
Expand Up @@ -87,11 +87,17 @@ val generate_stack_ir : t
val global_refining : t
(** refine the types of globals *)

val gsi : t
(** globally optimize struct values *)

val gto : t
(** globally optimize GC types *)

val gsi : t
(** globally optimize struct values *)
val gufa : t
(** Grand Unified Flow Analysis: optimize the entire program using information about what content can actually appear in each location *)

val gufa_optimizing : t
(** GUFA plus local optimizations in functions we modified *)

val type_refining : t
(** apply more specific subtypes to type fields where possible *)
Expand Down
8 changes: 7 additions & 1 deletion test/test.ml
Expand Up @@ -234,7 +234,13 @@ let new_mod = Module.read byts

let _ =
Module.run_passes new_mod
[ Passes.name_types; Passes.merge_similar_functions; Passes.spill_pointers ]
[
Passes.name_types;
Passes.merge_similar_functions;
Passes.spill_pointers;
Passes.gufa;
Passes.gufa_optimizing;
]

let _ =
Module.set_features new_mod
Expand Down

0 comments on commit 7395a1f

Please sign in to comment.