From 1b9d1bcc6d29399598d943b19e3adb7f98e1714d Mon Sep 17 00:00:00 2001 From: Tobias Grosser Date: Sun, 25 Jun 2017 06:32:00 +0000 Subject: [ScopInfo] Bound the number of array disjuncts in run-time bounds checks This reduces the compilation time of one reduced test case from Android from 16 seconds to 100 mseconds (we bail out), without negatively impacting any other test case we currently have. We still saw occasionally compilation timeouts on the AOSP buildbot. Hopefully, those will go away with this change. llvm-svn: 306235 --- polly/lib/Analysis/ScopInfo.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'polly/lib/Analysis') diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 8c2294b34d2..3f6f1d9caa4 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -114,6 +114,12 @@ static cl::opt DisableMultiplicativeReductions( cl::desc("Disable multiplicative reductions"), cl::Hidden, cl::ZeroOrMore, cl::init(false), cl::cat(PollyCategory)); +static cl::opt RunTimeChecksMaxAccessDisjuncts( + "polly-rtc-max-array-disjuncts", + cl::desc("The maximal number of disjunts allowed in memory accesses to " + "to build RTCs."), + cl::Hidden, cl::ZeroOrMore, cl::init(8), cl::cat(PollyCategory)); + static cl::opt RunTimeChecksMaxParameters( "polly-rtc-max-parameters", cl::desc("The maximal number of parameters allowed in RTCs."), cl::Hidden, @@ -2447,6 +2453,9 @@ buildMinMaxAccess(isl::set Set, Scop::MinMaxVectorTy &MinMaxAccesses, Scop &S) { return isl::stat::error; } + if (isl_set_n_basic_set(Set.get()) > RunTimeChecksMaxAccessDisjuncts) + return isl::stat::error; + MinPMA = Set.lexmin_pw_multi_aff(); MaxPMA = Set.lexmax_pw_multi_aff(); -- cgit v1.2.3