Index: include/polly/ScopDetection.h =================================================================== --- include/polly/ScopDetection.h +++ include/polly/ScopDetection.h @@ -171,9 +171,6 @@ /// @brief The region has at least one store instruction. bool hasStores; - /// @brief The region has at least one loop that is not overapproximated. - bool hasAffineLoops; - /// @brief The set of non-affine subregions in the region we analyze. NonAffineSubRegionSetTy &NonAffineSubRegionSet; @@ -184,7 +181,7 @@ NonAffineSubRegionSetTy &NASRS, BoxedLoopsSetTy &BLS, bool Verify) : CurRegion(R), AST(AA), Verifying(Verify), Log(&R), hasLoads(false), - hasStores(false), hasAffineLoops(false), NonAffineSubRegionSet(NASRS), + hasStores(false), NonAffineSubRegionSet(NASRS), BoxedLoopsSet(BLS) {} }; @@ -294,6 +291,11 @@ /// @return True if the loop is valid in the region. bool isValidLoop(Loop *L, DetectionContext &Context) const; + /// @brief Check if a region contains more than one loop + /// + /// @param R The region to check + bool hasMoreThanOneLoop(Region *R) const; + /// @brief Check if the function @p F is marked as invalid. /// /// @note An OpenMP subfunction will be marked as invalid. Index: lib/Analysis/ScopDetection.cpp =================================================================== --- lib/Analysis/ScopDetection.cpp +++ lib/Analysis/ScopDetection.cpp @@ -79,12 +79,6 @@ cl::Hidden, cl::init(false), cl::ZeroOrMore, cl::cat(PollyCategory)); -static cl::opt - 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 DetectUnprofitable("polly-detect-unprofitable", cl::desc("Detect unprofitable scops"), cl::Hidden, cl::init(false), @@ -732,7 +726,6 @@ // Is the loop count affine? const SCEV *LoopCount = SE->getBackedgeTakenCount(L); if (isAffineExpr(&Context.CurRegion, LoopCount, *SE)) { - Context.hasAffineLoops = true; return true; } @@ -746,6 +739,23 @@ return invalid(Context, /*Assert=*/true, L, LoopCount); } +bool ScopDetection::hasMoreThanOneLoop(Region *R) const { + Loop *EntryLoop = LI->getLoopFor(R->getEntry()); + if (!EntryLoop) + return false; + + if (!EntryLoop->getSubLoops().empty()) + return true; + + for (pred_iterator PI = pred_begin(R->getExit()), PE = pred_end(R->getExit()); + PI != PE; ++PI) + if (R->contains(*PI)) + if (EntryLoop != LI->getLoopFor(*PI)) + return true; + + return false; +} + Region *ScopDetection::expandRegion(Region &R) { // Initial no valid region was found (greater than R) std::unique_ptr LastValidRegion; @@ -823,7 +833,7 @@ false /*verifying*/); bool RegionIsValid = false; - if (!DetectRegionsWithoutLoops && regionWithoutLoops(R, LI)) + if (regionWithoutLoops(R, LI)) invalid(Context, /*Assert=*/true, &R); else RegionIsValid = isValidRegion(Context); @@ -956,6 +966,9 @@ if (CurRegion.getEntry() == &(CurRegion.getEntry()->getParent()->getEntryBlock())) return invalid(Context, /*Assert=*/true, CurRegion.getEntry()); + + if(!DetectUnprofitable && !hasMoreThanOneLoop(&CurRegion)) + invalid(Context, /*Assert=*/true, &CurRegion); if (!isValidExit(Context)) return false; @@ -968,11 +981,6 @@ if (!DetectUnprofitable && (!Context.hasStores || !Context.hasLoads)) invalid(Context, /*Assert=*/true, &CurRegion); - // Check if there was at least one non-overapproximated loop in the region or - // we allow regions without loops. - if (!DetectRegionsWithoutLoops && !Context.hasAffineLoops) - invalid(Context, /*Assert=*/true, &CurRegion); - DEBUG(dbgs() << "OK\n"); return true; } Index: test/DependenceInfo/different_schedule_dimensions.ll =================================================================== --- test/DependenceInfo/different_schedule_dimensions.ll +++ test/DependenceInfo/different_schedule_dimensions.ll @@ -1,4 +1,5 @@ -; RUN: opt -S %loadPolly -polly-dependences -analyze < %s | FileCheck %s +; RUN: opt -S %loadPolly -polly-dependences -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s ; CHECK: RAW dependences: ; CHECK: { Stmt_bb9[0] -> Stmt_bb10[0] } Index: test/Isl/Ast/assumed_context_empty_domain_restriction.ll =================================================================== --- test/Isl/Ast/assumed_context_empty_domain_restriction.ll +++ test/Isl/Ast/assumed_context_empty_domain_restriction.ll @@ -1,6 +1,9 @@ -; RUN: opt %loadPolly -analyze -polly-detect < %s | FileCheck %s --check-prefix=DETECT -; RUN: opt %loadPolly -analyze -polly-scops < %s | FileCheck %s --check-prefix=INFO -; RUN: opt %loadPolly -analyze -polly-ast < %s | FileCheck %s +; RUN: opt %loadPolly -analyze -polly-detect -polly-detect-unprofitable < %s | \ +; RUN: FileCheck %s --check-prefix=DETECT +; RUN: opt %loadPolly -analyze -polly-scops -polly-detect-unprofitable < %s | \ +; RUN: FileCheck %s --check-prefix=INFO +; RUN: opt %loadPolly -analyze -polly-ast -polly-detect-unprofitable < %s | \ +; RUN: FileCheck %s ; ; This test used to crash the scalar code generation, now we will bail out after ; ScopInfo and destory the ScoP as the runtime context is empty. Index: test/Isl/CodeGen/20120316-InvalidCast.ll =================================================================== --- test/Isl/CodeGen/20120316-InvalidCast.ll +++ test/Isl/CodeGen/20120316-InvalidCast.ll @@ -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-detect-scops-in-functions-without-loops -polly-codegen -polly-no-early-exit < %s | FileCheck %s ; CHECK: polly.start Index: test/Isl/CodeGen/alias-check-multi-dim.ll =================================================================== --- test/Isl/CodeGen/alias-check-multi-dim.ll +++ test/Isl/CodeGen/alias-check-multi-dim.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -polly-delinearize -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-delinearize \ +; RUN: -polly-detect-unprofitable -S < %s | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" ; CHECK: sext i32 %indvar.init to i64 Index: test/Isl/CodeGen/constant_condition.ll =================================================================== --- test/Isl/CodeGen/constant_condition.ll +++ test/Isl/CodeGen/constant_condition.ll @@ -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-detect-scops-in-functions-without-loops -polly-ast -analyze < %s | FileCheck %s ;#include ;int A[1]; Index: test/Isl/CodeGen/exprModDiv.ll =================================================================== --- test/Isl/CodeGen/exprModDiv.ll +++ test/Isl/CodeGen/exprModDiv.ll @@ -1,5 +1,8 @@ -; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-codegen -S < %s | FileCheck %s -; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-codegen -polly-import-jscop-postfix=pow2 -S < %s | FileCheck %s -check-prefix=POW2 +; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S \ +; RUN: -polly-codegen -polly-detect-unprofitable -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S \ +; RUN: -polly-codegen -polly-import-jscop-postfix=pow2 \ +; RUN: -polly-detect-unprofitable -S < %s | FileCheck %s -check-prefix=POW2 ; ; void exprModDiv(float *A, float *B, float *C, long N, long p) { ; for (long i = 0; i < N; i++) Index: test/Isl/CodeGen/getNumberOfIterations.ll =================================================================== --- test/Isl/CodeGen/getNumberOfIterations.ll +++ test/Isl/CodeGen/getNumberOfIterations.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-vectorizer=polly -polly-codegen < %s -S | FileCheck %s +; RUN: opt %loadPolly -polly-vectorizer=polly -polly-codegen \ +; RUN: -polly-detect-unprofitable < %s -S | FileCheck %s ; #pragma known-parallel ; for (int c0 = 0; c0 <= min(15, N - 1); c0 += 1) Index: test/Isl/CodeGen/inner_scev_sdiv_in_lb_invariant.ll =================================================================== --- test/Isl/CodeGen/inner_scev_sdiv_in_lb_invariant.ll +++ test/Isl/CodeGen/inner_scev_sdiv_in_lb_invariant.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -S -polly-codegen -polly-no-early-exit < %s | FileCheck %s +; RUN: opt %loadPolly -S -polly-codegen -polly-no-early-exit \ +; RUN: -polly-detect-unprofitable < %s | FileCheck %s ; ; Check that this will not crash our code generation. ; Index: test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll =================================================================== --- test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll +++ test/Isl/CodeGen/inner_scev_sdiv_in_rtc.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit \ +; RUN: -polly-detect-unprofitable -S < %s | FileCheck %s ; ; This will just check that we generate valid code here. ; Index: test/Isl/CodeGen/multidim-non-matching-typesize-2.ll =================================================================== --- test/Isl/CodeGen/multidim-non-matching-typesize-2.ll +++ test/Isl/CodeGen/multidim-non-matching-typesize-2.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-detect-unprofitable \ +; RUN: -S < %s | FileCheck %s ; CHECK: polly target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" Index: test/Isl/CodeGen/multidim-non-matching-typesize.ll =================================================================== --- test/Isl/CodeGen/multidim-non-matching-typesize.ll +++ test/Isl/CodeGen/multidim-non-matching-typesize.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-detect-unprofitable \ +; RUN: -S < %s | FileCheck %s target datalayout = "e-m:o-p:32:32-f64:32:64-f80:128-n8:16:32-S128" Index: test/Isl/CodeGen/non-affine-phi-node-expansion-2.ll =================================================================== --- test/Isl/CodeGen/non-affine-phi-node-expansion-2.ll +++ test/Isl/CodeGen/non-affine-phi-node-expansion-2.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit \ +; RUN: -polly-detect-unprofitable -S < %s | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" Index: test/Isl/CodeGen/non-affine-phi-node-expansion.ll =================================================================== --- test/Isl/CodeGen/non-affine-phi-node-expansion.ll +++ test/Isl/CodeGen/non-affine-phi-node-expansion.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-detect-unprofitable \ +; RUN: -S < %s | FileCheck %s target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" %struct.wombat = type {[4 x i32]} Index: test/Isl/CodeGen/non-affine-subregion-dominance-reuse.ll =================================================================== --- test/Isl/CodeGen/non-affine-subregion-dominance-reuse.ll +++ test/Isl/CodeGen/non-affine-subregion-dominance-reuse.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -S -verify-dom-info < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -S -verify-dom-info \ +; RUN: -polly-detect-unprofitable < %s | FileCheck %s ; ; Check that we do not reuse the B[i-1] GEP created in block S again in ; block Q. Hence, we create two GEPs for B[i-1]: Index: test/Isl/CodeGen/non_affine_float_compare.ll =================================================================== --- test/Isl/CodeGen/non_affine_float_compare.ll +++ test/Isl/CodeGen/non_affine_float_compare.ll @@ -1,4 +1,6 @@ -; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit -polly-allow-nonaffine-branches -S -verify-dom-info < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -polly-no-early-exit \ +; RUN: -polly-allow-nonaffine-branches -S -verify-dom-info \ +; RUN: -polly-detect-unprofitable < %s | FileCheck %s ; ; void f(float *A) { ; for (int i = 0; i < 1024; i++) Index: test/Isl/CodeGen/read-only-scalars.ll =================================================================== --- test/Isl/CodeGen/read-only-scalars.ll +++ test/Isl/CodeGen/read-only-scalars.ll @@ -1,5 +1,9 @@ -; RUN: opt %loadPolly -polly-analyze-read-only-scalars=false -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s -; RUN: opt %loadPolly -polly-analyze-read-only-scalars=true -polly-codegen -polly-no-early-exit -S < %s | FileCheck %s -check-prefix=SCALAR +; RUN: opt %loadPolly -polly-analyze-read-only-scalars=false -polly-codegen \ +; RUN: -polly-no-early-exit -polly-detect-unprofitable \ +; RUN: -S < %s | FileCheck %s +; RUN: opt %loadPolly -polly-analyze-read-only-scalars=true -polly-codegen \ +; RUN: -polly-no-early-exit -polly-detect-unprofitable \ +; RUN: -S < %s | FileCheck %s -check-prefix=SCALAR ; CHECK-NOT: alloca Index: test/Isl/CodeGen/simple_non_single_entry.ll =================================================================== --- test/Isl/CodeGen/simple_non_single_entry.ll +++ test/Isl/CodeGen/simple_non_single_entry.ll @@ -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; Index: test/Isl/CodeGen/srem-in-other-bb.ll =================================================================== --- test/Isl/CodeGen/srem-in-other-bb.ll +++ test/Isl/CodeGen/srem-in-other-bb.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-codegen -S -polly-no-early-exit < %s | FileCheck %s +; RUN: opt %loadPolly -polly-codegen -S -polly-no-early-exit \ +; RUN: -polly-detect-unprofitable < %s | FileCheck %s ; ; void pos(float *A, long n) { ; for (long i = 0; i < 100; i++) Index: test/ScopDetect/non-affine-conditional.ll =================================================================== --- test/ScopDetect/non-affine-conditional.ll +++ test/ScopDetect/non-affine-conditional.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-allow-nonaffine-branches -polly-detect -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-allow-nonaffine-branches -polly-detect \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s ; ; void f(int *A) { ; for (int i = 0; i < 1024; i++) Index: test/ScopDetect/non-affine-float-compare.ll =================================================================== --- test/ScopDetect/non-affine-float-compare.ll +++ test/ScopDetect/non-affine-float-compare.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s ; ; void f(float *A) { ; for (int i = 0; i < 1024; i++) Index: test/ScopDetect/non-affine-loop-condition-dependent-access_2.ll =================================================================== --- test/ScopDetect/non-affine-loop-condition-dependent-access_2.ll +++ test/ScopDetect/non-affine-loop-condition-dependent-access_2.ll @@ -1,6 +1,13 @@ -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=false -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -polly-detect-unprofitable -polly-detect-unprofitable -analyze < %s \ +; RUN: | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES ; ; Here we have a non-affine loop (in the context of the loop nest) ; and also a non-affine access (A[k]). While we can always detect the Index: test/ScopDetect/non-affine-loop-condition-dependent-access_3.ll =================================================================== --- test/ScopDetect/non-affine-loop-condition-dependent-access_3.ll +++ test/ScopDetect/non-affine-loop-condition-dependent-access_3.ll @@ -1,6 +1,13 @@ -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS -; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=false -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS +; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s \ +; RUN: --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES ; ; Here we have a non-affine loop (in the context of the loop nest) ; and also a non-affine access (A[k]). While we can always detect the Index: test/ScopDetect/non-affine-loop.ll =================================================================== --- test/ScopDetect/non-affine-loop.ll +++ test/ScopDetect/non-affine-loop.ll @@ -1,7 +1,17 @@ -; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS -; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS -; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -polly-allow-nonaffine -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES -; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -polly-allow-nonaffine -polly-detect-scops-in-regions-without-loops -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSESANDNOLOOPS +; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=false -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS +; RUN: opt %loadPolly -polly-detect -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; 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: --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES +; 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: --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 Index: test/ScopDetect/parametric-multiply-in-scev.ll =================================================================== --- test/ScopDetect/parametric-multiply-in-scev.ll +++ test/ScopDetect/parametric-multiply-in-scev.ll @@ -1,6 +1,4 @@ -; 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-scops-in-functions-without-loops -polly-detect -analyze < %s | FileCheck %s ; foo(float *A, long n, long k) { ; if (true) Index: test/ScopDetect/simple_non_single_entry.ll =================================================================== --- test/ScopDetect/simple_non_single_entry.ll +++ test/ScopDetect/simple_non_single_entry.ll @@ -1,5 +1,4 @@ -; 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 -analyze < %s | FileCheck %s ; void f(long A[], long N) { ; long i; Index: test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll =================================================================== --- test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll +++ test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_2.ll @@ -1,6 +1,13 @@ -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALL +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=false -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s \ +; RUN: --check-prefix=ALL ; ; Here we have a non-affine loop (in the context of the loop nest) ; and also a non-affine access (A[k]). While we can always model the Index: test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll =================================================================== --- test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll +++ test/ScopInfo/NonAffine/non-affine-loop-condition-dependent-access_3.ll @@ -1,6 +1,12 @@ -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALL +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=false -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -basicaa -polly-scops -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=ALL ; ; Here we have a non-affine loop (in the context of the loop nest) ; and also a non-affine access (A[k]). While we can always model the Index: test/ScopInfo/NonAffine/non_affine_but_srem.ll =================================================================== --- test/ScopInfo/NonAffine/non_affine_but_srem.ll +++ test/ScopInfo/NonAffine/non_affine_but_srem.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s ; ; void pos(float *A, long n) { ; for (long i = 0; i < 100; i++) Index: test/ScopInfo/NonAffine/non_affine_conditional_nested.ll =================================================================== --- test/ScopInfo/NonAffine/non_affine_conditional_nested.ll +++ test/ScopInfo/NonAffine/non_affine_conditional_nested.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s ; ; void f(int *A) { ; for (int i = 0; i < 1024; i++) Index: test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll =================================================================== --- test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll +++ test/ScopInfo/NonAffine/non_affine_conditional_surrounding_affine_loop.ll @@ -1,5 +1,10 @@ -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALL +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s \ +; RUN: --check-prefix=ALL ; ; INNERMOST: Function: f ; INNERMOST: Region: %bb9---%bb17 Index: test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll =================================================================== --- test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll +++ test/ScopInfo/NonAffine/non_affine_conditional_surrounding_non_affine_loop.ll @@ -1,5 +1,9 @@ -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=INNERMOST -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALL +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-allow-nonaffine-loops=true -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=INNERMOST +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine \ +; RUN: -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true \ +; RUN: -analyze < %s | FileCheck %s --check-prefix=ALL ; ; INNERMOST: Function: f ; INNERMOST: Region: %bb9---%bb18 Index: test/ScopInfo/NonAffine/non_affine_float_compare.ll =================================================================== --- test/ScopInfo/NonAffine/non_affine_float_compare.ll +++ test/ScopInfo/NonAffine/non_affine_float_compare.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-scops -polly-allow-nonaffine-branches \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s ; ; void f(float *A) { ; for (int i = 0; i < 1024; i++) Index: test/ScopInfo/aliasing_many_arrays_to_compare.ll =================================================================== --- test/ScopInfo/aliasing_many_arrays_to_compare.ll +++ test/ScopInfo/aliasing_many_arrays_to_compare.ll @@ -1,5 +1,8 @@ -; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s --check-prefix=FOUND -; RUN: opt %loadPolly -polly-scops -analyze -polly-rtc-max-arrays-per-group=3 < %s | FileCheck %s --check-prefix=IGNORED +; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable -analyze \ +; RUN: < %s | FileCheck %s --check-prefix=FOUND +; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable -analyze \ +; RUN: -polly-rtc-max-arrays-per-group=3 < %s | FileCheck %s \ +; RUN: --check-prefix=IGNORED ; ; FOUND: Function: foo ; IGNORED-NOT: Function: foo Index: test/ScopInfo/invariant_load_ptr_ptr_noalias.ll =================================================================== --- test/ScopInfo/invariant_load_ptr_ptr_noalias.ll +++ test/ScopInfo/invariant_load_ptr_ptr_noalias.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -tbaa -polly-scops -polly-ignore-aliasing -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -tbaa -polly-scops -polly-ignore-aliasing \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s ; ; CHECK: Arrays { ; CHECK: i32** MemRef_A[*][8] Index: test/ScopInfo/no-scalar-deps-in-non-affine-subregion.ll =================================================================== --- test/ScopInfo/no-scalar-deps-in-non-affine-subregion.ll +++ test/ScopInfo/no-scalar-deps-in-non-affine-subregion.ll @@ -1,4 +1,5 @@ -; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-scops -polly-detect-unprofitable \ +; RUN: -analyze < %s | FileCheck %s ; ; Check that we do not generate any scalar dependences regarding x. It is ; defined and used on the non-affine subregion only, thus we do not need Index: test/ScopInfo/read-only-scalars.ll =================================================================== --- test/ScopInfo/read-only-scalars.ll +++ test/ScopInfo/read-only-scalars.ll @@ -1,5 +1,8 @@ -; RUN: opt %loadPolly -polly-analyze-read-only-scalars=false -polly-scops -analyze < %s | FileCheck %s -; RUN: opt %loadPolly -polly-analyze-read-only-scalars=true -polly-scops -analyze < %s | FileCheck %s -check-prefix=SCALARS +; RUN: opt %loadPolly -polly-analyze-read-only-scalars=false -polly-scops \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s +; RUN: opt %loadPolly -polly-analyze-read-only-scalars=true -polly-scops \ +; RUN: -polly-detect-unprofitable -analyze < %s | FileCheck %s \ +; RUN: -check-prefix=SCALARS ; CHECK-NOT: Memref_scalar