[PATCH] D52211: [LLVM-C][OCaml] Add LowerAtomic pass to C and OCaml APIs
Josh Berdine via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 18 04:42:52 PDT 2018
jberdine updated this revision to Diff 165938.
jberdine marked an inline comment as done.
jberdine added a comment.
reorder
Repository:
rL LLVM
https://reviews.llvm.org/D52211
Files:
bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
include/llvm-c/Transforms/Scalar.h
lib/Transforms/Scalar/Scalar.cpp
Index: lib/Transforms/Scalar/Scalar.cpp
===================================================================
--- lib/Transforms/Scalar/Scalar.cpp
+++ lib/Transforms/Scalar/Scalar.cpp
@@ -194,6 +194,10 @@
unwrap(PM)->add(createLoopUnswitchPass());
}
+void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM) {
+ unwrap(PM)->add(createLowerAtomicPass());
+}
+
void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createMemCpyOptPass());
}
Index: include/llvm-c/Transforms/Scalar.h
===================================================================
--- include/llvm-c/Transforms/Scalar.h
+++ include/llvm-c/Transforms/Scalar.h
@@ -92,6 +92,9 @@
/** See llvm::createLoopUnswitchPass function. */
void LLVMAddLoopUnswitchPass(LLVMPassManagerRef PM);
+/** See llvm::createLowerAtomicPass function. */
+void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
+
/** See llvm::createMemCpyOptPass function. */
void LLVMAddMemCpyOptPass(LLVMPassManagerRef PM);
Index: bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
===================================================================
--- bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
+++ bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
@@ -135,6 +135,12 @@
}
/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_lower_atomic(LLVMPassManagerRef PM) {
+ LLVMAddLowerAtomicPass(PM);
+ return Val_unit;
+}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
CAMLprim value llvm_add_lower_switch(LLVMPassManagerRef PM) {
LLVMAddLowerSwitchPass(PM);
return Val_unit;
Index: bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
===================================================================
--- bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
+++ bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
@@ -107,6 +107,11 @@
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_partially_inline_lib_calls"
+(** See the [llvm::createLowerAtomicPass] function. *)
+external add_lower_atomic
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_atomic"
+
(** See the [llvm::createLowerSwitchPass] function. *)
external add_lower_switch
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
Index: bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
===================================================================
--- bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
+++ bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
@@ -64,6 +64,9 @@
external add_partially_inline_lib_calls
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_partially_inline_lib_calls"
+external add_lower_atomic
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_lower_atomic"
external add_lower_switch
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_lower_switch"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52211.165938.patch
Type: text/x-patch
Size: 2949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/5133c7bc/attachment.bin>
More information about the llvm-commits
mailing list