[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
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 8c2294b..3f6f1d9 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -114,6 +114,12 @@
cl::desc("Disable multiplicative reductions"), cl::Hidden, cl::ZeroOrMore,
cl::init(false), cl::cat(PollyCategory));
+static cl::opt<int> 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<unsigned> RunTimeChecksMaxParameters(
"polly-rtc-max-parameters",
cl::desc("The maximal number of parameters allowed in RTCs."), cl::Hidden,
@@ -2447,6 +2453,9 @@
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();