[polly] r302711 - [DeLICM] Always normalize domain. NFC.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed May 10 12:50:45 PDT 2017


Author: meinersbur
Date: Wed May 10 14:50:45 2017
New Revision: 302711

URL: http://llvm.org/viewvc/llvm-project?rev=302711&view=rev
Log:
[DeLICM] Always normalize domain. NFC.

Some isl functions can simplify their __isl_keep arguments. The
argument object after the call uses different contraints to represent
the same set. Different contraints can result in different outputs
when printed to a string.

In assert builds additional isl functions are called (in assert() or
mentioned, these can change the internal representation of its read-only
arguments such that printed strings are different in debug and non-debug
builds.

What happened here is that a call to isl_set_is_equal inside an assert
in getScatterFor normalizes one of its arguments such that one redundant
constraint is removed. The redundant constraint therefore does not appear
in the string representing the domain, which FileCheck notices as a
regression test failure compared to a build with assertions disabled.

This fix removes the redundant contraints the domain from the start such
that the redundant contraint is removed in assert and non-assert builds.
Isl adds a flag to such sets such that the removal of redundancies is
not done multiple times (here: by isl_set_is_equal).

Thanks to Tobias Grosser for reporting and hinting to the cause.

Modified:
    polly/trunk/lib/Transform/DeLICM.cpp
    polly/trunk/test/DeLICM/reduction_overapproximate.ll

Modified: polly/trunk/lib/Transform/DeLICM.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/DeLICM.cpp?rev=302711&r1=302710&r2=302711&view=diff
==============================================================================
--- polly/trunk/lib/Transform/DeLICM.cpp (original)
+++ polly/trunk/lib/Transform/DeLICM.cpp Wed May 10 14:50:45 2017
@@ -1108,7 +1108,7 @@ protected:
 
   /// Get the domain of @p Stmt.
   isl::set getDomainFor(ScopStmt *Stmt) const {
-    return give(Stmt->getDomain());
+    return give(isl_set_remove_redundancies(Stmt->getDomain()));
   }
 
   /// Get the domain @p MA's parent statement.

Modified: polly/trunk/test/DeLICM/reduction_overapproximate.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/DeLICM/reduction_overapproximate.ll?rev=302711&r1=302710&r2=302711&view=diff
==============================================================================
--- polly/trunk/test/DeLICM/reduction_overapproximate.ll (original)
+++ polly/trunk/test/DeLICM/reduction_overapproximate.ll Wed May 10 14:50:45 2017
@@ -1,7 +1,4 @@
-; FIXME: For some unknown reason the first test is behaving differently on
-;        differently systems. It is disabled for now to avoid buildbot noise.
-
-; DISABLED: opt %loadPolly -polly-flatten-schedule -polly-delicm-compute-known=true -polly-delicm-overapproximate-writes=true -polly-delicm -analyze < %s | FileCheck %s --check-prefix=APPROX
+; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-compute-known=true -polly-delicm-overapproximate-writes=true -polly-delicm -analyze < %s | FileCheck %s --check-prefix=APPROX
 ; RUN: opt %loadPolly -polly-flatten-schedule -polly-delicm-compute-known=true -polly-delicm-overapproximate-writes=false -polly-delicm -analyze < %s | FileCheck %s --check-prefix=EXACT
 ;
 ;    void func(double *A {
@@ -105,7 +102,7 @@ return:
 ; APPROX-NEXT:            new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[2] : i0 <= 3 and 0 <= i1 <= -2 + i0 };
 ; APPROX-NEXT:             MustWriteAccess :=  [Reduction Type: NONE] [Scalar: 1]
 ; APPROX-NEXT:                 { Stmt_reduction_inc[i0, i1] -> MemRef_val__phi[] };
-; APPROX-NEXT:            new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[-1 + i0] : 2 <= i0 <= 3 and 0 <= i1 <= -2 + i0 };
+; APPROX-NEXT:            new: { Stmt_reduction_inc[i0, i1] -> MemRef_A[-1 + i0] : i0 <= 3 and 0 <= i1 <= -2 + i0 };
 ; APPROX-NEXT:     Stmt_reduction_exit
 ; APPROX-NEXT:             ReadAccess :=       [Reduction Type: NONE] [Scalar: 1]
 ; APPROX-NEXT:                 { Stmt_reduction_exit[i0] -> MemRef_val__phi[] };




More information about the llvm-commits mailing list