[polly] r253789 - Do not enforce lcssa

Johannes Doerfert via llvm-commits llvm-commits at lists.llvm.org
Sat Nov 21 09:00:02 PST 2015


Author: jdoerfert
Date: Sat Nov 21 11:00:02 2015
New Revision: 253789

URL: http://llvm.org/viewvc/llvm-project?rev=253789&view=rev
Log:
Do not enforce lcssa

  At some point we enforced lcssa for the loop surrounding the entry block.
  This is not only questionable as it does not check any other loop but also
  not needed any more.

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

Modified: polly/trunk/include/polly/ScopDetectionDiagnostic.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/ScopDetectionDiagnostic.h?rev=253789&r1=253788&r2=253789&view=diff
==============================================================================
--- polly/trunk/include/polly/ScopDetectionDiagnostic.h (original)
+++ polly/trunk/include/polly/ScopDetectionDiagnostic.h Sat Nov 21 11:00:02 2015
@@ -84,8 +84,6 @@ enum RejectReasonKind {
 
   rrkAlias,
 
-  rrkSimpleLoop,
-
   // Other
   rrkOther,
   rrkIntToPtr,
@@ -616,24 +614,6 @@ public:
   //@}
 };
 
-//===----------------------------------------------------------------------===//
-/// @brief Captures errors with non simplified loops.
-class ReportSimpleLoop : public RejectReason {
-  //===--------------------------------------------------------------------===//
-public:
-  ReportSimpleLoop();
-
-  /// @name LLVM-RTTI interface
-  //@{
-  static bool classof(const RejectReason *RR);
-  //@}
-
-  /// @name RejectReason interface
-  //@{
-  virtual std::string getMessage() const override;
-  //@}
-};
-
 //===----------------------------------------------------------------------===//
 /// @brief Base class for otherwise ungrouped reject reasons.
 class ReportOther : public RejectReason {

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=253789&r1=253788&r2=253789&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Sat Nov 21 11:00:02 2015
@@ -1031,14 +1031,6 @@ bool ScopDetection::isValidRegion(Detect
     return false;
   }
 
-  if (!CurRegion.getEnteringBlock()) {
-    BasicBlock *entry = CurRegion.getEntry();
-    Loop *L = LI->getLoopFor(entry);
-
-    if (L && !L->isLoopSimplifyForm())
-      return invalid<ReportSimpleLoop>(Context, /*Assert=*/true);
-  }
-
   // SCoP cannot contain the entry block of the function, because we need
   // to insert alloca instruction there when translate scalar to array.
   if (CurRegion.getEntry() ==

Modified: polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp?rev=253789&r1=253788&r2=253789&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetectionDiagnostic.cpp Sat Nov 21 11:00:02 2015
@@ -44,7 +44,6 @@ BADSCOP_STAT(LoopBound, "Loop bounds can
 BADSCOP_STAT(FuncCall, "Function call with side effects appeared");
 BADSCOP_STAT(AffFunc, "Expression not affine");
 BADSCOP_STAT(Alias, "Found base address alias");
-BADSCOP_STAT(SimpleLoop, "Loop not in -loop-simplify form");
 BADSCOP_STAT(Other, "Others");
 
 namespace polly {
@@ -419,21 +418,6 @@ bool ReportAlias::classof(const RejectRe
 }
 
 //===----------------------------------------------------------------------===//
-// ReportSimpleLoop.
-
-ReportSimpleLoop::ReportSimpleLoop() : RejectReason(rrkSimpleLoop) {
-  ++BadSimpleLoopForScop;
-}
-
-std::string ReportSimpleLoop::getMessage() const {
-  return "Loop not in simplify form is invalid!";
-}
-
-bool ReportSimpleLoop::classof(const RejectReason *RR) {
-  return RR->getKind() == rrkSimpleLoop;
-}
-
-//===----------------------------------------------------------------------===//
 // ReportOther.
 
 std::string ReportOther::getMessage() const { return "Unknown reject reason"; }

Modified: polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll?rev=253789&r1=253788&r2=253789&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll (original)
+++ polly/trunk/test/ScopDetect/simple_loop_non_single_entry.ll Sat Nov 21 11:00:02 2015
@@ -13,7 +13,7 @@
 ;     A[i] = i;
 ; }
 
-; We will not detect this scop, as the loop is not in -loop-simplify form.
+; We will detect this scop even if the loop is not in lcssa form
 
 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"
 
@@ -41,4 +41,4 @@ return:
   ret void
 }
 
-; CHECK-NOT: Valid Region for Scop
+; CHECK: Valid Region for Scop




More information about the llvm-commits mailing list