Skip to content

Commit

Permalink
[DeLICM] Always normalize domain. NFC.
Browse files Browse the repository at this point in the history
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.

llvm-svn: 302711
  • Loading branch information
Meinersbur committed May 10, 2017
1 parent 6957d35 commit f69a7c3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion polly/lib/Transform/DeLICM.cpp
Expand Up @@ -1108,7 +1108,7 @@ class ZoneAlgorithm {

/// 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.
Expand Down
7 changes: 2 additions & 5 deletions polly/test/DeLICM/reduction_overapproximate.ll
@@ -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 {
Expand Down Expand Up @@ -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[] };
Expand Down

0 comments on commit f69a7c3

Please sign in to comment.