From: Tobias Grosser Date: Tue, 18 Feb 2014 18:49:46 +0000 (+0000) Subject: Add ScopDetection::isValidRegion(Region) X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9b1100b30506c6abb9674b8dd078f1743255c53b;p=platform%2Fupstream%2Fllvm.git Add ScopDetection::isValidRegion(Region) llvm-svn: 201592 --- diff --git a/polly/include/polly/ScopDetection.h b/polly/include/polly/ScopDetection.h index 687512d..242a7d0 100755 --- a/polly/include/polly/ScopDetection.h +++ b/polly/include/polly/ScopDetection.h @@ -141,6 +141,13 @@ class ScopDetection : public FunctionPass { /// @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. diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 8c6b3a9..85389ab 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -613,11 +613,9 @@ void ScopDetection::findScops(Region &R) { if (!DetectRegionsWithoutLoops && regionWithoutLoops(R, LI)) return; - DetectionContext Context(R, *AA, false /*verifying*/); - LastFailure = ""; - if (isValidRegion(Context)) { + if (isValidRegion(R)) { ++ValidRegion; ValidRegions.insert(&R); return; @@ -704,6 +702,11 @@ bool ScopDetection::isValidExit(DetectionContext &Context) const { return true; } +bool ScopDetection::isValidRegion(Region &R) const { + DetectionContext Context(R, *AA, false /*verifying*/); + return isValidRegion(Context); +} + bool ScopDetection::isValidRegion(DetectionContext &Context) const { Region &R = Context.CurRegion;