Skip to content
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

feat: Add gufa & gufa_optimizing passes #180

Merged
merged 1 commit into from Jan 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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