[polly] r229879 - [REFACTOR] Simplify the SCoP detection interface a bit

Johannes Doerfert doerfert at cs.uni-saarland.de
Thu Feb 19 10:11:50 PST 2015


Author: jdoerfert
Date: Thu Feb 19 12:11:50 2015
New Revision: 229879

URL: http://llvm.org/viewvc/llvm-project?rev=229879&view=rev
Log:
[REFACTOR] Simplify the SCoP detection interface a bit


Modified:
    polly/trunk/include/polly/ScopDetection.h
    polly/trunk/lib/Analysis/ScopDetection.cpp

Modified: polly/trunk/include/polly/ScopDetection.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopDetection.h?rev=229879&r1=229878&r2=229879&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopDetection.h (original)
+++ polly/trunk/include/polly/ScopDetection.h Thu Feb 19 12:11:50 2015
@@ -208,13 +208,6 @@ private:
   /// @return True if R is a Scop, false otherwise.
   bool isValidRegion(DetectionContext &Context) const;
 
-  /// @brief Check if a region is a Scop.
-  ///
-  /// @param Context The context of scop detection.
-  ///
-  /// @return True if R is a Scop, false otherwise.
-  bool isValidRegion(Region &R) const;
-
   /// @brief Check if a call instruction can be part of a Scop.
   ///
   /// @param CI The call instruction to check.

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=229879&r1=229878&r2=229879&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Thu Feb 19 12:11:50 2015
@@ -251,8 +251,10 @@ bool ScopDetection::isMaxRegionInScop(co
   if (!ValidRegions.count(&R))
     return false;
 
-  if (Verify)
-    return isValidRegion(const_cast<Region &>(R));
+  if (Verify) {
+    DetectionContext Context(const_cast<Region &>(R), *AA, false /*verifying*/);
+    return isValidRegion(Context);
+  }
 
   return true;
 }
@@ -731,10 +733,14 @@ void ScopDetection::findScops(Region &R)
   if (!DetectRegionsWithoutLoops && regionWithoutLoops(R, LI))
     return;
 
-  bool IsValidRegion = isValidRegion(R);
-  bool HasErrors = RejectLogs.count(&R) > 0;
+  DetectionContext Context(R, *AA, false /*verifying*/);
+  bool RegionIsValid = isValidRegion(Context);
+  bool HasErrors = !RegionIsValid || Context.Log.size() > 0;
 
-  if (IsValidRegion && !HasErrors) {
+  if (PollyTrackFailures && HasErrors)
+    RejectLogs.insert(std::make_pair(&R, Context.Log));
+
+  if (!HasErrors) {
     ++ValidRegion;
     ValidRegions.insert(&R);
     return;
@@ -817,18 +823,6 @@ bool ScopDetection::isValidExit(Detectio
   return true;
 }
 
-bool ScopDetection::isValidRegion(Region &R) const {
-  DetectionContext Context(R, *AA, false /*verifying*/);
-
-  bool RegionIsValid = isValidRegion(Context);
-  bool HasErrors = !RegionIsValid || Context.Log.size() > 0;
-
-  if (PollyTrackFailures && HasErrors)
-    RejectLogs.insert(std::make_pair(&R, Context.Log));
-
-  return RegionIsValid;
-}
-
 bool ScopDetection::isValidRegion(DetectionContext &Context) const {
   Region &R = Context.CurRegion;
 





More information about the llvm-commits mailing list