[polly] r321329 - Fix isl out-of-quota errors affecting later quota guards.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 21 17:10:31 PST 2017


Author: meinersbur
Date: Thu Dec 21 17:10:31 2017
New Revision: 321329

URL: http://llvm.org/viewvc/llvm-project?rev=321329&view=rev
Log:
Fix isl out-of-quota errors affecting later quota guards.

If an out-of-quota error occurred, the last error would be
isl_error_quota unless a different error occured. We typically check
whether the max-operations occured by comparing to that error value
after leaving the quota guard. This would check whether there ever
was a quota-error, not just in the last quota guards.

The observable bug occurred if the max-operations limit was reached in
DeLICM, and if -polly-dependences-computout=0, DependenceInfo would
think that the quota for computing dependencies was the reason,
i.e., fail the operation even if the calculation itself was successful.

Fix by reseting the last error to isl_error_none when entering a
quota guard, signaling that no quota error occured unless in the
guard's scope.

Modified:
    polly/trunk/include/polly/Support/GICHelper.h
    polly/trunk/test/DeLICM/reject_outofquota.ll

Modified: polly/trunk/include/polly/Support/GICHelper.h
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/include/polly/Support/GICHelper.h?rev=321329&r1=321328&r2=321329&view=diff
==============================================================================
--- polly/trunk/include/polly/Support/GICHelper.h (original)
+++ polly/trunk/include/polly/Support/GICHelper.h Thu Dec 21 17:10:31 2017
@@ -396,6 +396,12 @@ public:
     assert(isl_ctx_get_max_operations(IslCtx) == 0 &&
            "Nested max operations not supported");
 
+    // Users of this guard may check whether the last error was isl_error_quota.
+    // Reset the last error such that a previous out-of-quota error is not
+    // mistaken to have occurred in the in this quota, even if the max number of
+    // operations is set to infinite (LocalMaxOps == 0).
+    isl_ctx_reset_error(IslCtx);
+
     if (LocalMaxOps == 0) {
       // No limit on operations; also disable restoring on_error/max_operations.
       this->IslCtx = nullptr;

Modified: polly/trunk/test/DeLICM/reject_outofquota.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/DeLICM/reject_outofquota.ll?rev=321329&r1=321328&r2=321329&view=diff
==============================================================================
--- polly/trunk/test/DeLICM/reject_outofquota.ll (original)
+++ polly/trunk/test/DeLICM/reject_outofquota.ll Thu Dec 21 17:10:31 2017
@@ -1,4 +1,5 @@
 ; RUN: opt %loadPolly -polly-delicm -analyze -pass-remarks-analysis=polly-delicm -polly-delicm-max-ops=1 < %s 2>&1 | FileCheck %s
+; RUN: opt %loadPolly -polly-delicm -polly-dependences -analyze -polly-delicm-max-ops=1 -polly-dependences-computeout=0 < %s | FileCheck %s -check-prefix=DEP
 ;
 ;    void func(double *A) {
 ;      for (int j = 0; j < 2; j += 1) { /* outer */
@@ -63,3 +64,16 @@ return:
 
 
 ; CHECK: maximal number of operations exceeded during zone analysis
+
+; Check that even if the quota was exceeded in DeLICM, DependenceInfo is still
+; successfull since it uses a different operations counter.
+;
+; DEP:     RAW dependences:
+; DEP-NOT:        n/a
+; DEP:     WAR dependences:
+; DEP-NOT:        n/a
+; DEP:     WAW dependences:
+; DEP-NOT:        n/a
+; DEP:     Reduction dependences:
+; DEP-NOT:        n/a
+; DEP:     Transitive closure of reduction dependences:




More information about the llvm-commits mailing list