summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'polly/lib/Analysis')
-rw-r--r--polly/lib/Analysis/DependenceInfo.cpp37
-rw-r--r--polly/lib/Analysis/PolyhedralInfo.cpp10
-rw-r--r--polly/lib/Analysis/PruneUnprofitable.cpp10
-rw-r--r--polly/lib/Analysis/ScopBuilder.cpp18
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp24
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp15
6 files changed, 60 insertions, 54 deletions
diff --git a/polly/lib/Analysis/DependenceInfo.cpp b/polly/lib/Analysis/DependenceInfo.cpp
index 77207122782..1c1d38068d9 100644
--- a/polly/lib/Analysis/DependenceInfo.cpp
+++ b/polly/lib/Analysis/DependenceInfo.cpp
@@ -296,9 +296,10 @@ static __isl_give isl_union_flow *buildFlow(__isl_keep isl_union_map *Snk,
AI = isl_union_access_info_set_must_source(AI, isl_union_map_copy(Src));
AI = isl_union_access_info_set_schedule(AI, isl_schedule_copy(Schedule));
auto Flow = isl_union_access_info_compute_flow(AI);
- DEBUG(if (!Flow) dbgs() << "last error: "
- << isl_ctx_last_error(isl_schedule_get_ctx(Schedule))
- << '\n';);
+ LLVM_DEBUG(if (!Flow) dbgs()
+ << "last error: "
+ << isl_ctx_last_error(isl_schedule_get_ctx(Schedule))
+ << '\n';);
return Flow;
}
@@ -407,18 +408,18 @@ void Dependences::calculateDependences(Scop &S) {
isl_schedule *Schedule;
isl_union_set *TaggedStmtDomain;
- DEBUG(dbgs() << "Scop: \n" << S << "\n");
+ LLVM_DEBUG(dbgs() << "Scop: \n" << S << "\n");
collectInfo(S, Read, MustWrite, MayWrite, ReductionTagMap, TaggedStmtDomain,
Level);
bool HasReductions = !isl_union_map_is_empty(ReductionTagMap);
- DEBUG(dbgs() << "Read: " << Read << '\n';
- dbgs() << "MustWrite: " << MustWrite << '\n';
- dbgs() << "MayWrite: " << MayWrite << '\n';
- dbgs() << "ReductionTagMap: " << ReductionTagMap << '\n';
- dbgs() << "TaggedStmtDomain: " << TaggedStmtDomain << '\n';);
+ LLVM_DEBUG(dbgs() << "Read: " << Read << '\n';
+ dbgs() << "MustWrite: " << MustWrite << '\n';
+ dbgs() << "MayWrite: " << MayWrite << '\n';
+ dbgs() << "ReductionTagMap: " << ReductionTagMap << '\n';
+ dbgs() << "TaggedStmtDomain: " << TaggedStmtDomain << '\n';);
Schedule = S.getScheduleTree().release();
@@ -455,10 +456,10 @@ void Dependences::calculateDependences(Scop &S) {
Schedule = isl_schedule_pullback_union_pw_multi_aff(Schedule, Tags);
}
- DEBUG(dbgs() << "Read: " << Read << "\n";
- dbgs() << "MustWrite: " << MustWrite << "\n";
- dbgs() << "MayWrite: " << MayWrite << "\n";
- dbgs() << "Schedule: " << Schedule << "\n");
+ LLVM_DEBUG(dbgs() << "Read: " << Read << "\n";
+ dbgs() << "MustWrite: " << MustWrite << "\n";
+ dbgs() << "MayWrite: " << MayWrite << "\n";
+ dbgs() << "Schedule: " << Schedule << "\n");
isl_union_map *StrictWAW = nullptr;
{
@@ -600,7 +601,7 @@ void Dependences::calculateDependences(Scop &S) {
isl_union_map_copy(WAW), isl_union_set_copy(TaggedStmtDomain));
STMT_WAR =
isl_union_map_intersect_domain(isl_union_map_copy(WAR), TaggedStmtDomain);
- DEBUG({
+ LLVM_DEBUG({
dbgs() << "Wrapped Dependences:\n";
dump();
dbgs() << "\n";
@@ -649,7 +650,7 @@ void Dependences::calculateDependences(Scop &S) {
} else
TC_RED = isl_union_map_empty(isl_union_map_get_space(RED));
- DEBUG({
+ LLVM_DEBUG({
dbgs() << "Final Wrapped Dependences:\n";
dump();
dbgs() << "\n";
@@ -699,7 +700,7 @@ void Dependences::calculateDependences(Scop &S) {
RED = isl_union_map_zip(RED);
TC_RED = isl_union_map_zip(TC_RED);
- DEBUG({
+ LLVM_DEBUG({
dbgs() << "Zipped Dependences:\n";
dump();
dbgs() << "\n";
@@ -711,7 +712,7 @@ void Dependences::calculateDependences(Scop &S) {
RED = isl_union_set_unwrap(isl_union_map_domain(RED));
TC_RED = isl_union_set_unwrap(isl_union_map_domain(TC_RED));
- DEBUG({
+ LLVM_DEBUG({
dbgs() << "Unwrapped Dependences:\n";
dump();
dbgs() << "\n";
@@ -727,7 +728,7 @@ void Dependences::calculateDependences(Scop &S) {
RED = isl_union_map_coalesce(RED);
TC_RED = isl_union_map_coalesce(TC_RED);
- DEBUG(dump());
+ LLVM_DEBUG(dump());
}
bool Dependences::isValidSchedule(Scop &S,
diff --git a/polly/lib/Analysis/PolyhedralInfo.cpp b/polly/lib/Analysis/PolyhedralInfo.cpp
index b159c159736..f08bcc8f906 100644
--- a/polly/lib/Analysis/PolyhedralInfo.cpp
+++ b/polly/lib/Analysis/PolyhedralInfo.cpp
@@ -79,15 +79,15 @@ bool PolyhedralInfo::checkParallel(Loop *L, isl_pw_aff **MinDepDistPtr) const {
DI->getDependences(const_cast<Scop *>(S), Dependences::AL_Access);
if (!D.hasValidDependences())
return false;
- DEBUG(dbgs() << "Loop :\t" << L->getHeader()->getName() << ":\n");
+ LLVM_DEBUG(dbgs() << "Loop :\t" << L->getHeader()->getName() << ":\n");
isl_union_map *Deps =
D.getDependences(Dependences::TYPE_RAW | Dependences::TYPE_WAW |
Dependences::TYPE_WAR | Dependences::TYPE_RED);
- DEBUG(dbgs() << "Dependences :\t" << stringFromIslObj(Deps) << "\n");
+ LLVM_DEBUG(dbgs() << "Dependences :\t" << stringFromIslObj(Deps) << "\n");
isl_union_map *Schedule = getScheduleForLoop(S, L);
- DEBUG(dbgs() << "Schedule: \t" << stringFromIslObj(Schedule) << "\n");
+ LLVM_DEBUG(dbgs() << "Schedule: \t" << stringFromIslObj(Schedule) << "\n");
IsParallel = D.isParallel(Schedule, Deps, MinDepDistPtr);
isl_union_map_free(Schedule);
@@ -123,14 +123,14 @@ __isl_give isl_union_map *PolyhedralInfo::getScheduleForLoop(const Scop *S,
Loop *L) const {
isl_union_map *Schedule = isl_union_map_empty(S->getParamSpace().release());
int CurrDim = S->getRelativeLoopDepth(L);
- DEBUG(dbgs() << "Relative loop depth:\t" << CurrDim << "\n");
+ LLVM_DEBUG(dbgs() << "Relative loop depth:\t" << CurrDim << "\n");
assert(CurrDim >= 0 && "Loop in region should have at least depth one");
for (auto &SS : *S) {
if (L->contains(SS.getSurroundingLoop())) {
unsigned int MaxDim = SS.getNumIterators();
- DEBUG(dbgs() << "Maximum depth of Stmt:\t" << MaxDim << "\n");
+ LLVM_DEBUG(dbgs() << "Maximum depth of Stmt:\t" << MaxDim << "\n");
isl_map *ScheduleMap = SS.getSchedule().release();
assert(
ScheduleMap &&
diff --git a/polly/lib/Analysis/PruneUnprofitable.cpp b/polly/lib/Analysis/PruneUnprofitable.cpp
index 262cadd0bf1..da1ef529de0 100644
--- a/polly/lib/Analysis/PruneUnprofitable.cpp
+++ b/polly/lib/Analysis/PruneUnprofitable.cpp
@@ -73,16 +73,18 @@ public:
bool runOnScop(Scop &S) override {
if (PollyProcessUnprofitable) {
- DEBUG(dbgs() << "NOTE: -polly-process-unprofitable active, won't prune "
- "anything\n");
+ LLVM_DEBUG(
+ dbgs() << "NOTE: -polly-process-unprofitable active, won't prune "
+ "anything\n");
return false;
}
ScopsProcessed++;
if (!S.isProfitable(true)) {
- DEBUG(dbgs() << "SCoP pruned because it probably cannot be optimized in "
- "a significant way\n");
+ LLVM_DEBUG(
+ dbgs() << "SCoP pruned because it probably cannot be optimized in "
+ "a significant way\n");
S.invalidate(PROFITABLE, DebugLoc());
updateStatistics(S, true);
} else {
diff --git a/polly/lib/Analysis/ScopBuilder.cpp b/polly/lib/Analysis/ScopBuilder.cpp
index fedaa4f588c..be19bd00744 100644
--- a/polly/lib/Analysis/ScopBuilder.cpp
+++ b/polly/lib/Analysis/ScopBuilder.cpp
@@ -1511,7 +1511,8 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
DenseMap<BasicBlock *, isl::set> InvalidDomainMap;
if (!scop->buildDomains(&R, DT, LI, InvalidDomainMap)) {
- DEBUG(dbgs() << "Bailing-out because buildDomains encountered problems\n");
+ LLVM_DEBUG(
+ dbgs() << "Bailing-out because buildDomains encountered problems\n");
return;
}
@@ -1530,7 +1531,7 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
scop->removeStmtNotInDomainMap();
scop->simplifySCoP(false);
if (scop->isEmpty()) {
- DEBUG(dbgs() << "Bailing-out because SCoP is empty\n");
+ LLVM_DEBUG(dbgs() << "Bailing-out because SCoP is empty\n");
return;
}
@@ -1546,7 +1547,7 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
// Check early for a feasible runtime context.
if (!scop->hasFeasibleRuntimeContext()) {
- DEBUG(dbgs() << "Bailing-out because of unfeasible context (early)\n");
+ LLVM_DEBUG(dbgs() << "Bailing-out because of unfeasible context (early)\n");
return;
}
@@ -1554,7 +1555,8 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
// only the runtime context could become infeasible.
if (!scop->isProfitable(UnprofitableScalarAccs)) {
scop->invalidate(PROFITABLE, DebugLoc());
- DEBUG(dbgs() << "Bailing-out because SCoP is not considered profitable\n");
+ LLVM_DEBUG(
+ dbgs() << "Bailing-out because SCoP is not considered profitable\n");
return;
}
@@ -1572,7 +1574,7 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
scop->simplifyContexts();
if (!scop->buildAliasChecks(AA)) {
- DEBUG(dbgs() << "Bailing-out because could not build alias checks\n");
+ LLVM_DEBUG(dbgs() << "Bailing-out because could not build alias checks\n");
return;
}
@@ -1584,7 +1586,7 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC,
// Check late for a feasible runtime context because profitability did not
// change.
if (!scop->hasFeasibleRuntimeContext()) {
- DEBUG(dbgs() << "Bailing-out because of unfeasible context (late)\n");
+ LLVM_DEBUG(dbgs() << "Bailing-out because of unfeasible context (late)\n");
return;
}
@@ -1608,12 +1610,12 @@ ScopBuilder::ScopBuilder(Region *R, AssumptionCache &AC, AliasAnalysis &AA,
buildScop(*R, AC, ORE);
- DEBUG(dbgs() << *scop);
+ LLVM_DEBUG(dbgs() << *scop);
if (!scop->hasFeasibleRuntimeContext()) {
InfeasibleScops++;
Msg = "SCoP ends here but was dismissed.";
- DEBUG(dbgs() << "SCoP detected but dismissed\n");
+ LLVM_DEBUG(dbgs() << "SCoP detected but dismissed\n");
scop.reset();
} else {
Msg = "SCoP ends here.";
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index 4c5c95af6e6..9fc5eeb0f0f 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -410,8 +410,8 @@ inline bool ScopDetection::invalid(DetectionContext &Context, bool Assert,
if (PollyTrackFailures)
Log.report(RejectReason);
- DEBUG(dbgs() << RejectReason->getMessage());
- DEBUG(dbgs() << "\n");
+ LLVM_DEBUG(dbgs() << RejectReason->getMessage());
+ LLVM_DEBUG(dbgs() << "\n");
} else {
assert(!Assert && "Verification of detected scop failed");
}
@@ -704,8 +704,8 @@ bool ScopDetection::isValidCallInst(CallInst &CI,
return false;
if (isDebugCall(&CI)) {
- DEBUG(dbgs() << "Allow call to debug function: "
- << CalledFunction->getName() << '\n');
+ LLVM_DEBUG(dbgs() << "Allow call to debug function: "
+ << CalledFunction->getName() << '\n');
return true;
}
@@ -1383,14 +1383,14 @@ Region *ScopDetection::expandRegion(Region &R) {
std::unique_ptr<Region> LastValidRegion;
auto ExpandedRegion = std::unique_ptr<Region>(R.getExpandedRegion());
- DEBUG(dbgs() << "\tExpanding " << R.getNameStr() << "\n");
+ LLVM_DEBUG(dbgs() << "\tExpanding " << R.getNameStr() << "\n");
while (ExpandedRegion) {
const auto &It = DetectionContextMap.insert(std::make_pair(
getBBPairForRegion(ExpandedRegion.get()),
DetectionContext(*ExpandedRegion, AA, false /*verifying*/)));
DetectionContext &Context = It.first->second;
- DEBUG(dbgs() << "\t\tTrying " << ExpandedRegion->getNameStr() << "\n");
+ LLVM_DEBUG(dbgs() << "\t\tTrying " << ExpandedRegion->getNameStr() << "\n");
// Only expand when we did not collect errors.
if (!Context.Log.hasErrors()) {
@@ -1424,7 +1424,7 @@ Region *ScopDetection::expandRegion(Region &R) {
}
}
- DEBUG({
+ LLVM_DEBUG({
if (LastValidRegion)
dbgs() << "\tto " << LastValidRegion->getNameStr() << "\n";
else
@@ -1630,23 +1630,23 @@ bool ScopDetection::isProfitableRegion(DetectionContext &Context) const {
bool ScopDetection::isValidRegion(DetectionContext &Context) const {
Region &CurRegion = Context.CurRegion;
- DEBUG(dbgs() << "Checking region: " << CurRegion.getNameStr() << "\n\t");
+ LLVM_DEBUG(dbgs() << "Checking region: " << CurRegion.getNameStr() << "\n\t");
if (!PollyAllowFullFunction && CurRegion.isTopLevelRegion()) {
- DEBUG(dbgs() << "Top level region is invalid\n");
+ LLVM_DEBUG(dbgs() << "Top level region is invalid\n");
return false;
}
DebugLoc DbgLoc;
if (CurRegion.getExit() &&
isa<UnreachableInst>(CurRegion.getExit()->getTerminator())) {
- DEBUG(dbgs() << "Unreachable in exit\n");
+ LLVM_DEBUG(dbgs() << "Unreachable in exit\n");
return invalid<ReportUnreachableInExit>(Context, /*Assert=*/true,
CurRegion.getExit(), DbgLoc);
}
if (!CurRegion.getEntry()->getName().count(OnlyRegion)) {
- DEBUG({
+ LLVM_DEBUG({
dbgs() << "Region entry does not match -polly-region-only";
dbgs() << "\n";
});
@@ -1667,7 +1667,7 @@ bool ScopDetection::isValidRegion(DetectionContext &Context) const {
return invalid<ReportIrreducibleRegion>(Context, /*Assert=*/true,
&CurRegion, DbgLoc);
- DEBUG(dbgs() << "OK\n");
+ LLVM_DEBUG(dbgs() << "OK\n");
return true;
}
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index b12aa1e482f..980f9cacbd4 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -3101,12 +3101,13 @@ bool Scop::buildAliasChecks(AliasAnalysis &AA) {
// we make the assumed context infeasible.
invalidate(ALIASING, DebugLoc());
- DEBUG(dbgs() << "\n\nNOTE: Run time checks for " << getNameStr()
- << " could not be created as the number of parameters involved "
- "is too high. The SCoP will be "
- "dismissed.\nUse:\n\t--polly-rtc-max-parameters=X\nto adjust "
- "the maximal number of parameters but be advised that the "
- "compile time might increase exponentially.\n\n");
+ LLVM_DEBUG(
+ dbgs() << "\n\nNOTE: Run time checks for " << getNameStr()
+ << " could not be created as the number of parameters involved "
+ "is too high. The SCoP will be "
+ "dismissed.\nUse:\n\t--polly-rtc-max-parameters=X\nto adjust "
+ "the maximal number of parameters but be advised that the "
+ "compile time might increase exponentially.\n\n");
return false;
}
@@ -4313,7 +4314,7 @@ void Scop::addRecordedAssumptions() {
}
void Scop::invalidate(AssumptionKind Kind, DebugLoc Loc, BasicBlock *BB) {
- DEBUG(dbgs() << "Invalidate SCoP because of reason " << Kind << "\n");
+ LLVM_DEBUG(dbgs() << "Invalidate SCoP because of reason " << Kind << "\n");
addAssumption(Kind, isl::set::empty(getParamSpace()), Loc, AS_ASSUMPTION, BB);
}
OpenPOWER on IntegriCloud