forked from OSchip/llvm-project
[Bindings] Add LLVMAddInstructionSimplifyPass
Reviewed By: sroland Differential Revision: https://reviews.llvm.org/D86764
This commit is contained in:
parent
b1f3948620
commit
96f0b57568
|
@ -40,7 +40,8 @@ Non-comprehensive list of changes in this release
|
||||||
functionality, or simply have a lot to talk about), see the `NOTE` below
|
functionality, or simply have a lot to talk about), see the `NOTE` below
|
||||||
for adding a new subsection.
|
for adding a new subsection.
|
||||||
|
|
||||||
* ...
|
* The ConstantPropagation pass was removed. Users should use the InstSimplify
|
||||||
|
pass instead.
|
||||||
|
|
||||||
|
|
||||||
.. NOTE
|
.. NOTE
|
||||||
|
|
|
@ -67,6 +67,9 @@ void LLVMAddIndVarSimplifyPass(LLVMPassManagerRef PM);
|
||||||
/** See llvm::createInstructionCombiningPass function. */
|
/** See llvm::createInstructionCombiningPass function. */
|
||||||
void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
|
void LLVMAddInstructionCombiningPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
/** See llvm::createInstSimplifyLegacyPass function. */
|
||||||
|
void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
/** See llvm::createJumpThreadingPass function. */
|
/** See llvm::createJumpThreadingPass function. */
|
||||||
void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
|
void LLVMAddJumpThreadingPass(LLVMPassManagerRef PM);
|
||||||
|
|
||||||
|
|
|
@ -17,12 +17,14 @@
|
||||||
#include "llvm/IR/DataLayout.h"
|
#include "llvm/IR/DataLayout.h"
|
||||||
#include "llvm/IR/Dominators.h"
|
#include "llvm/IR/Dominators.h"
|
||||||
#include "llvm/IR/Function.h"
|
#include "llvm/IR/Function.h"
|
||||||
|
#include "llvm/IR/LegacyPassManager.h"
|
||||||
#include "llvm/IR/Type.h"
|
#include "llvm/IR/Type.h"
|
||||||
#include "llvm/InitializePasses.h"
|
#include "llvm/InitializePasses.h"
|
||||||
#include "llvm/Pass.h"
|
#include "llvm/Pass.h"
|
||||||
#include "llvm/Transforms/Scalar.h"
|
#include "llvm/Transforms/Scalar.h"
|
||||||
#include "llvm/Transforms/Utils.h"
|
#include "llvm/Transforms/Utils.h"
|
||||||
#include "llvm/Transforms/Utils/Local.h"
|
#include "llvm/Transforms/Utils/Local.h"
|
||||||
|
|
||||||
using namespace llvm;
|
using namespace llvm;
|
||||||
|
|
||||||
#define DEBUG_TYPE "instsimplify"
|
#define DEBUG_TYPE "instsimplify"
|
||||||
|
@ -129,6 +131,10 @@ FunctionPass *llvm::createInstSimplifyLegacyPass() {
|
||||||
return new InstSimplifyLegacyPass();
|
return new InstSimplifyLegacyPass();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLVMAddInstructionSimplifyPass(LLVMPassManagerRef PM) {
|
||||||
|
unwrap(PM)->add(createInstSimplifyLegacyPass());
|
||||||
|
}
|
||||||
|
|
||||||
PreservedAnalyses InstSimplifyPass::run(Function &F,
|
PreservedAnalyses InstSimplifyPass::run(Function &F,
|
||||||
FunctionAnalysisManager &AM) {
|
FunctionAnalysisManager &AM) {
|
||||||
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
|
auto &DT = AM.getResult<DominatorTreeAnalysis>(F);
|
||||||
|
|
Loading…
Reference in New Issue