llvm.org GIT mirror llvm / 69cf031
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 Gordon Henriksen 12 years ago
5 changed file(s) with 46 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
1212 external add_instruction_combining : [
1313 -> unit
1414 = "llvm_add_instruction_combining"
15 external
16 add_memory_to_register_promotion : [
17 -> unit
18 = "llvm_add_memory_to_register_promotion"
19 external
20 add_memory_to_register_demotion : [
21 -> unit
22 = "llvm_add_memory_to_register_demotion"
1523 external add_reassociation : [
1624 -> unit
1725 = "llvm_add_reassociation"
2121 -> unit
2222 = "llvm_add_instruction_combining"
2323
24 (** See the [llvm::createPromoteMemoryToRegisterPass] function. *)
25 external
26 add_memory_to_register_promotion : [
27 -> unit
28 = "llvm_add_memory_to_register_promotion"
29
30 (** See the [llvm::createDemoteMemoryToRegisterPass] function. *)
31 external
32 add_memory_to_register_demotion : [
33 -> unit
34 = "llvm_add_memory_to_register_demotion"
35
2436 (** See the [llvm::createReassociatePass] function. *)
2537 external add_reassociation : [
2638 -> unit
3131 }
3232
3333 /* [ unit */
34 CAMLprim value llvm_add_memory_to_register_promotion(LLVMPassManagerRef PM) {
35 LLVMAddPromoteMemoryToRegisterPass(PM);
36 return Val_unit;
37 }
38
39 /* [ unit */
40 CAMLprim value llvm_add_memory_to_register_demotion(LLVMPassManagerRef PM) {
41 LLVMAddDemoteMemoryToRegisterPass(PM);
42 return Val_unit;
43 }
44
45 /* [ unit */
3446 CAMLprim value llvm_add_reassociation(LLVMPassManagerRef PM) {
3547 LLVMAddReassociatePass(PM);
3648 return Val_unit;
3030 /** See llvm::createInstructionCombiningPass function. */
3131 void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
3232
33 /** See llvm::createPromoteMemoryToRegisterPass function. */
34 void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM);
35
36 /** See llvm::demotePromoteMemoryToRegisterPass function. */
37 void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM);
38
3339 /** See llvm::createReassociatePass function. */
3440 void LLVMAddReassociatePass(LLVMPassManagerRef PM);
3541
2525 unwrap(PM)->add(createInstructionCombiningPass());
2626 }
2727
28 void LLVMAddPromoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
29 unwrap(PM)->add(createPromoteMemoryToRegisterPass());
30 }
31
32 void LLVMAddDemoteMemoryToRegisterPass(LLVMPassManagerRef PM) {
33 unwrap(PM)->add(createDemoteRegisterToMemoryPass());
34 }
35
2836 void LLVMAddReassociatePass(LLVMPassManagerRef PM) {
2937 unwrap(PM)->add(createReassociatePass());
3038 }