aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bindings/ocaml/transforms/ipo/ipo_ocaml.c6
-rw-r--r--bindings/ocaml/transforms/ipo/llvm_ipo.ml2
-rw-r--r--bindings/ocaml/transforms/ipo/llvm_ipo.mli4
-rw-r--r--test/Bindings/Ocaml/ipo_opts.ml1
4 files changed, 13 insertions, 0 deletions
diff --git a/bindings/ocaml/transforms/ipo/ipo_ocaml.c b/bindings/ocaml/transforms/ipo/ipo_ocaml.c
index 496dc15..4ad8afb 100644
--- a/bindings/ocaml/transforms/ipo/ipo_ocaml.c
+++ b/bindings/ocaml/transforms/ipo/ipo_ocaml.c
@@ -50,6 +50,12 @@ CAMLprim value llvm_add_function_inlining(LLVMPassManagerRef PM) {
}
/* [`Module] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_always_inliner(LLVMPassManagerRef PM) {
+ LLVMAddAlwaysInlinerPass(PM);
+ return Val_unit;
+}
+
+/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_always_inliner_pass(LLVMPassManagerRef PM) {
LLVMAddAlwaysInlinerPass(PM);
return Val_unit;
diff --git a/bindings/ocaml/transforms/ipo/llvm_ipo.ml b/bindings/ocaml/transforms/ipo/llvm_ipo.ml
index e895c7a..93f564a 100644
--- a/bindings/ocaml/transforms/ipo/llvm_ipo.ml
+++ b/bindings/ocaml/transforms/ipo/llvm_ipo.ml
@@ -17,6 +17,8 @@ external add_function_attrs : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_function_attrs"
external add_function_inlining : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_function_inlining"
+external add_always_inliner : [ | `Module ] Llvm.PassManager.t -> unit =
+ "llvm_add_always_inliner"
external add_global_dce : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_global_dce"
external add_global_optimizer : [ | `Module ] Llvm.PassManager.t -> unit =
diff --git a/bindings/ocaml/transforms/ipo/llvm_ipo.mli b/bindings/ocaml/transforms/ipo/llvm_ipo.mli
index 68f7c0e..1944c30 100644
--- a/bindings/ocaml/transforms/ipo/llvm_ipo.mli
+++ b/bindings/ocaml/transforms/ipo/llvm_ipo.mli
@@ -32,6 +32,10 @@ external add_function_attrs : [ | `Module ] Llvm.PassManager.t -> unit =
external add_function_inlining : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_function_inlining"
+(** See llvm::createAlwaysInlinerPass function. *)
+external add_always_inliner : [ | `Module ] Llvm.PassManager.t -> unit =
+ "llvm_add_always_inliner"
+
(** See llvm::createGlobalDCEPass function. *)
external add_global_dce : [ | `Module ] Llvm.PassManager.t -> unit =
"llvm_add_global_dce"
diff --git a/test/Bindings/Ocaml/ipo_opts.ml b/test/Bindings/Ocaml/ipo_opts.ml
index 69577df..d67a9e0 100644
--- a/test/Bindings/Ocaml/ipo_opts.ml
+++ b/test/Bindings/Ocaml/ipo_opts.ml
@@ -55,6 +55,7 @@ let test_transforms () =
++ add_dead_arg_elimination
++ add_function_attrs
++ add_function_inlining
+ ++ add_always_inliner
++ add_global_dce
++ add_global_optimizer
++ add_ipc_propagation