summaryrefslogtreecommitdiff
path: root/bindings/ocaml
diff options
context:
space:
mode:
authorPeter Zotov <whitequark@whitequark.org>2014-10-29 08:15:21 +0000
committerPeter Zotov <whitequark@whitequark.org>2014-10-29 08:15:21 +0000
commit360c7ed497b73fe71e646ab094b789fe6d4c98f6 (patch)
tree350982aa3b008c806b3b8eaf4155a0f10007a43c /bindings/ocaml
parent68a70cdbfb26d089bb86e854c040937587084aec (diff)
[OCaml] Synchronize transformations with LLVM-C.
Also, rearrange the functions in a way that allows to quickly compare C headers and .mli/glue files. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@220842 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'bindings/ocaml')
-rw-r--r--bindings/ocaml/transforms/ipo/ipo_ocaml.c10
-rw-r--r--bindings/ocaml/transforms/ipo/llvm_ipo.ml70
-rw-r--r--bindings/ocaml/transforms/ipo/llvm_ipo.mli124
-rw-r--r--bindings/ocaml/transforms/passmgr_builder/llvm_passmgr_builder.mli20
-rw-r--r--bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml218
-rw-r--r--bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli260
-rw-r--r--bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c130
-rw-r--r--bindings/ocaml/transforms/vectorize/llvm_vectorize.ml15
-rw-r--r--bindings/ocaml/transforms/vectorize/llvm_vectorize.mli17
9 files changed, 479 insertions, 385 deletions
diff --git a/bindings/ocaml/transforms/ipo/ipo_ocaml.c b/bindings/ocaml/transforms/ipo/ipo_ocaml.c
index 4ad8afbc9cc..9d8fb1eb711 100644
--- a/bindings/ocaml/transforms/ipo/ipo_ocaml.c
+++ b/bindings/ocaml/transforms/ipo/ipo_ocaml.c
@@ -56,12 +56,6 @@ CAMLprim value llvm_add_always_inliner(LLVMPassManagerRef PM) {
}
/* [`Module] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_always_inliner_pass(LLVMPassManagerRef PM) {
- LLVMAddAlwaysInlinerPass(PM);
- return Val_unit;
-}
-
-/* [`Module] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_global_dce(LLVMPassManagerRef PM) {
LLVMAddGlobalDCEPass(PM);
return Val_unit;
@@ -74,7 +68,7 @@ CAMLprim value llvm_add_global_optimizer(LLVMPassManagerRef PM) {
}
/* [`Module] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_ipc_propagation(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_ip_constant_propagation(LLVMPassManagerRef PM) {
LLVMAddIPConstantPropagationPass(PM);
return Val_unit;
}
@@ -91,7 +85,7 @@ CAMLprim value llvm_add_ipsccp(LLVMPassManagerRef PM) {
return Val_unit;
}
-/* [`Module] Llvm.PassManager.t -> bool -> unit */
+/* [`Module] Llvm.PassManager.t -> all_but_main:bool -> unit */
CAMLprim value llvm_add_internalize(LLVMPassManagerRef PM, value AllButMain) {
LLVMAddInternalizePass(PM, Bool_val(AllButMain));
return Val_unit;
diff --git a/bindings/ocaml/transforms/ipo/llvm_ipo.ml b/bindings/ocaml/transforms/ipo/llvm_ipo.ml
index 93f564a1257..1af7d67eac5 100644
--- a/bindings/ocaml/transforms/ipo/llvm_ipo.ml
+++ b/bindings/ocaml/transforms/ipo/llvm_ipo.ml
@@ -7,31 +7,45 @@
*
*===----------------------------------------------------------------------===*)
-external add_argument_promotion : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_argument_promotion"
-external add_constant_merge : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_constant_merge"
-external add_dead_arg_elimination :
- [ | `Module ] Llvm.PassManager.t -> unit = "llvm_add_dead_arg_elimination"
-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 =
- "llvm_add_global_optimizer"
-external add_ipc_propagation : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_ipc_propagation"
-external add_prune_eh : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_prune_eh"
-external add_ipsccp : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_ipsccp"
-external add_internalize : [ | `Module ] Llvm.PassManager.t -> bool -> unit =
- "llvm_add_internalize"
-external add_strip_dead_prototypes :
- [ | `Module ] Llvm.PassManager.t -> unit = "llvm_add_strip_dead_prototypes"
-external add_strip_symbols : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_strip_symbols"
+external add_argument_promotion
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_argument_promotion"
+external add_constant_merge
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_constant_merge"
+external add_dead_arg_elimination
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_dead_arg_elimination"
+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
+ = "llvm_add_global_optimizer"
+external add_ipc_propagation
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_ip_constant_propagation"
+external add_prune_eh
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_prune_eh"
+external add_ipsccp
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_ipsccp"
+external add_internalize
+ : [ `Module ] Llvm.PassManager.t -> all_but_main:bool -> unit
+ = "llvm_add_internalize"
+external add_strip_dead_prototypes
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_strip_dead_prototypes"
+external add_strip_symbols
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_strip_symbols"
diff --git a/bindings/ocaml/transforms/ipo/llvm_ipo.mli b/bindings/ocaml/transforms/ipo/llvm_ipo.mli
index 1944c30b06c..09a4860b91e 100644
--- a/bindings/ocaml/transforms/ipo/llvm_ipo.mli
+++ b/bindings/ocaml/transforms/ipo/llvm_ipo.mli
@@ -12,58 +12,72 @@
This interface provides an OCaml API for LLVM interprocedural optimizations, the
classes in the [LLVMIPO] library. *)
-(** See llvm::createAddArgumentPromotionPass *)
-external add_argument_promotion : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_argument_promotion"
-
-(** See llvm::createConstantMergePass function. *)
-external add_constant_merge : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_constant_merge"
-
-(** See llvm::createDeadArgEliminationPass function. *)
-external add_dead_arg_elimination :
- [ | `Module ] Llvm.PassManager.t -> unit = "llvm_add_dead_arg_elimination"
-
-(** See llvm::createFunctionAttrsPass function. *)
-external add_function_attrs : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_function_attrs"
-
-(** See llvm::createFunctionInliningPass function. *)
-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"
-
-(** See llvm::createGlobalOptimizerPass function. *)
-external add_global_optimizer : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_global_optimizer"
-
-(** See llvm::createIPConstantPropagationPass function. *)
-external add_ipc_propagation : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_ipc_propagation"
-
-(** See llvm::createPruneEHPass function. *)
-external add_prune_eh : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_prune_eh"
-
-(** See llvm::createIPSCCPPass function. *)
-external add_ipsccp : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_ipsccp"
-
-(** See llvm::createInternalizePass function. *)
-external add_internalize : [ | `Module ] Llvm.PassManager.t -> bool -> unit =
- "llvm_add_internalize"
-
-(** See llvm::createStripDeadPrototypesPass function. *)
-external add_strip_dead_prototypes :
- [ | `Module ] Llvm.PassManager.t -> unit = "llvm_add_strip_dead_prototypes"
-
-(** See llvm::createStripSymbolsPass function. *)
-external add_strip_symbols : [ | `Module ] Llvm.PassManager.t -> unit =
- "llvm_add_strip_symbols"
+(** See the [llvm::createAddArgumentPromotionPass] function. *)
+external add_argument_promotion
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_argument_promotion"
+
+(** See the [llvm::createConstantMergePass] function. *)
+external add_constant_merge
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_constant_merge"
+
+(** See the [llvm::createDeadArgEliminationPass] function. *)
+external add_dead_arg_elimination
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_dead_arg_elimination"
+
+(** See the [llvm::createFunctionAttrsPass] function. *)
+external add_function_attrs
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_function_attrs"
+
+(** See the [llvm::createFunctionInliningPass] function. *)
+external add_function_inlining
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_function_inlining"
+
+(** See the [llvm::createAlwaysInlinerPass] function. *)
+external add_always_inliner
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_always_inliner"
+
+(** See the [llvm::createGlobalDCEPass] function. *)
+external add_global_dce
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_global_dce"
+
+(** See the [llvm::createGlobalOptimizerPass] function. *)
+external add_global_optimizer
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_global_optimizer"
+
+(** See the [llvm::createIPConstantPropagationPass] function. *)
+external add_ipc_propagation
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_ip_constant_propagation"
+
+(** See the [llvm::createPruneEHPass] function. *)
+external add_prune_eh
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_prune_eh"
+
+(** See the [llvm::createIPSCCPPass] function. *)
+external add_ipsccp
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_ipsccp"
+
+(** See the [llvm::createInternalizePass] function. *)
+external add_internalize
+ : [ `Module ] Llvm.PassManager.t -> all_but_main:bool -> unit
+ = "llvm_add_internalize"
+
+(** See the [llvm::createStripDeadPrototypesPass] function. *)
+external add_strip_dead_prototypes
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_strip_dead_prototypes"
+
+(** See the [llvm::createStripSymbolsPass] function. *)
+external add_strip_symbols
+ : [ `Module ] Llvm.PassManager.t -> unit
+ = "llvm_add_strip_symbols"
diff --git a/bindings/ocaml/transforms/passmgr_builder/llvm_passmgr_builder.mli b/bindings/ocaml/transforms/passmgr_builder/llvm_passmgr_builder.mli
index 66b0981ea24..ce162b1213f 100644
--- a/bindings/ocaml/transforms/passmgr_builder/llvm_passmgr_builder.mli
+++ b/bindings/ocaml/transforms/passmgr_builder/llvm_passmgr_builder.mli
@@ -14,41 +14,41 @@
type t
-(** See [llvm::PassManagerBuilder]. *)
+(** See the [llvm::PassManagerBuilder] function. *)
external create : unit -> t
= "llvm_pmbuilder_create"
-(** See [llvm::PassManagerBuilder::OptLevel]. *)
+(** See the [llvm::PassManagerBuilder::OptLevel] function. *)
external set_opt_level : int -> t -> unit
= "llvm_pmbuilder_set_opt_level"
-(** See [llvm::PassManagerBuilder::SizeLevel]. *)
+(** See the [llvm::PassManagerBuilder::SizeLevel] function. *)
external set_size_level : int -> t -> unit
= "llvm_pmbuilder_set_size_level"
-(** See [llvm::PassManagerBuilder::DisableUnitAtATime]. *)
+(** See the [llvm::PassManagerBuilder::DisableUnitAtATime] function. *)
external set_disable_unit_at_a_time : bool -> t -> unit
= "llvm_pmbuilder_set_disable_unit_at_a_time"
-(** See [llvm::PassManagerBuilder::DisableUnrollLoops]. *)
+(** See the [llvm::PassManagerBuilder::DisableUnrollLoops] function. *)
external set_disable_unroll_loops : bool -> t -> unit
= "llvm_pmbuilder_set_disable_unroll_loops"
-(** See [llvm::PassManagerBuilder::Inliner]. *)
+(** See the [llvm::PassManagerBuilder::Inliner] function. *)
external use_inliner_with_threshold : int -> t -> unit
= "llvm_pmbuilder_use_inliner_with_threshold"
-(** See [llvm::PassManagerBuilder::populateFunctionPassManager]. *)
+(** See the [llvm::PassManagerBuilder::populateFunctionPassManager] function. *)
external populate_function_pass_manager
: [ `Function ] Llvm.PassManager.t -> t -> unit
= "llvm_pmbuilder_populate_function_pass_manager"
-(** See [llvm::PassManagerBuilder::populateModulePassManager]. *)
+(** See the [llvm::PassManagerBuilder::populateModulePassManager] function. *)
external populate_module_pass_manager
: [ `Module ] Llvm.PassManager.t -> t -> unit
= "llvm_pmbuilder_populate_module_pass_manager"
-(** See [llvm::PassManagerBuilder::populateLTOPassManager]. *)
+(** See the [llvm::PassManagerBuilder::populateLTOPassManager] function. *)
external populate_lto_pass_manager
: [ `Module ] Llvm.PassManager.t -> internalize:bool -> run_inliner:bool -> t -> unit
- = "llvm_pmbuilder_populate_lto_pass_manager" \ No newline at end of file
+ = "llvm_pmbuilder_populate_lto_pass_manager"
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
index 3035b103f13..b90d0aecd2a 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.ml
@@ -1,4 +1,4 @@
-(*===-- llvm_scalar_opts.ml - LLVM OCaml Interface -------------*- OCaml -*-===*
+(*===-- llvm_scalar_opts.ml - LLVM OCaml Interface ------------*- OCaml -*-===*
*
* The LLVM Compiler Infrastructure
*
@@ -7,108 +7,114 @@
*
*===----------------------------------------------------------------------===*)
-external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
-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_scalar_repl_aggregation_ssa : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_scalar_repl_aggregation_ssa"
-
-external
-add_scalar_repl_aggregation_with_threshold : int -> [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_scalar_repl_aggregation_with_threshold"
-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_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"
-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_loop_idiom : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_idiom"
-
-external
-add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_lib_call_simplification"
-
-external
-add_verifier : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_verifier"
-
-external
-add_correlated_value_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_correlated_value_propagation"
-
-external
-add_early_cse : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_early_cse"
-
-external
-add_lower_expect_intrinsic : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_lower_expect_intrinsic"
-
-external
-add_type_based_alias_analysis : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_type_based_alias_analysis"
-
-external
-add_basic_alias_analysis : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_basic_alias_analysis"
-
-external
-add_partially_inline_lib_calls : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_partially_inline_lib_calls"
+external add_aggressive_dce
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_aggressive_dce"
+external add_alignment_from_assumptions
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_alignment_from_assumptions"
+external add_cfg_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_cfg_simplification"
+external add_dead_store_elimination
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_dead_store_elimination"
+external add_scalarizer
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalarizer"
+external add_merged_load_store_motion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_merged_load_store_motion"
+external add_gvn
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_gvn"
+external add_ind_var_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_ind_var_simplify"
+external add_instruction_combination
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_instruction_combining"
+external add_jump_threading
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_jump_threading"
+external add_licm
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_licm"
+external add_loop_deletion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_deletion"
+external add_loop_idiom
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_idiom"
+external add_loop_rotation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_rotate"
+external add_loop_reroll
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_reroll"
+external add_loop_unroll
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_unroll"
+external add_loop_unswitch
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_unswitch"
+external add_memcpy_opt
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_memcpy_opt"
+external add_partially_inline_lib_calls
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_partially_inline_lib_calls"
+external add_lower_switch
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_switch"
+external add_memory_to_register_promotion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_promote_memory_to_register"
+external add_reassociation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_reassociation"
+external add_sccp
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_sccp"
+external add_scalar_repl_aggregation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates"
+external add_scalar_repl_aggregation_ssa
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates_ssa"
+external add_scalar_repl_aggregation_with_threshold
+ : int -> [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates_with_threshold"
+external add_lib_call_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_simplify_lib_calls"
+external add_tail_call_elimination
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_tail_call_elimination"
+external add_constant_propagation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_constant_propagation"
+external add_memory_to_register_demotion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_demote_memory_to_register"
+external add_verifier
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_verifier"
+external add_correlated_value_propagation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_correlated_value_propagation"
+external add_early_cse
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_early_cse"
+external add_lower_expect_intrinsic
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_expect_intrinsic"
+external add_type_based_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_type_based_alias_analysis"
+external add_scoped_no_alias_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scoped_no_alias_aa"
+external add_basic_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_basic_alias_analysis"
diff --git a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
index ca900d9cd68..b4cefed76d5 100644
--- a/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
+++ b/bindings/ocaml/transforms/scalar/llvm_scalar_opts.mli
@@ -1,4 +1,4 @@
-(*===-- llvm_scalar_opts.mli - LLVM OCaml Interface ------------*- OCaml -*-===*
+(*===-- llvm_scalar_opts.mli - LLVM OCaml Interface -----------*- OCaml -*-===*
*
* The LLVM Compiler Infrastructure
*
@@ -12,157 +12,187 @@
This interface provides an OCaml API for LLVM scalar transforms, the
classes in the [LLVMScalarOpts] library. *)
-(** See the [llvm::createConstantPropagationPass] function. *)
-external add_constant_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_constant_propagation"
+(** See the [llvm::createAggressiveDCEPass] function. *)
+external add_aggressive_dce
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_aggressive_dce"
-(** See the [llvm::createSCCPPass] function. *)
-external add_sccp : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_sccp"
+(** See the [llvm::createAlignmentFromAssumptionsPass] function. *)
+external add_alignment_from_assumptions
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_alignment_from_assumptions"
+
+(** See the [llvm::createCFGSimplificationPass] function. *)
+external add_cfg_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_cfg_simplification"
(** See [llvm::createDeadStoreEliminationPass] function. *)
-external add_dead_store_elimination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_dead_store_elimination"
+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 [llvm::createScalarizerPass] function. *)
+external add_scalarizer
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalarizer"
-(** See the [llvm::createScalarReplAggregatesPass] function. *)
-external
-add_scalar_repl_aggregation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_scalar_repl_aggregation"
+(** See [llvm::createMergedLoadStoreMotionPass] function. *)
+external add_merged_load_store_motion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_merged_load_store_motion"
-(** See the [llvm::createScalarReplAggregatesPassSSA] function. *)
-external
-add_scalar_repl_aggregation_ssa : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_scalar_repl_aggregation_ssa"
-
-(** See the [llvm::createScalarReplAggregatesWithThreshold] function. *)
-external
-add_scalar_repl_aggregation_with_threshold : int -> [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_scalar_repl_aggregation_with_threshold"
+(** See the [llvm::createGVNPass] function. *)
+external add_gvn
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_gvn"
(** See the [llvm::createIndVarSimplifyPass] function. *)
-external add_ind_var_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_ind_var_simplification"
+external add_ind_var_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_ind_var_simplify"
(** See the [llvm::createInstructionCombiningPass] function. *)
-external
-add_instruction_combination : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_instruction_combination"
+external add_instruction_combination
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_instruction_combining"
+
+(** See the [llvm::createJumpThreadingPass] function. *)
+external add_jump_threading
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_jump_threading"
(** See the [llvm::createLICMPass] function. *)
-external add_licm : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_licm"
+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::createLoopDeletionPass] function. *)
+external add_loop_deletion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_deletion"
-(** See the [llvm::createLoopUnrollPass] function. *)
-external add_loop_unroll : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_unroll"
+(** See the [llvm::createLoopIdiomPass] function. *)
+external add_loop_idiom
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_idiom"
(** See the [llvm::createLoopRotatePass] function. *)
-external add_loop_rotation : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_rotation"
+external add_loop_rotation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_rotate"
-(** 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::createLoopRerollPass] function. *)
+external add_loop_reroll
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_reroll"
-(** 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::createLoopUnrollPass] function. *)
+external add_loop_unroll
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_unroll"
-(** See the [llvm::createReassociatePass] function. *)
-external add_reassociation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_reassociation"
+(** See the [llvm::createLoopUnswitchPass] function. *)
+external add_loop_unswitch
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_unswitch"
-(** See the [llvm::createJumpThreadingPass] function. *)
-external add_jump_threading : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_jump_threading"
+(** See the [llvm::createMemCpyOptPass] function. *)
+external add_memcpy_opt
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_memcpy_opt"
-(** See the [llvm::createCFGSimplificationPass] function. *)
-external add_cfg_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_cfg_simplification"
+(** See the [llvm::createPartiallyInlineLibCallsPass] function. *)
+external add_partially_inline_lib_calls
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_partially_inline_lib_calls"
-(** 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::createLowerSwitchPass] function. *)
+external add_lower_switch
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_switch"
-(** See the [llvm::createGVNPass] function. *)
-external add_gvn : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_gvn"
+(** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
+external add_memory_to_register_promotion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_promote_memory_to_register"
-(** See the [llvm::createMemCpyOptPass] function. *)
-external add_memcpy_opt : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_memcpy_opt"
+(** See the [llvm::createReassociatePass] function. *)
+external add_reassociation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_reassociation"
-(** See the [llvm::createLoopDeletionPass] function. *)
-external add_loop_deletion : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_deletion"
+(** See the [llvm::createSCCPPass] function. *)
+external add_sccp
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_sccp"
+
+(** See the [llvm::createScalarReplAggregatesPass] function. *)
+external add_scalar_repl_aggregation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates"
+
+(** See the [llvm::createScalarReplAggregatesPassSSA] function. *)
+external add_scalar_repl_aggregation_ssa
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates_ssa"
-external add_loop_idiom : [<Llvm.PassManager.any] Llvm.PassManager.t
- -> unit
- = "llvm_add_loop_idiom"
+(** See the [llvm::createScalarReplAggregatesWithThreshold] function. *)
+external add_scalar_repl_aggregation_with_threshold
+ : int -> [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scalar_repl_aggregates_with_threshold"
(** See the [llvm::createSimplifyLibCallsPass] function. *)
-external
-add_lib_call_simplification : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_lib_call_simplification"
+external add_lib_call_simplification
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_simplify_lib_calls"
+
+(** 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::createConstantPropagationPass] function. *)
+external add_constant_propagation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_constant_propagation"
+
+(** See the [llvm::createDemoteMemoryToRegisterPass] function. *)
+external add_memory_to_register_demotion
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_demote_memory_to_register"
(** See the [llvm::createVerifierPass] function. *)
-external
-add_verifier : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_verifier"
+external add_verifier
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_verifier"
(** See the [llvm::createCorrelatedValuePropagationPass] function. *)
-external
-add_correlated_value_propagation : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_correlated_value_propagation"
+external add_correlated_value_propagation
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_correlated_value_propagation"
(** See the [llvm::createEarlyCSE] function. *)
-external
-add_early_cse : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_early_cse"
+external add_early_cse
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_early_cse"
(** See the [llvm::createLowerExpectIntrinsicPass] function. *)
-external
-add_lower_expect_intrinsic : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_lower_expect_intrinsic"
+external add_lower_expect_intrinsic
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_expect_intrinsic"
(** See the [llvm::createTypeBasedAliasAnalysisPass] function. *)
-external
-add_type_based_alias_analysis : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_type_based_alias_analysis"
+external add_type_based_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_type_based_alias_analysis"
-(** See the [llvm::createBasicAliasAnalysisPass] function. *)
-external
-add_basic_alias_analysis : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_basic_alias_analysis"
+(** See the [llvm::createScopedNoAliasAAPass] function. *)
+external add_scoped_no_alias_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_scoped_no_alias_aa"
-(** See the [llvm::createPartiallyInlineLibCallsPass] function. *)
-external
-add_partially_inline_lib_calls : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_partially_inline_lib_calls"
+(** See the [llvm::createBasicAliasAnalysisPass] function. *)
+external add_basic_alias_analysis
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_basic_alias_analysis"
diff --git a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
index 47e17902baa..bae4e31710e 100644
--- a/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
+++ b/bindings/ocaml/transforms/scalar/scalar_opts_ocaml.c
@@ -20,157 +20,187 @@
#include "caml/misc.h"
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_constant_propagation(LLVMPassManagerRef PM) {
- LLVMAddConstantPropagationPass(PM);
+CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
+ LLVMAddAggressiveDCEPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) {
- LLVMAddSCCPPass(PM);
+CAMLprim value llvm_add_alignment_from_assumptions(LLVMPassManagerRef PM) {
+ LLVMAddAlignmentFromAssumptionsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_dead_store_elimination(LLVMPassManagerRef PM) {
- LLVMAddDeadStoreEliminationPass(PM);
+CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
+ LLVMAddCFGSimplificationPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_aggressive_dce(LLVMPassManagerRef PM) {
- LLVMAddAggressiveDCEPass(PM);
+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_scalar_repl_aggregation(LLVMPassManagerRef PM) {
- LLVMAddScalarReplAggregatesPass(PM);
+CAMLprim value llvm_add_scalarizer(LLVMPassManagerRef PM) {
+ LLVMAddScalarizerPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_scalar_repl_aggregation_ssa(LLVMPassManagerRef PM) {
- LLVMAddScalarReplAggregatesPassSSA(PM);
+CAMLprim value llvm_add_merged_load_store_motion(LLVMPassManagerRef PM) {
+ LLVMAddMergedLoadStoreMotionPass(PM);
return Val_unit;
}
-/* [<Llvm.PassManager.any] Llvm.PassManager.t -> int -> unit */
-CAMLprim value llvm_add_scalar_repl_aggregation_with_threshold(value threshold,
- LLVMPassManagerRef PM) {
- LLVMAddScalarReplAggregatesPassWithThreshold(PM, Int_val(threshold));
+/* [<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_ind_var_simplification(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_ind_var_simplify(LLVMPassManagerRef PM) {
LLVMAddIndVarSimplifyPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_instruction_combination(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_instruction_combining(LLVMPassManagerRef PM) {
LLVMAddInstructionCombiningPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) {
+ LLVMAddJumpThreadingPass(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) {
- LLVMAddLoopUnswitchPass(PM);
+CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
+ LLVMAddLoopDeletionPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
- LLVMAddLoopUnrollPass(PM);
+CAMLprim value llvm_add_loop_idiom(LLVMPassManagerRef PM) {
+ LLVMAddLoopIdiomPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_rotation(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_loop_rotate(LLVMPassManagerRef PM) {
LLVMAddLoopRotatePass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
- LLVMAddPromoteMemoryToRegisterPass(PM);
+CAMLprim value llvm_add_loop_reroll(LLVMPassManagerRef PM) {
+ LLVMAddLoopRerollPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) {
- LLVMAddDemoteMemoryToRegisterPass(PM);
+CAMLprim value llvm_add_loop_unroll(LLVMPassManagerRef PM) {
+ LLVMAddLoopUnrollPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
- LLVMAddReassociatePass(PM);
+CAMLprim value llvm_add_loop_unswitch(LLVMPassManagerRef PM) {
+ LLVMAddLoopUnswitchPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_jump_threading(LLVMPassManagerRef PM) {
- LLVMAddJumpThreadingPass(PM);
+CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
+ LLVMAddMemCpyOptPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_cfg_simplification(LLVMPassManagerRef PM) {
- LLVMAddCFGSimplificationPass(PM);
+CAMLprim value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
+ LLVMAddPartiallyInlineLibCallsPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_tail_call_elimination(LLVMPassManagerRef PM) {
- LLVMAddTailCallEliminationPass(PM);
+CAMLprim value llvm_add_lower_switch(LLVMPassManagerRef PM) {
+ LLVMAddLowerSwitchPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_merged_load_store_motion(LLVMPassManagerRef PM) {
- LLVMAddMergedLoadStoreMotionPass(PM);
+CAMLprim value llvm_add_promote_memory_to_register(LLVMPassManagerRef PM) {
+ LLVMAddPromoteMemoryToRegisterPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_gvn(LLVMPassManagerRef PM) {
- LLVMAddGVNPass(PM);
+CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
+ LLVMAddReassociatePass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_memcpy_opt(LLVMPassManagerRef PM) {
- LLVMAddMemCpyOptPass(PM);
+CAMLprim value llvm_add_sccp(LLVMPassManagerRef PM) {
+ LLVMAddSCCPPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_deletion(LLVMPassManagerRef PM) {
- LLVMAddLoopDeletionPass(PM);
+CAMLprim value llvm_add_scalar_repl_aggregates(LLVMPassManagerRef PM) {
+ LLVMAddScalarReplAggregatesPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_loop_idiom(LLVMPassManagerRef PM) {
- LLVMAddLoopIdiomPass(PM);
+CAMLprim value llvm_add_scalar_repl_aggregates_ssa(LLVMPassManagerRef PM) {
+ LLVMAddScalarReplAggregatesPassSSA(PM);
+ return Val_unit;
+}
+
+/* int -> [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_scalar_repl_aggregates_with_threshold(value threshold,
+ LLVMPassManagerRef PM) {
+ LLVMAddScalarReplAggregatesPassWithThreshold(PM, Int_val(threshold));
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_lib_call_simplification(LLVMPassManagerRef PM) {
+CAMLprim value llvm_add_simplify_lib_calls(LLVMPassManagerRef PM) {
LLVMAddSimplifyLibCallsPass(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_constant_propagation(LLVMPassManagerRef PM) {
+ LLVMAddConstantPropagationPass(PM);
+ return Val_unit;
+}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_demote_memory_to_register(LLVMPassManagerRef PM) {
+ LLVMAddDemoteMemoryToRegisterPass(PM);
+ return Val_unit;
+}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_verifier(LLVMPassManagerRef PM) {
LLVMAddVerifierPass(PM);
return Val_unit;
@@ -201,13 +231,13 @@ CAMLprim value llvm_add_type_based_alias_analysis(LLVMPassManagerRef PM) {
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_basic_alias_analysis(LLVMPassManagerRef PM) {
- LLVMAddBasicAliasAnalysisPass(PM);
+CAMLprim value llvm_add_scoped_no_alias_aa(LLVMPassManagerRef PM) {
+ LLVMAddScopedNoAliasAAPass(PM);
return Val_unit;
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
-CAMLprim value llvm_add_partially_inline_lib_calls(LLVMPassManagerRef PM) {
- LLVMAddPartiallyInlineLibCallsPass(PM);
+CAMLprim value llvm_add_basic_alias_analysis(LLVMPassManagerRef PM) {
+ LLVMAddBasicAliasAnalysisPass(PM);
return Val_unit;
}
diff --git a/bindings/ocaml/transforms/vectorize/llvm_vectorize.ml b/bindings/ocaml/transforms/vectorize/llvm_vectorize.ml
index 4fc53c6da3e..88831daf519 100644
--- a/bindings/ocaml/transforms/vectorize/llvm_vectorize.ml
+++ b/bindings/ocaml/transforms/vectorize/llvm_vectorize.ml
@@ -7,9 +7,12 @@
*
*===----------------------------------------------------------------------===*)
-external add_bb_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_bb_vectorize"
-external add_loop_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_loop_vectorize"
-external add_slp_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_slp_vectorize"
+external add_bb_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_bb_vectorize"
+external add_loop_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_vectorize"
+external add_slp_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_slp_vectorize"
diff --git a/bindings/ocaml/transforms/vectorize/llvm_vectorize.mli b/bindings/ocaml/transforms/vectorize/llvm_vectorize.mli
index 02530398512..23a68a28dad 100644
--- a/bindings/ocaml/transforms/vectorize/llvm_vectorize.mli
+++ b/bindings/ocaml/transforms/vectorize/llvm_vectorize.mli
@@ -13,13 +13,16 @@
classes in the [LLVMVectorize] library. *)
(** See the [llvm::createBBVectorizePass] function. *)
-external add_bb_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_bb_vectorize"
+external add_bb_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_bb_vectorize"
(** See the [llvm::createLoopVectorizePass] function. *)
-external add_loop_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_loop_vectorize"
+external add_loop_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_loop_vectorize"
-(** See [llvm::createSLPVectorizerPass] function. *)
-external add_slp_vectorize : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
- = "llvm_add_slp_vectorize"
+(** See the [llvm::createSLPVectorizerPass] function. *)
+external add_slp_vectorize
+ : [<Llvm.PassManager.any] Llvm.PassManager.t -> unit
+ = "llvm_add_slp_vectorize"