[polly] r248695 - Remove obsolete check

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 18:30:37 PDT 2015


Author: jdoerfert
Date: Sun Sep 27 20:30:37 2015
New Revision: 248695

URL: http://llvm.org/viewvc/llvm-project?rev=248695&view=rev
Log:
Remove obsolete check

  This check was needed at some point but seems not useful anymore. Only
  one adjustment in the domain generation was needed to cope with the
  cases this check prevented from happening before.

Modified:
    polly/trunk/include/polly/ScopDetectionDiagnostic.h
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp
    polly/trunk/lib/Analysis/ScopInfo.cpp
    polly/trunk/test/ScopDetect/indvars.ll

Modified: polly/trunk/include/polly/ScopDetectionDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopDetectionDiagnostic.h?rev=248695&r1=248694&r2=248695&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopDetectionDiagnostic.h (original)
+++ polly/trunk/include/polly/ScopDetectionDiagnostic.h Sun Sep 27 20:30:37 2015
@@ -80,8 +80,6 @@ enum RejectReasonKind {
   rrkDifferentElementSize,
   rrkLastAffFunc,
 
-  rrkIndEdge,
-
   rrkLoopBound,
 
   rrkFuncCall,
@@ -526,28 +524,6 @@ public:
   //@}
 };
 
-//===----------------------------------------------------------------------===//
-/// @brief Captures a region with invalid entering edges.
-class ReportIndEdge : public RejectReason {
-  //===--------------------------------------------------------------------===//
-
-  BasicBlock *BB;
-
-public:
-  ReportIndEdge(BasicBlock *BB);
-
-  /// @name LLVM-RTTI interface
-  //@{
-  static bool classof(const RejectReason *RR);
-  //@}
-
-  /// @name RejectReason interface
-  //@{
-  virtual std::string getMessage() const override;
-  virtual const DebugLoc &getDebugLoc() const override;
-  //@}
-};
-
 //===----------------------------------------------------------------------===//
 /// @brief Captures errors with non affine loop bounds.
 class ReportLoopBound : public RejectReason {

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=248695&r1=248694&r2=248695&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sun Sep 27 20:30:37 2015
@@ -949,18 +949,8 @@ bool ScopDetection::isValidRegion(Detect
     BasicBlock *entry = CurRegion.getEntry();
     Loop *L = LI->getLoopFor(entry);
 
-    if (L) {
-      if (!L->isLoopSimplifyForm())
-        return invalid<ReportSimpleLoop>(Context, /*Assert=*/true);
-
-      for (pred_iterator PI = pred_begin(entry), PE = pred_end(entry); PI != PE;
-           ++PI) {
-        // Region entering edges come from the same loop but outside the region
-        // are not allowed.
-        if (L->contains(*PI) && !CurRegion.contains(*PI))
-          return invalid<ReportIndEdge>(Context, /*Assert=*/true, *PI);
-      }
-    }
+    if (L && !L->isLoopSimplifyForm())
+      return invalid<ReportSimpleLoop>(Context, /*Assert=*/true);
   }
 
   // SCoP cannot contain the entry block of the function, because we need

Modified: polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp?rev=248695&r1=248694&r2=248695&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp Sun Sep 27 20:30:37 2015
@@ -40,7 +40,6 @@
   STATISTIC(Bad##NAME##ForScop, "Number of bad regions for Scop: " DESC)
 
 BADSCOP_STAT(CFG, "CFG too complex");
-BADSCOP_STAT(IndEdge, "Found invalid region entering edges");
 BADSCOP_STAT(LoopBound, "Loop bounds can not be computed");
 BADSCOP_STAT(FuncCall, "Function call with side effects appeared");
 BADSCOP_STAT(AffFunc, "Expression not affine");
@@ -301,26 +300,6 @@ std::string ReportNonAffineAccess::getEn
 }
 
 //===----------------------------------------------------------------------===//
-// ReportIndEdge.
-
-ReportIndEdge::ReportIndEdge(BasicBlock *BB)
-    : RejectReason(rrkIndEdge), BB(BB) {
-  ++BadIndEdgeForScop;
-}
-
-std::string ReportIndEdge::getMessage() const {
-  return "Region has invalid entering edges!";
-}
-
-const DebugLoc &ReportIndEdge::getDebugLoc() const {
-  return BB->getTerminator()->getDebugLoc();
-}
-
-bool ReportIndEdge::classof(const RejectReason *RR) {
-  return RR->getKind() == rrkIndEdge;
-}
-
-//===----------------------------------------------------------------------===//
 // ReportLoopBound.
 
 ReportLoopBound::ReportLoopBound(Loop *L, const SCEV *LoopCount)

Modified: polly/trunk/lib/Analysis/ScopInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopInfo.cpp?rev=248695&r1=248694&r2=248695&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopInfo.cpp (original)
+++ polly/trunk/lib/Analysis/ScopInfo.cpp Sun Sep 27 20:30:37 2015
@@ -1861,7 +1861,7 @@ void Scop::propagateDomainConstraints(Re
     // Under the union of all predecessor conditions we can reach this block.
     Domain = isl_set_coalesce(isl_set_intersect(Domain, PredDom));
 
-    if (BBLoop && BBLoop->getHeader() == BB)
+    if (BBLoop && BBLoop->getHeader() == BB && getRegion().contains(BBLoop))
       addLoopBoundsToHeaderDomain(BBLoop, LI);
 
     // Add assumptions for error blocks.

Modified: polly/trunk/test/ScopDetect/indvars.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/indvars.ll?rev=248695&r1=248694&r2=248695&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/indvars.ll (original)
+++ polly/trunk/test/ScopDetect/indvars.ll Sun Sep 27 20:30:37 2015
@@ -1,8 +1,5 @@
 ; RUN: opt %loadPolly -polly-detect-unprofitable -analyze -polly-detect -polly-codegen < %s | FileCheck %s
 ;
-; When a region header is part of a loop, then all entering edges of this region
-; should not come from the loop but outside the region.
-
 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
 
 define void @main(i64* %A) nounwind {
@@ -37,4 +34,4 @@ for.i.backedge:
   ret void
 }
 
-; CHECK: Valid Region for Scop: for.j => for.j2
+; CHECK: Valid Region for Scop: for.i => for.j2




More information about the llvm-commits mailing list