[llvm] r330668 - [AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 23 17:39:29 PDT 2018
Author: ctopper
Date: Mon Apr 23 17:39:29 2018
New Revision: 330668
URL: http://llvm.org/viewvc/llvm-project?rev=330668&view=rev
Log:
[AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.
I just tried to copy what was done for regular InstCombine. Hopefully I didn't miss anything.
Modified:
llvm/trunk/bindings/python/llvm/core.py
llvm/trunk/include/llvm-c/Initialization.h
llvm/trunk/include/llvm-c/Transforms/Scalar.h
llvm/trunk/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
Modified: llvm/trunk/bindings/python/llvm/core.py
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/bindings/python/llvm/core.py?rev=330668&r1=330667&r2=330668&view=diff
==============================================================================
--- llvm/trunk/bindings/python/llvm/core.py (original)
+++ llvm/trunk/bindings/python/llvm/core.py Mon Apr 23 17:39:29 2018
@@ -456,6 +456,9 @@ def register_library(library):
library.LLVMInitializeInstCombine.argtypes = [PassRegistry]
library.LLVMInitializeInstCombine.restype = None
+ library.LLVMInitializeAggressiveInstCombiner.argtypes = [PassRegistry]
+ library.LLVMInitializeAggressiveInstCombiner.restype = None
+
library.LLVMInitializeIPO.argtypes = [PassRegistry]
library.LLVMInitializeIPO.restype = None
Modified: llvm/trunk/include/llvm-c/Initialization.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm-c/Initialization.h?rev=330668&r1=330667&r2=330668&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Initialization.h (original)
+++ llvm/trunk/include/llvm-c/Initialization.h Mon Apr 23 17:39:29 2018
@@ -37,6 +37,7 @@ void LLVMInitializeScalarOpts(LLVMPassRe
void LLVMInitializeObjCARCOpts(LLVMPassRegistryRef R);
void LLVMInitializeVectorization(LLVMPassRegistryRef R);
void LLVMInitializeInstCombine(LLVMPassRegistryRef R);
+void LLVMInitializeAggressiveInstCombiner(LLVMPassRegistryRef R);
void LLVMInitializeIPO(LLVMPassRegistryRef R);
void LLVMInitializeInstrumentation(LLVMPassRegistryRef R);
void LLVMInitializeAnalysis(LLVMPassRegistryRef R);
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=330668&r1=330667&r2=330668&view=diff
==============================================================================
--- llvm/trunk/include/llvm-c/Transforms/Scalar.h (original)
+++ llvm/trunk/include/llvm-c/Transforms/Scalar.h Mon Apr 23 17:39:29 2018
@@ -35,6 +35,9 @@ extern "C" {
/** See llvm::createAggressiveDCEPass function. */
void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM);
+/** See llvm::createAggressiveInstCombinerPass function. */
+void LLVMAddAggressiveInstCombinerPass(LLVMPassManagerRef PM);
+
/** See llvm::createBitTrackingDCEPass function. */
void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM);
Modified: llvm/trunk/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp?rev=330668&r1=330667&r2=330668&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp (original)
+++ llvm/trunk/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp Mon Apr 23 17:39:29 2018
@@ -116,6 +116,10 @@ void llvm::initializeAggressiveInstCombi
initializeAggressiveInstCombinerLegacyPassPass(Registry);
}
+void LLVMInitializeAggressiveInstCombiner(LLVMPassRegistryRef R) {
+ initializeAggressiveInstCombinerLegacyPassPass(*unwrap(R));
+}
+
FunctionPass *llvm::createAggressiveInstCombinerPass() {
return new AggressiveInstCombinerLegacyPass();
}
Modified: llvm/trunk/lib/Transforms/Scalar/Scalar.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/Scalar.cpp?rev=330668&r1=330667&r2=330668&view=diff
==============================================================================
--- llvm/trunk/lib/Transforms/Scalar/Scalar.cpp (original)
+++ llvm/trunk/lib/Transforms/Scalar/Scalar.cpp Mon Apr 23 17:39:29 2018
@@ -114,6 +114,10 @@ void LLVMAddAggressiveDCEPass(LLVMPassMa
unwrap(PM)->add(createAggressiveDCEPass());
}
+void LLVMAddAggressiveInstCombinerPass(LLVMPassManagerRef PM) {
+ unwrap(PM)->add(createAggressiveInstCombinerPass());
+}
+
void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM) {
unwrap(PM)->add(createBitTrackingDCEPass());
}
More information about the llvm-commits
mailing list