aboutsummaryrefslogtreecommitdiff
path: root/bindings
diff options
context:
space:
mode:
Diffstat (limited to 'bindings')
-rw-r--r--bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml8
-rw-r--r--bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli12
-rw-r--r--bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c12
3 files changed, 32 insertions, 0 deletions
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
index 8b6b7f9879..b4563b716a 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
@@ -13,6 +13,14 @@ external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t
external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t
-> unit
= "llvm_add_instruction_combining"
+external
+add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
+ -> unit
+ = "llvm_add_memory_to_register_promotion"
+external
+add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
+ -> unit
+ = "llvm_add_memory_to_register_demotion"
external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t
-> unit
= "llvm_add_reassociation"
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
index 19efaa015e..6fcce0432d 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
@@ -22,6 +22,18 @@ external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t
-> unit
= "llvm_add_instruction_combining"
+(** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
+external
+add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t
+ -> unit
+ = "llvm_add_memory_to_register_promotion"
+
+(** See the [llvm::createDemoteMemoryToRegisterPass] function. *)
+external
+add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t
+ -> unit
+ = "llvm_add_memory_to_register_demotion"
+
(** See the [llvm::createReassociatePass] function. *)
external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t
-> unit
diff --git a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
index 5ceb3699cc..87c1060984 100644
--- a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
+++ b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
@@ -32,6 +32,18 @@ CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
+ LLVMAddPromoteMemoryToRegisterPass(PM);
+ return Val_unit;
+}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) {
+ LLVMAddDemoteMemoryToRegisterPass(PM);
+ return Val_unit;
+}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
LLVMAddReassociatePass(PM);
return Val_unit;