diff options
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 45 |
1 files changed, 21 insertions, 24 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index e5704c6fc20..f695b6a7c78 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -175,7 +175,8 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, // Only Constant and ICmpInst are allowed as condition. if (!(isa<Constant>(Condition) || isa<ICmpInst>(Condition))) - INVALID(AffFunc, "Condition in BB '" + BB.getName() + "' neither " + INVALID(AffFunc, "Condition in BB '" + BB.getName() + + "' neither " "constant nor an icmp instruction"); // Allow perfectly nested conditions. @@ -201,7 +202,8 @@ bool ScopDetection::isValidCFG(BasicBlock &BB, if (!isAffineExpr(&Context.CurRegion, LHS, *SE) || !isAffineExpr(&Context.CurRegion, RHS, *SE)) INVALID(AffFunc, "Non affine branch in BB '" << BB.getName() - << "' with LHS: " << *LHS << " and RHS: " << *RHS); + << "' with LHS: " << *LHS + << " and RHS: " << *RHS); } // Allow loop exit conditions. @@ -404,8 +406,9 @@ bool ScopDetection::isValidLoop(Loop *L, DetectionContext &Context) const { // Is the loop count affine? const SCEV *LoopCount = SE->getBackedgeTakenCount(L); if (!isAffineExpr(&Context.CurRegion, LoopCount, *SE)) - INVALID(LoopBound, "Non affine loop bound '" << *LoopCount << "' in loop: " - << L->getHeader()->getName()); + INVALID(LoopBound, + "Non affine loop bound '" + << *LoopCount << "' in loop: " << L->getHeader()->getName()); return true; } @@ -450,12 +453,9 @@ Region *ScopDetection::expandRegion(Region &R) { } } - DEBUG( - if (LastValidRegion) - dbgs() << "\tto " << LastValidRegion->getNameStr() << "\n"; - else - dbgs() << "\tExpanding " << R.getNameStr() << " failed\n"; - ); + DEBUG(if (LastValidRegion) + dbgs() << "\tto " << LastValidRegion->getNameStr() << "\n"; + else dbgs() << "\tExpanding " << R.getNameStr() << " failed\n";); return LastValidRegion; } @@ -543,8 +543,7 @@ bool ScopDetection::isValidRegion(DetectionContext &Context) const { // The toplevel region is no valid region. if (!R.getParent()) { - DEBUG(dbgs() << "Top level region is invalid"; - dbgs() << "\n"); + DEBUG(dbgs() << "Top level region is invalid"; dbgs() << "\n"); return false; } @@ -668,7 +667,7 @@ void ScopDetection::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); } -void ScopDetection::print(raw_ostream &OS, const Module *)const { +void ScopDetection::print(raw_ostream &OS, const Module *) const { for (RegionSet::const_iterator I = ValidRegions.begin(), E = ValidRegions.end(); I != E; ++I) @@ -685,18 +684,16 @@ void ScopDetection::releaseMemory() { char ScopDetection::ID = 0; +Pass *polly::createScopDetectionPass() { return new ScopDetection(); } + INITIALIZE_PASS_BEGIN(ScopDetection, "polly-detect", "Polly - Detect static control parts (SCoPs)", false, - false) -INITIALIZE_AG_DEPENDENCY(AliasAnalysis) -INITIALIZE_PASS_DEPENDENCY(DominatorTree) -INITIALIZE_PASS_DEPENDENCY(LoopInfo) -INITIALIZE_PASS_DEPENDENCY(PostDominatorTree) -INITIALIZE_PASS_DEPENDENCY(RegionInfo) -INITIALIZE_PASS_DEPENDENCY(ScalarEvolution) + false); +INITIALIZE_AG_DEPENDENCY(AliasAnalysis); +INITIALIZE_PASS_DEPENDENCY(DominatorTree); +INITIALIZE_PASS_DEPENDENCY(LoopInfo); +INITIALIZE_PASS_DEPENDENCY(PostDominatorTree); +INITIALIZE_PASS_DEPENDENCY(RegionInfo); +INITIALIZE_PASS_DEPENDENCY(ScalarEvolution); INITIALIZE_PASS_END(ScopDetection, "polly-detect", "Polly - Detect static control parts (SCoPs)", false, false) - -Pass *polly::createScopDetectionPass() { - return new ScopDetection(); -} |