diff options
author | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-05-03 22:32:30 +0000 |
---|---|---|
committer | Andrew Kaylor <andrew.kaylor@intel.com> | 2016-05-03 22:32:30 +0000 |
commit | 50271f787e99a35010ddbaafaa8fe711da5899f8 (patch) | |
tree | 4a1e7c15845cfd69a2abf1d084c513975a3dfa8d /llvm/lib/Transforms | |
parent | 539cd6758b8da2f35fb88a275374f752e7671e47 (diff) | |
download | bcm5719-llvm-50271f787e99a35010ddbaafaa8fe711da5899f8.tar.gz bcm5719-llvm-50271f787e99a35010ddbaafaa8fe711da5899f8.zip |
Add opt-bisect support to additional passes that can be skipped
Differential Revision: http://reviews.llvm.org/D19882
llvm-svn: 268457
Diffstat (limited to 'llvm/lib/Transforms')
11 files changed, 28 insertions, 5 deletions
diff --git a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp index 4b721d38adb..8332c8edb9f 100644 --- a/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp +++ b/llvm/lib/Transforms/Scalar/AlignmentFromAssumptions.cpp @@ -411,6 +411,9 @@ bool AlignmentFromAssumptions::processAssumption(CallInst *ACall) { } bool AlignmentFromAssumptions::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + bool Changed = false; auto &AC = getAnalysis<AssumptionCacheTracker>().getAssumptionCache(F); SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE(); diff --git a/llvm/lib/Transforms/Scalar/ConstantProp.cpp b/llvm/lib/Transforms/Scalar/ConstantProp.cpp index c2be8de877d..88172d19fe5 100644 --- a/llvm/lib/Transforms/Scalar/ConstantProp.cpp +++ b/llvm/lib/Transforms/Scalar/ConstantProp.cpp @@ -61,6 +61,9 @@ FunctionPass *llvm::createConstantPropagationPass() { } bool ConstantPropagation::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + // Initialize the worklist to all of the instructions ready to process... std::set<Instruction*> WorkList; for (Instruction &I: instructions(&F)) diff --git a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp index e4b03efa5d2..55018001963 100644 --- a/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp +++ b/llvm/lib/Transforms/Scalar/InductiveRangeCheckElimination.cpp @@ -1383,6 +1383,9 @@ IntersectRange(ScalarEvolution &SE, } bool InductiveRangeCheckElimination::runOnLoop(Loop *L, LPPassManager &LPM) { + if (skipLoop(L)) + return false; + if (L->getBlocks().size() >= LoopSizeCutoff) { DEBUG(dbgs() << "irce: giving up constraining loop, too large\n";); return false; diff --git a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp index d6a8f48b5f6..b044fe842b2 100644 --- a/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDataPrefetch.cpp @@ -147,6 +147,9 @@ bool LoopDataPrefetch::isStrideLargeEnough(const SCEVAddRecExpr *AR) { } bool LoopDataPrefetch::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE(); DL = &F.getParent()->getDataLayout(); diff --git a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp index dee21676165..a1e4f225b01 100644 --- a/llvm/lib/Transforms/Scalar/LoopDistribute.cpp +++ b/llvm/lib/Transforms/Scalar/LoopDistribute.cpp @@ -871,6 +871,9 @@ public: } bool runOnFunction(Function &F) override { + if (skipFunction(F)) + return false; + auto *LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); auto *LAA = &getAnalysis<LoopAccessAnalysis>(); auto *DT = &getAnalysis<DominatorTreeWrapperPass>().getDomTree(); diff --git a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp index 4295235a3f3..a03bd2dc893 100644 --- a/llvm/lib/Transforms/Scalar/LoopInterchange.cpp +++ b/llvm/lib/Transforms/Scalar/LoopInterchange.cpp @@ -449,6 +449,9 @@ struct LoopInterchange : public FunctionPass { } bool runOnFunction(Function &F) override { + if (skipFunction(F)) + return false; + SE = &getAnalysis<ScalarEvolutionWrapperPass>().getSE(); LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo(); DA = &getAnalysis<DependenceAnalysis>(); diff --git a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp index 6c41f9145e6..27bb230af2f 100644 --- a/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp +++ b/llvm/lib/Transforms/Scalar/PartiallyInlineLibCalls.cpp @@ -57,6 +57,9 @@ void PartiallyInlineLibCalls::getAnalysisUsage(AnalysisUsage &AU) const { } bool PartiallyInlineLibCalls::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; + bool Changed = false; Function::iterator CurrBB; TargetLibraryInfo *TLI = diff --git a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp index 915f89780c0..5ee2070d86c 100644 --- a/llvm/lib/Transforms/Scalar/Reg2Mem.cpp +++ b/llvm/lib/Transforms/Scalar/Reg2Mem.cpp @@ -68,7 +68,7 @@ INITIALIZE_PASS_END(RegToMem, "reg2mem", "Demote all values to stack slots", false, false) bool RegToMem::runOnFunction(Function &F) { - if (F.isDeclaration()) + if (F.isDeclaration() || skipFunction(F)) return false; // Insert all new allocas into entry block. diff --git a/llvm/lib/Transforms/Scalar/Scalarizer.cpp b/llvm/lib/Transforms/Scalar/Scalarizer.cpp index 446c78f0bff..3f6fd8fa1a7 100644 --- a/llvm/lib/Transforms/Scalar/Scalarizer.cpp +++ b/llvm/lib/Transforms/Scalar/Scalarizer.cpp @@ -252,6 +252,8 @@ bool Scalarizer::doInitialization(Module &M) { } bool Scalarizer::runOnFunction(Function &F) { + if (skipFunction(F)) + return false; assert(Gathered.empty() && Scattered.empty()); for (BasicBlock &BB : F) { for (BasicBlock::iterator II = BB.begin(), IE = BB.end(); II != IE;) { diff --git a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp index 7dd36d73601..e6933336947 100644 --- a/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp +++ b/llvm/lib/Transforms/Scalar/SimplifyCFGPass.cpp @@ -209,10 +209,7 @@ struct CFGSimplifyPass : public FunctionPass { initializeCFGSimplifyPassPass(*PassRegistry::getPassRegistry()); } bool runOnFunction(Function &F) override { - if (PredicateFtor && !PredicateFtor(F)) - return false; - - if (skipFunction(F)) + if (skipFunction(F) || (PredicateFtor && !PredicateFtor(F))) return false; AssumptionCache *AC = diff --git a/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp b/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp index d5377f9a4c1..edba5d2656e 100644 --- a/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp +++ b/llvm/lib/Transforms/Utils/SimplifyInstructions.cpp @@ -48,6 +48,9 @@ namespace { /// runOnFunction - Remove instructions that simplify. bool runOnFunction(Function &F) override { + if (skipFunction(F)) + return false; + const DominatorTreeWrapperPass *DTWP = getAnalysisIfAvailable<DominatorTreeWrapperPass>(); const DominatorTree *DT = DTWP ? &DTWP->getDomTree() : nullptr; |