summaryrefslogtreecommitdiffstats
path: root/polly/lib/Analysis/ScopDetection.cpp
diff options
context:
space:
mode:
authorJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-05-19 12:36:43 +0000
committerJohannes Doerfert <doerfert@cs.uni-saarland.de>2016-05-19 12:36:43 +0000
commit469db6a2476c1221ec44b098fa9577347f8b3704 (patch)
tree9f7627c97b7cb8d08a74cf6f4624ec682113e854 /polly/lib/Analysis/ScopDetection.cpp
parentffd222f2d671d5e15b10d17a19bab21f16891a5d (diff)
downloadbcm5719-llvm-469db6a2476c1221ec44b098fa9577347f8b3704.tar.gz
bcm5719-llvm-469db6a2476c1221ec44b098fa9577347f8b3704.zip
Move internal enum out of class declaration [NFC]
llvm-svn: 270054
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
-rw-r--r--polly/lib/Analysis/ScopDetection.cpp19
1 files changed, 13 insertions, 6 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp
index bfc9a99ff86..9aa969ae5f0 100644
--- a/polly/lib/Analysis/ScopDetection.cpp
+++ b/polly/lib/Analysis/ScopDetection.cpp
@@ -1380,6 +1380,13 @@ void ScopDetection::emitMissedRemarks(const Function &F) {
}
}
+/// @brief Enum for coloring BBs in Region.
+///
+/// WHITE - Unvisited BB in DFS walk.
+/// GREY - BBs which are currently on the DFS stack for processing.
+/// BLACK - Visited and completely processed BB.
+enum Color { WHITE, GREY, BLACK };
+
bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const {
BasicBlock *REntry = R.getEntry();
BasicBlock *RExit = R.getExit();
@@ -1394,10 +1401,10 @@ bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const {
// Initialize the map for all BB with WHITE color.
for (auto *BB : R.blocks())
- BBColorMap[BB] = ScopDetection::WHITE;
+ BBColorMap[BB] = WHITE;
// Process the entry block of the Region.
- BBColorMap[CurrBB] = ScopDetection::GREY;
+ BBColorMap[CurrBB] = GREY;
DFSStack.push(std::make_pair(CurrBB, 0));
while (!DFSStack.empty()) {
@@ -1418,15 +1425,15 @@ bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const {
continue;
// WHITE indicates an unvisited BB in DFS walk.
- if (BBColorMap[SuccBB] == ScopDetection::WHITE) {
+ if (BBColorMap[SuccBB] == WHITE) {
// Push the current BB and the index of the next child to be visited.
DFSStack.push(std::make_pair(CurrBB, I + 1));
// Push the next BB to be processed.
DFSStack.push(std::make_pair(SuccBB, 0));
// First time the BB is being processed.
- BBColorMap[SuccBB] = ScopDetection::GREY;
+ BBColorMap[SuccBB] = GREY;
break;
- } else if (BBColorMap[SuccBB] == ScopDetection::GREY) {
+ } else if (BBColorMap[SuccBB] == GREY) {
// GREY indicates a loop in the control flow.
// If the destination dominates the source, it is a natural loop
// else, an irreducible control flow in the region is detected.
@@ -1441,7 +1448,7 @@ bool ScopDetection::isReducibleRegion(Region &R, DebugLoc &DbgLoc) const {
// If all children of current BB have been processed,
// then mark that BB as fully processed.
if (AdjacentBlockIndex == NSucc)
- BBColorMap[CurrBB] = ScopDetection::BLACK;
+ BBColorMap[CurrBB] = BLACK;
}
return true;
OpenPOWER on IntegriCloud