[polly] r310461 - [ISLTools/ZoneAlgo] Make distributeDomain and filterKnownValInst isl_error_quota proof.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 9 04:21:40 PDT 2017


Author: meinersbur
Date: Wed Aug  9 04:21:40 2017
New Revision: 310461

URL: http://llvm.org/viewvc/llvm-project?rev=310461&view=rev
Log:
[ISLTools/ZoneAlgo] Make distributeDomain and filterKnownValInst isl_error_quota proof.

distributeDomain() and filterKnownValInst() are used in a scop
of ForwardOpTree that limits the number of isl operations.
Therefore some isl functions may return null after any operation.

Remove assertion that assume non-null results and handle
isl_*_foreach returning isl::stat::error.

I hope this fixes the crash of the asop buildbot at ihevc_recon.c.

Modified:
    polly/trunk/lib/Support/ISLTools.cpp
    polly/trunk/lib/Transform/ZoneAlgo.cpp

Modified: polly/trunk/lib/Support/ISLTools.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Support/ISLTools.cpp?rev=310461&r1=310460&r2=310461&view=diff
==============================================================================
--- polly/trunk/lib/Support/ISLTools.cpp (original)
+++ polly/trunk/lib/Support/ISLTools.cpp Wed Aug  9 04:21:40 2017
@@ -453,14 +453,11 @@ isl::map polly::distributeDomain(isl::ma
 
   auto Space = give(isl_map_get_space(Map.keep()));
   auto DomainSpace = give(isl_space_domain(Space.copy()));
-  assert(DomainSpace);
   auto DomainDims = isl_space_dim(DomainSpace.keep(), isl_dim_set);
   auto RangeSpace = give(isl_space_unwrap(isl_space_range(Space.copy())));
   auto Range1Space = give(isl_space_domain(RangeSpace.copy()));
-  assert(Range1Space);
   auto Range1Dims = isl_space_dim(Range1Space.keep(), isl_dim_set);
   auto Range2Space = give(isl_space_range(RangeSpace.copy()));
-  assert(Range2Space);
   auto Range2Dims = isl_space_dim(Range2Space.keep(), isl_dim_set);
 
   auto OutputSpace = give(isl_space_map_from_domain_and_range(
@@ -497,11 +494,13 @@ isl::map polly::distributeDomain(isl::ma
 
 isl::union_map polly::distributeDomain(isl::union_map UMap) {
   auto Result = give(isl_union_map_empty(isl_union_map_get_space(UMap.keep())));
-  UMap.foreach_map([=, &Result](isl::map Map) {
+  isl::stat Success = UMap.foreach_map([=, &Result](isl::map Map) {
     auto Distributed = distributeDomain(Map);
     Result = give(isl_union_map_add_map(Result.take(), Distributed.copy()));
     return isl::stat::ok;
   });
+  if (Success != isl::stat::ok)
+    return {};
   return Result;
 }
 

Modified: polly/trunk/lib/Transform/ZoneAlgo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ZoneAlgo.cpp?rev=310461&r1=310460&r2=310461&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ZoneAlgo.cpp (original)
+++ polly/trunk/lib/Transform/ZoneAlgo.cpp Wed Aug  9 04:21:40 2017
@@ -248,11 +248,13 @@ static bool isMapToUnknown(const isl::ma
 
 isl::union_map polly::filterKnownValInst(const isl::union_map &UMap) {
   isl::union_map Result = isl::union_map::empty(UMap.get_space());
-  UMap.foreach_map([=, &Result](isl::map Map) -> isl::stat {
+  isl::stat Success = UMap.foreach_map([=, &Result](isl::map Map) -> isl::stat {
     if (!isMapToUnknown(Map))
       Result = Result.add_map(Map);
     return isl::stat::ok;
   });
+  if (Success != isl::stat::ok)
+    return {};
   return Result;
 }
 




More information about the llvm-commits mailing list