From f69a7c306bd81d189b0d9441af311dd52ea3dd36 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Wed, 10 May 2017 19:50:45 +0000 Subject: [PATCH] [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. llvm-svn: 302711 --- polly/lib/Transform/DeLICM.cpp | 2 +- polly/test/DeLICM/reduction_overapproximate.ll | 7 ++----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/polly/lib/Transform/DeLICM.cpp b/polly/lib/Transform/DeLICM.cpp index 0907ead7ce743..56e74f029708b 100644 --- a/polly/lib/Transform/DeLICM.cpp +++ b/polly/lib/Transform/DeLICM.cpp @@ -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. diff --git a/polly/test/DeLICM/reduction_overapproximate.ll b/polly/test/DeLICM/reduction_overapproximate.ll index 8fe13ba202bd7..3d817776902bd 100644 --- a/polly/test/DeLICM/reduction_overapproximate.ll +++ b/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 { @@ -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[] };