From 74cfb0ce1c9525cfaa4f484edf555ea18b379370 Mon Sep 17 00:00:00 2001 From: Owen Anderson Date: Thu, 7 Oct 2010 20:04:55 +0000 Subject: [PATCH] Add initialization routines to InstCombine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115965 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm-c/Initialization.h | 1 + include/llvm/InitializePasses.h | 4 ++++ lib/Transforms/InstCombine/InstructionCombining.cpp | 9 +++++++++ 3 files changed, 14 insertions(+) diff --git a/include/llvm-c/Initialization.h b/include/llvm-c/Initialization.h index 01dbeb6cdf7..346e1f1e684 100644 --- a/include/llvm-c/Initialization.h +++ b/include/llvm-c/Initialization.h @@ -25,6 +25,7 @@ extern "C" { void LLVMInitializeCore(LLVMPassRegistryRef R); void LLVMInitializeTransformUtils(LLVMPassRegistryRef R); void LLVMInitializeScalarOpts(LLVMPassRegistryRef R); +void LLVMInitializeInstCombine(LLVMPassRegistryRef R); void LLVMInitializeIPO(LLVMPassRegistryRef R); void LLVMInitializeAnalysis(LLVMPassRegistryRef R); void LLVMInitializeIPA(LLVMPassRegistryRef R); diff --git a/include/llvm/InitializePasses.h b/include/llvm/InitializePasses.h index 37351997761..9ad5edceff8 100644 --- a/include/llvm/InitializePasses.h +++ b/include/llvm/InitializePasses.h @@ -31,6 +31,10 @@ void initializeTransformUtils(PassRegistry&); /// ScalarOpts library. void initializeScalarOpts(PassRegistry&); +/// initializeInstCombine - Initialize all passes linked into the +/// ScalarOpts library. +void initializeInstCombine(PassRegistry&); + /// initializeIPO - Initialize all passes linked into the IPO library. void initializeIPO(PassRegistry&); diff --git a/lib/Transforms/InstCombine/InstructionCombining.cpp b/lib/Transforms/InstCombine/InstructionCombining.cpp index e46c67994e2..5ac5bd4f792 100644 --- a/lib/Transforms/InstCombine/InstructionCombining.cpp +++ b/lib/Transforms/InstCombine/InstructionCombining.cpp @@ -48,6 +48,7 @@ #include "llvm/Support/PatternMatch.h" #include "llvm/ADT/SmallPtrSet.h" #include "llvm/ADT/Statistic.h" +#include "llvm-c/Initialization.h" #include #include using namespace llvm; @@ -58,6 +59,14 @@ STATISTIC(NumConstProp, "Number of constant folds"); STATISTIC(NumDeadInst , "Number of dead inst eliminated"); STATISTIC(NumSunkInst , "Number of instructions sunk"); +// Initialization Routines +void llvm::initializeInstCombine(PassRegistry &Registry) { + initializeInstCombinerPass(Registry); +} + +void LLVMInitializeInstCombine(LLVMPassRegistryRef R) { + initializeInstCombine(*unwrap(R)); +} char InstCombiner::ID = 0; INITIALIZE_PASS(InstCombiner, "instcombine",