diff options
author | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-03-20 17:16:03 +0000 |
---|---|---|
committer | Gordon Henriksen <gordonhenriksen@mac.com> | 2008-03-20 17:16:03 +0000 |
commit | 69cf031ee33fc564c3888694cb1cd8ab5dae9fd2 (patch) | |
tree | 40d3bd06709555df036b06357b80f04785c7f5e4 /bindings | |
parent | 52d34d94c8890870350dad922678c03640ab310f (diff) |
C and Objective Caml bindings for mem2reg and reg2mem.
Patch by Erick Tryzelaar.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48602 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings')
-rw-r--r-- | bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml | 8 | ||||
-rw-r--r-- | bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli | 12 | ||||
-rw-r--r-- | bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c | 12 |
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; |