diff options
author | Erick Tryzelaar <idadesub@users.sourceforge.net> | 2010-03-03 23:51:34 +0000 |
---|---|---|
committer | Erick Tryzelaar <idadesub@users.sourceforge.net> | 2010-03-03 23:51:34 +0000 |
commit | 7eb4beb4cd545c78e911add2c4497c0d1b4cf1ee (patch) | |
tree | dd72f8fd1d28bf7cd35ef8181e01bfcb40c355d6 /bindings/ocaml | |
parent | 9c7c566efe4b942ed8597156bf66e9abf98c79b5 (diff) |
Expose the rest of the llvm-c scalar opts to ocaml.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml')
-rw-r--r-- | bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml | 59 | ||||
-rw-r--r-- | bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli | 91 | ||||
-rw-r--r-- | bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c | 96 |
3 files changed, 226 insertions, 20 deletions
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml index b4563b716a..5699152b5a 100644 --- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml +++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml @@ -10,9 +10,38 @@ external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_constant_propagation" -external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t - -> unit - = "llvm_add_instruction_combining" +external add_sccp : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_sccp" +external add_dead_store_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_dead_store_elimination" +external add_aggressive_dce : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_aggressive_dce" +external +add_scalar_repl_aggregation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_scalar_repl_aggregation" +external add_ind_var_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_ind_var_simplification" +external +add_instruction_combination : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_instruction_combination" +external add_licm : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_licm" +external add_loop_unswitch : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_unswitch" +external add_loop_unroll : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_unroll" +external add_loop_rotation : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_rotation" +external add_loop_index_split : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_index_split" external add_memory_to_register_promotion : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit @@ -21,12 +50,26 @@ 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 +external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_reassociation" -external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t - -> unit - = "llvm_add_gvn" +external add_jump_threading : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_jump_threading" external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_cfg_simplification" +external +add_tail_call_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_tail_call_elimination" +external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_gvn" +external add_memcpy_opt : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_memcpy_opt" +external add_loop_deletion : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_deletion" +external +add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_lib_call_simplification" diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli index 6fcce0432d..9f95fbce9f 100644 --- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli +++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli @@ -17,10 +17,59 @@ external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_constant_propagation" +(** See the [llvm::createSCCPPass] function. *) +external add_sccp : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_sccp" + +(** See [llvm::createDeadStoreEliminationPass] function. *) +external add_dead_store_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_dead_store_elimination" + +(** See The [llvm::createAggressiveDCEPass] function. *) +external add_aggressive_dce : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_aggressive_dce" + +(** See the [llvm::createScalarReplAggregatesPass] function. *) +external +add_scalar_repl_aggregation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_scalar_repl_aggregation" + +(** See the [llvm::createIndVarSimplifyPass] function. *) +external add_ind_var_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_ind_var_simplification" + (** See the [llvm::createInstructionCombiningPass] function. *) -external add_instruction_combining : [<Llvm.PassManager.any] Llvm.PassManager.t - -> unit - = "llvm_add_instruction_combining" +external +add_instruction_combination : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_instruction_combination" + +(** See the [llvm::createLICMPass] function. *) +external add_licm : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_licm" + +(** See the [llvm::createLoopUnswitchPass] function. *) +external add_loop_unswitch : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_unswitch" + +(** See the [llvm::createLoopUnrollPass] function. *) +external add_loop_unroll : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_unroll" + +(** See the [llvm::createLoopRotatePass] function. *) +external add_loop_rotation : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_rotation" + +(** See the [llvm::createLoopIndexSplitPass] function. *) +external add_loop_index_split : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_index_split" (** See the [llvm::createPromoteMemoryToRegisterPass] function. *) external @@ -35,16 +84,40 @@ add_memory_to_register_demotion : [<Llvm.PassManager.any] Llvm.PassManager.t = "llvm_add_memory_to_register_demotion" (** See the [llvm::createReassociatePass] function. *) -external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t - -> unit +external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_reassociation" -(** See the [llvm::createGVNPass] function. *) -external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t - -> unit - = "llvm_add_gvn" +(** See the [llvm::createJumpThreadingPass] function. *) +external add_jump_threading : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_jump_threading" (** See the [llvm::createCFGSimplificationPass] function. *) external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit = "llvm_add_cfg_simplification" + +(** See the [llvm::createTailCallEliminationPass] function. *) +external +add_tail_call_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_tail_call_elimination" + +(** See the [llvm::createGVNPass] function. *) +external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_gvn" + +(** See the [llvm::createMemCpyOptPass] function. *) +external add_memcpy_opt : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_memcpy_opt" + +(** See the [llvm::createLoopDeletionPass] function. *) +external add_loop_deletion : [<Llvm.PassManager.any] Llvm.PassManager.t + -> unit + = "llvm_add_loop_deletion" + +(** See the [llvm::createSimplifyLibCallsPass] function. *) +external +add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit + = "llvm_add_lib_call_simplification" diff --git a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c index 87c1060984..c20bdde575 100644 --- a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c +++ b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c @@ -26,12 +26,72 @@ CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) { } /* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ -CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) { +CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) { + LLVMAddSCCPPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) { + LLVMAddDeadStoreEliminationPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) { + LLVMAddAggressiveDCEPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_scalar_repl_aggregation(LLVMPassManagerRef PM) { + LLVMAddScalarReplAggregatesPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_ind_var_simplification(LLVMPassManagerRef PM) { + LLVMAddIndVarSimplifyPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_instruction_combination(LLVMPassManagerRef PM) { LLVMAddInstructionCombiningPass(PM); return Val_unit; } /* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_licm(LLVMPassManagerRef PM) { + LLVMAddLICMPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) { + LLVMAddLoopUnrollPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) { + LLVMAddLoopUnrollPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_loop_rotation(LLVMPassManagerRef PM) { + LLVMAddLoopRotatePass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_loop_index_split(LLVMPassManagerRef PM) { + LLVMAddLoopIndexSplitPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) { LLVMAddPromoteMemoryToRegisterPass(PM); return Val_unit; @@ -50,8 +110,8 @@ CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) { } /* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ -CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) { - LLVMAddGVNPass(PM); +CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) { + LLVMAddJumpThreadingPass(PM); return Val_unit; } @@ -60,3 +120,33 @@ CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) { LLVMAddCFGSimplificationPass(PM); return Val_unit; } + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) { + LLVMAddTailCallEliminationPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) { + LLVMAddGVNPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) { + LLVMAddMemCpyOptPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) { + LLVMAddLoopDeletionPass(PM); + return Val_unit; +} + +/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */ +CAMLprim value llvm_add_lib_call_simplification(LLVMPassManagerRef PM) { + LLVMAddSimplifyLibCallsPass(PM); + return Val_unit; +} |