summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/OptBisect.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/IR/OptBisect.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/IR/OptBisect.cpp')
-rw-r--r--llvm/lib/IR/OptBisect.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/llvm/lib/IR/OptBisect.cpp b/llvm/lib/IR/OptBisect.cpp
index b670c817569..a03a6fb6223 100644
--- a/llvm/lib/IR/OptBisect.cpp
+++ b/llvm/lib/IR/OptBisect.cpp
@@ -16,6 +16,7 @@
#include "llvm/Analysis/CallGraphSCCPass.h"
#include "llvm/Analysis/LazyCallGraph.h"
#include "llvm/Analysis/LoopInfo.h"
+#include "llvm/Analysis/RegionInfo.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/OptBisect.h"
#include "llvm/Pass.h"
@@ -53,13 +54,20 @@ static std::string getDescription(const BasicBlock &BB) {
}
static std::string getDescription(const Loop &L) {
- // FIXME: I'd like to be able to provide a better description here, but
- // calling L->getHeader() would introduce a new dependency on the
- // LLVMCore library.
+ // FIXME: Move into LoopInfo so we can get a better description
+ // (and avoid a circular dependency between IR and Analysis).
return "loop";
}
+static std::string getDescription(const Region &R) {
+ // FIXME: Move into RegionInfo so we can get a better description
+ // (and avoid a circular dependency between IR and Analysis).
+ return "region";
+}
+
static std::string getDescription(const CallGraphSCC &SCC) {
+ // FIXME: Move into CallGraphSCCPass to avoid circular dependency between
+ // IR and Analysis.
std::string Desc = "SCC (";
bool First = true;
for (CallGraphNode *CGN : SCC) {
@@ -83,6 +91,7 @@ template bool OptBisect::shouldRunPass(const Pass *, const Function &);
template bool OptBisect::shouldRunPass(const Pass *, const BasicBlock &);
template bool OptBisect::shouldRunPass(const Pass *, const Loop &);
template bool OptBisect::shouldRunPass(const Pass *, const CallGraphSCC &);
+template bool OptBisect::shouldRunPass(const Pass *, const Region &);
template <class UnitT>
bool OptBisect::shouldRunPass(const Pass *P, const UnitT &U) {
OpenPOWER on IntegriCloud