summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/RegionPass.cpp
diff options
context:
space:
mode:
authorEli Friedman <efriedma@codeaurora.org>2017-06-01 21:22:26 +0000
committerEli Friedman <efriedma@codeaurora.org>2017-06-01 21:22:26 +0000
commit0d823d610d1d5f00ab0cd63a7bfa3f526f459f0e (patch)
treeb137a88077ad9dabafe7debf70854d9181e9845b /llvm/lib/Analysis/RegionPass.cpp
parent6ef911c41763c81b01aa1caa335393b4c4472206 (diff)
downloadbcm5719-llvm-0d823d610d1d5f00ab0cd63a7bfa3f526f459f0e.tar.gz
bcm5719-llvm-0d823d610d1d5f00ab0cd63a7bfa3f526f459f0e.zip
Add opt-bisect support for region passes.
This is necessary to get opt-bisect working with polly. Differential Revision: https://reviews.llvm.org/D33751 llvm-svn: 304476
Diffstat (limited to 'llvm/lib/Analysis/RegionPass.cpp')
-rw-r--r--llvm/lib/Analysis/RegionPass.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp
index 82107cb1802..b38e6225c84 100644
--- a/llvm/lib/Analysis/RegionPass.cpp
+++ b/llvm/lib/Analysis/RegionPass.cpp
@@ -15,6 +15,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/RegionPass.h"
#include "llvm/Analysis/RegionIterator.h"
+#include "llvm/IR/OptBisect.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Timer.h"
#include "llvm/Support/raw_ostream.h"
@@ -280,3 +281,18 @@ Pass *RegionPass::createPrinterPass(raw_ostream &O,
const std::string &Banner) const {
return new PrintRegionPass(Banner, O);
}
+
+bool RegionPass::skipRegion(Region &R) const {
+ Function &F = *R.getEntry()->getParent();
+ if (!F.getContext().getOptBisect().shouldRunPass(this, R))
+ return true;
+
+ if (F.hasFnAttribute(Attribute::OptimizeNone)) {
+ // Report this only once per function.
+ if (R.getEntry() == &F.getEntryBlock())
+ DEBUG(dbgs() << "Skipping pass '" << getPassName()
+ << "' on function " << F.getName() << "\n");
+ return true;
+ }
+ return false;
+}
OpenPOWER on IntegriCloud