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
This commit is contained in:
Erick Tryzelaar 2010-03-03 23:51:34 +00:00
parent 9c7c566efe
commit 7eb4beb4cd
4 changed files with 247 additions and 24 deletions

View File

@ -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"

View File

@ -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::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::createCFGSimplificationPass] function. *)
external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
-> unit
= "llvm_add_cfg_simplification"
(** 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"

View File

@ -26,11 +26,71 @@ 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);
@ -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;
}

View File

@ -37,11 +37,28 @@ let test_transforms () =
ignore (PassManager.create_function m
++ TargetData.add td
++ add_instruction_combining
++ add_reassociation
++ add_gvn
++ add_cfg_simplification
++ add_constant_propagation
++ add_sccp
++ add_dead_store_elimination
++ add_aggressive_dce
++ add_scalar_repl_aggregation
++ add_ind_var_simplification
++ add_instruction_combination
++ add_licm
++ add_loop_unswitch
++ add_loop_unroll
++ add_loop_rotation
++ add_loop_index_split
++ add_memory_to_register_promotion
++ add_memory_to_register_demotion
++ add_reassociation
++ add_jump_threading
++ add_cfg_simplification
++ add_tail_call_elimination
++ add_gvn
++ add_memcpy_opt
++ add_loop_deletion
++ add_lib_call_simplification
++ PassManager.initialize
++ PassManager.run_function fn
++ PassManager.finalize