[polly] r247057 - Move more compile-time bailouts into -polly-detect-unprofitable

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 8 12:46:41 PDT 2015


Author: grosser
Date: Tue Sep  8 14:46:41 2015
New Revision: 247057

URL: http://llvm.org/viewvc/llvm-project?rev=247057&view=rev
Log:
Move more compile-time bailouts into -polly-detect-unprofitable

Instead of having two separate options
-polly-detect-scops-in-functions-without-loops and
-polly-detect-scops-in-regions-without-loops we now just use
-polly-detect-unprofitable to force the detection of scops ignoring any compile
time saving bailout heuristics.

Modified:
    polly/trunk/lib/Analysis/ScopDetection.cpp
    polly/trunk/test/Isl/CodeGen/20120316-InvalidCast.ll
    polly/trunk/test/Isl/CodeGen/constant_condition.ll
    polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll
    polly/trunk/test/ScopDetect/non-affine-loop.ll
    polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll
    polly/trunk/test/ScopDetect/simple_non_single_entry.ll
    polly/trunk/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll
    polly/trunk/test/ScopInfo/cfg_consequences.ll

Modified: polly/trunk/lib/Analysis/ScopDetection.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Analysis/ScopDetection.cpp?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/lib/Analysis/ScopDetection.cpp (original)
+++ polly/trunk/lib/Analysis/ScopDetection.cpp Tue Sep  8 14:46:41 2015
@@ -73,18 +73,6 @@ using namespace polly;
 
 #define DEBUG_TYPE "polly-detect"
 
-static cl::opt<bool>
-    DetectScopsWithoutLoops("polly-detect-scops-in-functions-without-loops",
-                            cl::desc("Detect scops in functions without loops"),
-                            cl::Hidden, cl::init(false), cl::ZeroOrMore,
-                            cl::cat(PollyCategory));
-
-static cl::opt<bool>
-    DetectRegionsWithoutLoops("polly-detect-scops-in-regions-without-loops",
-                              cl::desc("Detect scops in regions without loops"),
-                              cl::Hidden, cl::init(false), cl::ZeroOrMore,
-                              cl::cat(PollyCategory));
-
 static cl::opt<bool> DetectUnprofitable("polly-detect-unprofitable",
                                         cl::desc("Detect unprofitable scops"),
                                         cl::Hidden, cl::init(false),
@@ -877,7 +865,7 @@ void ScopDetection::findScops(Region &R)
                            false /*verifying*/);
 
   bool RegionIsValid = false;
-  if (!DetectRegionsWithoutLoops && regionWithoutLoops(R, LI))
+  if (!DetectUnprofitable && regionWithoutLoops(R, LI))
     invalid<ReportUnprofitable>(Context, /*Assert=*/true, &R);
   else
     RegionIsValid = isValidRegion(Context);
@@ -1027,7 +1015,7 @@ bool ScopDetection::isValidRegion(Detect
 
   // Check if there was at least one non-overapproximated loop in the region or
   // we allow regions without loops.
-  if (!DetectRegionsWithoutLoops && !Context.hasAffineLoops)
+  if (!DetectUnprofitable && !Context.hasAffineLoops)
     invalid<ReportUnprofitable>(Context, /*Assert=*/true, &CurRegion);
 
   DEBUG(dbgs() << "OK\n");
@@ -1083,7 +1071,7 @@ void ScopDetection::emitMissedRemarksFor
 bool ScopDetection::runOnFunction(llvm::Function &F) {
   LI = &getAnalysis<LoopInfoWrapperPass>().getLoopInfo();
   RI = &getAnalysis<RegionInfoPass>().getRegionInfo();
-  if (!DetectScopsWithoutLoops && LI->empty())
+  if (!DetectUnprofitable && LI->empty())
     return false;
 
   AA = &getAnalysis<AliasAnalysis>();

Modified: polly/trunk/test/Isl/CodeGen/20120316-InvalidCast.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/20120316-InvalidCast.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/20120316-InvalidCast.ll (original)
+++ polly/trunk/test/Isl/CodeGen/20120316-InvalidCast.ll Tue Sep  8 14:46:41 2015
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -polly-detect-unprofitable -S -polly-detect-scops-in-functions-without-loops -polly-detect-scops-in-regions-without-loops -polly-codegen -polly-no-early-exit < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -S -polly-codegen -polly-no-early-exit < %s | FileCheck %s
 
 ; CHECK: polly.start
 

Modified: polly/trunk/test/Isl/CodeGen/constant_condition.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/constant_condition.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/constant_condition.ll (original)
+++ polly/trunk/test/Isl/CodeGen/constant_condition.ll Tue Sep  8 14:46:41 2015
@@ -1,4 +1,4 @@
-;RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-prepare -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-ast -analyze < %s | FileCheck %s
+;RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-prepare -polly-ast -analyze < %s | FileCheck %s
 
 ;#include <string.h>
 ;int A[1];

Modified: polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll (original)
+++ polly/trunk/test/Isl/CodeGen/simple_non_single_entry.ll Tue Sep  8 14:46:41 2015
@@ -1,5 +1,5 @@
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-detect-scops-in-regions-without-loops -polly-codegen -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-detect-scops-in-regions-without-loops -polly-codegen -S < %s | FileCheck %s -check-prefix=CHECK-CODE
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-no-early-exit -polly-codegen -S < %s | FileCheck %s -check-prefix=CHECK-CODE
 
 ; void f(long A[], long N) {
 ;   long i;

Modified: polly/trunk/test/ScopDetect/non-affine-loop.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/non-affine-loop.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/non-affine-loop.ll (original)
+++ polly/trunk/test/ScopDetect/non-affine-loop.ll Tue Sep  8 14:46:41 2015
@@ -6,13 +6,8 @@
 ; RUN:     -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS
 ; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches \
 ; RUN:     -polly-allow-nonaffine-loops=true -polly-allow-nonaffine \
-; RUN:     -polly-detect-unprofitable -analyze < %s | FileCheck %s \
+; RUN:     -analyze < %s | FileCheck %s \
 ; RUN:     --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES
-; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches \
-; RUN:     -polly-allow-nonaffine-loops=true -polly-allow-nonaffine \
-; RUN:     -polly-detect-scops-in-regions-without-loops \
-; RUN:     -polly-detect-unprofitable -analyze < %s | FileCheck %s \
-; RUN:     --check-prefix=ALLOWNONAFFINELOOPSANDACCESSESANDNOLOOPS
 ;
 ; This function/region does contain a loop, however it is non-affine, hence the access
 ; A[i] is also. Furthermore, it is the only loop, thus when we over approximate
@@ -27,7 +22,6 @@
 ; REJECTNONAFFINELOOPS-NOT:                 Valid
 ; ALLOWNONAFFINELOOPS-NOT:                  Valid
 ; ALLOWNONAFFINELOOPSANDACCESSES-NOT:       Valid
-; ALLOWNONAFFINELOOPSANDACCESSESANDNOLOOPS: Valid Region for Scop: bb1 => bb10
 ;
 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
 

Modified: polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll (original)
+++ polly/trunk/test/ScopDetect/parametric-multiply-in-scev.ll Tue Sep  8 14:46:41 2015
@@ -1,5 +1,5 @@
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-detect -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-scops-in-regions-without-loops -polly-detect-scops-in-functions-without-loops -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect -analyze < %s | FileCheck %s
 
 
 ;  foo(float *A, long n, long k) {

Modified: polly/trunk/test/ScopDetect/simple_non_single_entry.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/simple_non_single_entry.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/ScopDetect/simple_non_single_entry.ll (original)
+++ polly/trunk/test/ScopDetect/simple_non_single_entry.ll Tue Sep  8 14:46:41 2015
@@ -1,5 +1,5 @@
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-scops-in-regions-without-loops -polly-detect -analyze < %s | FileCheck %s
-; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-scops-in-regions-without-loops -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect -analyze < %s | FileCheck %s
+; RUN: opt %loadPolly -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect -analyze < %s | FileCheck %s
 
 ; void f(long A[], long N) {
 ;   long i;

Modified: polly/trunk/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll (original)
+++ polly/trunk/test/ScopDetectionDiagnostics/ReportLoopBound-01.ll Tue Sep  8 14:46:41 2015
@@ -1,6 +1,6 @@
 ; RUN: opt %loadPolly -polly-detect-unprofitable -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-allow-nonaffine-loops=false -polly-detect -analyze < %s 2>&1| FileCheck %s --check-prefix=REJECTNONAFFINELOOPS
 ; RUN: opt %loadPolly -polly-detect-unprofitable -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-allow-nonaffine-loops=true -polly-detect -analyze < %s 2>&1| FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS
-; RUN: opt %loadPolly -polly-detect-unprofitable -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-allow-nonaffine-loops=true -polly-allow-nonaffine -polly-detect -analyze < %s 2>&1| FileCheck %s --check-prefix=ALLOWNONAFFINEALL
+; RUN: opt %loadPolly -pass-remarks-missed="polly-detect" -polly-detect-track-failures -polly-allow-nonaffine-loops=true -polly-allow-nonaffine -polly-detect -analyze < %s 2>&1| FileCheck %s --check-prefix=ALLOWNONAFFINEALL
 
 ; void f(int A[], int n) {
 ;   for (int i = 0; i < A[n]; i++)

Modified: polly/trunk/test/ScopInfo/cfg_consequences.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/cfg_consequences.ll?rev=247057&r1=247056&r2=247057&view=diff
==============================================================================
--- polly/trunk/test/ScopInfo/cfg_consequences.ll (original)
+++ polly/trunk/test/ScopInfo/cfg_consequences.ll Tue Sep  8 14:46:41 2015
@@ -1,4 +1,4 @@
-; RUN: opt %loadPolly -analyze -polly-scops -polly-detect-scops-in-functions-without-loops -polly-detect-scops-in-regions-without-loops -polly-detect-unprofitable < %s | FileCheck %s
+; RUN: opt %loadPolly -analyze -polly-scops -polly-detect-unprofitable -polly-detect-unprofitable -polly-detect-unprofitable < %s | FileCheck %s
 ;
 ; void consequences(int *A, int bool_cond, int lhs, int rhs) {
 ;




More information about the llvm-commits mailing list