OSDN Git Service

[AggressiveInstCombine] Add aggressive inst combiner to the LLVM C API.
authorCraig Topper <craig.topper@intel.com>
Tue, 24 Apr 2018 00:39:29 +0000 (00:39 +0000)
committerCraig Topper <craig.topper@intel.com>
Tue, 24 Apr 2018 00:39:29 +0000 (00:39 +0000)
I just tried to copy what was done for regular InstCombine. Hopefully I didn't miss anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@330668 91177308-0d34-0410-b5e6-96231b3b80d8

bindings/python/llvm/core.py
include/llvm-c/Initialization.h
include/llvm-c/Transforms/Scalar.h
lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
lib/Transforms/Scalar/Scalar.cpp

index 47e81dd..6b3da6d 100644 (file)
@@ -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
 
index 90c8396..e45eafb 100644 (file)
@@ -37,6 +37,7 @@ void LLVMInitializeScalarOpts(LLVMPassRegistryRef R);
 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);
index c828813..88fff2a 100644 (file)
@@ -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);
 
index 1feeec5..27d2fb0 100644 (file)
@@ -116,6 +116,10 @@ void llvm::initializeAggressiveInstCombine(PassRegistry &Registry) {
   initializeAggressiveInstCombinerLegacyPassPass(Registry);
 }
 
+void LLVMInitializeAggressiveInstCombiner(LLVMPassRegistryRef R) {
+  initializeAggressiveInstCombinerLegacyPassPass(*unwrap(R));
+}
+
 FunctionPass *llvm::createAggressiveInstCombinerPass() {
   return new AggressiveInstCombinerLegacyPass();
 }
index accb307..9541766 100644 (file)
@@ -114,6 +114,10 @@ void LLVMAddAggressiveDCEPass(LLVMPassManagerRef PM) {
   unwrap(PM)->add(createAggressiveDCEPass());
 }
 
+void LLVMAddAggressiveInstCombinerPass(LLVMPassManagerRef PM) {
+  unwrap(PM)->add(createAggressiveInstCombinerPass());
+}
+
 void LLVMAddBitTrackingDCEPass(LLVMPassManagerRef PM) {
   unwrap(PM)->add(createBitTrackingDCEPass());
 }