[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
Mon Sep 17 18:26:08 PDT 2018
jberdine created this revision.
jberdine added a reviewer: whitequark.
Herald added a reviewer: deadalnix.
Herald added subscribers: llvm-commits, jfb.
Adds LLVMAddLowerAtomicPass to expose createLowerAtomicPass in the C
and OCaml APIs.
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
@@ -202,6 +202,10 @@
unwrap(PM)->add(createPartiallyInlineLibCallsPass());
}
+void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM) {
+ unwrap(PM)->add(createLowerAtomicPass());
+}
+
void LLVMAddReassociatePass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createReassociatePass());
}
Index: include/llvm-c/Transforms/Scalar.h
===================================================================
--- include/llvm-c/Transforms/Scalar.h
+++ include/llvm-c/Transforms/Scalar.h
@@ -98,6 +98,9 @@
/** See llvm::createPartiallyInlineLibCallsPass function. */
void LLVMAddPartiallyInlineLibCallsPass(LLVMPassManagerRef PM);
+/** See llvm::createLowerAtomicPass function. */
+void LLVMAddLowerAtomicPass(LLVMPassManagerRef PM);
+
/** See llvm::createReassociatePass function. */
void LLVMAddReassociatePass(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
@@ -134,6 +134,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.165869.patch
Type: text/x-patch
Size: 2990 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180918/c39d3f77/attachment.bin>
More information about the llvm-commits
mailing list