summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/LoopPass.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Analysis/LoopPass.cpp')
-rw-r--r--llvm/lib/Analysis/LoopPass.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 8163231c332..3181e4f9921 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -16,6 +16,7 @@
#include "llvm/Analysis/LoopPass.h"
#include "llvm/IR/IRPrintingPasses.h"
#include "llvm/IR/LLVMContext.h"
+#include "llvm/IR/OptBisect.h"
#include "llvm/IR/PassManager.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h"
@@ -335,11 +336,16 @@ void LoopPass::assignPassManager(PMStack &PMS,
LPPM->add(this);
}
-// Containing function has Attribute::OptimizeNone and transformation
-// passes should skip it.
-bool LoopPass::skipOptnoneFunction(const Loop *L) const {
+bool LoopPass::skipLoop(const Loop *L) const {
const Function *F = L->getHeader()->getParent();
- if (F && F->hasFnAttribute(Attribute::OptimizeNone)) {
+ if (!F)
+ return false;
+ // Check the opt bisect limit.
+ LLVMContext &Context = F->getContext();
+ if (!Context.getOptBisect().shouldRunPass(this, *L))
+ return true;
+ // Check for the OptimizeNone attribute.
+ if (F->hasFnAttribute(Attribute::OptimizeNone)) {
// FIXME: Report this to dbgs() only once per function.
DEBUG(dbgs() << "Skipping pass '" << getPassName()
<< "' in function " << F->getName() << "\n");
OpenPOWER on IntegriCloud