[polly] r337239 - [FlattenAlgo] Replace more isl foreach calls with for loops

Tobias Grosser via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 16 23:16:58 PDT 2018


Author: grosser
Date: Mon Jul 16 23:16:58 2018
New Revision: 337239

URL: http://llvm.org/viewvc/llvm-project?rev=337239&view=rev
Log:
[FlattenAlgo] Replace more isl foreach calls with for loops

This time we replace for loops where the return isl::stat::error has
been used to carry status information.

There are still two uses of foreach remaining as we do not have a
corresponding for implementation for pw_aff functions.

Modified:
    polly/trunk/lib/Transform/FlattenAlgo.cpp

Modified: polly/trunk/lib/Transform/FlattenAlgo.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/FlattenAlgo.cpp?rev=337239&r1=337238&r2=337239&view=diff
==============================================================================
--- polly/trunk/lib/Transform/FlattenAlgo.cpp (original)
+++ polly/trunk/lib/Transform/FlattenAlgo.cpp Mon Jul 16 23:16:58 2018
@@ -54,20 +54,19 @@ bool isVariableDim(const isl::basic_map
 
 /// Whether Map's first out dimension is no constant nor piecewise constant.
 bool isVariableDim(const isl::map &Map) {
-  return Map.foreach_basic_map([](isl::basic_map BMap) -> isl::stat {
+  for (isl::basic_map BMap : Map.get_basic_map_list())
     if (isVariableDim(BMap))
-      return isl::stat::error;
-    return isl::stat::ok;
-  }) == isl::stat::ok;
+      return false;
+
+  return true;
 }
 
 /// Whether UMap's first out dimension is no (piecewise) constant.
 bool isVariableDim(const isl::union_map &UMap) {
-  return UMap.foreach_map([](isl::map Map) -> isl::stat {
+  for (isl::map Map : UMap.get_map_list())
     if (isVariableDim(Map))
-      return isl::stat::error;
-    return isl::stat::ok;
-  }) == isl::stat::ok;
+      return false;
+  return true;
 }
 
 /// Compute @p UPwAff - @p Val.




More information about the llvm-commits mailing list