[llvm] r342476 - [LLVM-C][OCaml] Add UnifyFunctionExitNodes pass to C and OCaml APIs
whitequark via llvm-commits
llvm-commits at lists.llvm.org
Tue Sep 18 06:36:04 PDT 2018
Author: whitequark
Date: Tue Sep 18 06:36:03 2018
New Revision: 342476
URL: http://llvm.org/viewvc/llvm-project?rev=342476&view=rev
Log:
[LLVM-C][OCaml] Add UnifyFunctionExitNodes pass to C and OCaml APIs
Summary:
Adds LLVMAddUnifyFunctionExitNodesPass to expose
createUnifyFunctionExitNodesPass to the C and OCaml APIs.
Reviewers: whitequark, deadalnix
Reviewed By: whitequark
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D52212
Modified:
llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
llvm/trunk/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
llvm/trunk/include/llvm-c/Transforms/Scalar.h
llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
Modified: llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml?rev=342476&r1=342475&r2=342476&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml (original)
+++ llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.ml Tue Sep 18 06:36:03 2018
@@ -121,3 +121,6 @@ external add_scoped_no_alias_alias_analy
external add_basic_alias_analysis
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_basic_alias_analysis"
+external add_unify_function_exit_nodes
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_unify_function_exit_nodes"
Modified: llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli?rev=342476&r1=342475&r2=342476&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli (original)
+++ llvm/trunk/bindings/ocaml/transforms/scalar_opts/llvm_scalar_opts.mli Tue Sep 18 06:36:03 2018
@@ -201,3 +201,8 @@ external add_scoped_no_alias_alias_analy
external add_basic_alias_analysis
: [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
= "llvm_add_basic_alias_analysis"
+
+(** See the [llvm::createUnifyFunctionExitNodesPass] function. *)
+external add_unify_function_exit_nodes
+ : [< Llvm.PassManager.any ] Llvm.PassManager.t -> unit
+ = "llvm_add_unify_function_exit_nodes"
Modified: llvm/trunk/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c?rev=342476&r1=342475&r2=342476&view=diff
==============================================================================
--- llvm/trunk/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c (original)
+++ llvm/trunk/bindings/ocaml/transforms/scalar_opts/scalar_opts_ocaml.c Tue Sep 18 06:36:03 2018
@@ -248,3 +248,9 @@ CAMLprim value llvm_add_basic_alias_anal
LLVMAddBasicAliasAnalysisPass(PM);
return Val_unit;
}
+
+/* [<Llvm.PassManager.any] Llvm.PassManager.t -> unit */
+CAMLprim value llvm_add_unify_function_exit_nodes(LLVMPassManagerRef PM) {
+ LLVMAddUnifyFunctionExitNodesPass(PM);
+ return Val_unit;
+}
Modified: llvm/trunk/include/llvm-c/Transforms/Scalar.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Transforms/Scalar.h?rev=342476&r1=342475&r2=342476&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Transforms/Scalar.h (original)
+++ llvm/trunk/include/llvm-c/Transforms/Scalar.h Tue Sep 18 06:36:03 2018
@@ -153,6 +153,9 @@ void LLVMAddScopedNoAliasAAPass(LLVMPass
/** See llvm::createBasicAliasAnalysisPass function */
void LLVMAddBasicAliasAnalysisPass(LLVMPassManagerRef PM);
+/** See llvm::createUnifyFunctionExitNodesPass function */
+void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM);
+
/**
* @}
*/
Modified: llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Scalar.cpp?rev=342476&r1=342475&r2=342476&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Scalar.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Scalar.cpp Tue Sep 18 06:36:03 2018
@@ -26,6 +26,7 @@
#include "llvm/InitializePasses.h"
#include "llvm/Transforms/Scalar/GVN.h"
#include "llvm/Transforms/Scalar/SimpleLoopUnswitch.h"
+#include "llvm/Transforms/Utils/UnifyFunctionExitNodes.h"
using namespace llvm;
@@ -278,3 +279,7 @@ void LLVMAddBasicAliasAnalysisPass(LLVMP
void LLVMAddLowerExpectIntrinsicPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createLowerExpectIntrinsicPass());
}
+
+void LLVMAddUnifyFunctionExitNodesPass(LLVMPassManagerRef PM) {
+ unwrap(PM)->add(createUnifyFunctionExitNodesPass());
+}
More information about the llvm-commits
mailing list