From 842bdd0071df8bd810fc963e8a1924af7fe14f55 Mon Sep 17 00:00:00 2001 From: Michael Kruse Date: Wed, 1 Aug 2018 22:28:32 +0000 Subject: [ScopBuilder] Set domain to empty instead of NULL. The domain generation used nullptr to mark the domain of an error block as never-executed. Later, nullptr domains are recreated with a zero-tuple domain that then mismatches with the expected domain the error block within the loop. Instead of using nullptr, assign an empty domain which preserves the expected space. Remove empty domains during SCoP simplification. Fixes llvm.org/PR38218. llvm-svn: 338646 --- polly/lib/Analysis/ScopInfo.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'polly/lib/Analysis/ScopInfo.cpp') diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp index 489a60b6754..9e8ee9116a9 100644 --- a/polly/lib/Analysis/ScopInfo.cpp +++ b/polly/lib/Analysis/ScopInfo.cpp @@ -2615,7 +2615,7 @@ bool Scop::propagateInvalidStmtDomains( isl::set DomPar = Domain.params(); recordAssumption(ERRORBLOCK, DomPar, BB->getTerminator()->getDebugLoc(), AS_RESTRICTION); - Domain = nullptr; + Domain = isl::set::empty(Domain.get_space()); } if (InvalidDomain.is_empty()) { @@ -3523,7 +3523,10 @@ void Scop::removeStmts(std::function ShouldDelete, void Scop::removeStmtNotInDomainMap() { auto ShouldDelete = [this](ScopStmt &Stmt) -> bool { - return !this->DomainMap.lookup(Stmt.getEntryBlock()); + isl::set Domain = DomainMap.lookup(Stmt.getEntryBlock()); + if (!Domain) + return true; + return Domain.is_empty(); }; removeStmts(ShouldDelete, false); } -- cgit v1.2.3