summaryrefslogtreecommitdiff
path: root/polly
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2018-07-17 06:11:53 +0000
committerTobias Grosser <tobias@grosser.es>2018-07-17 06:11:53 +0000
commitda4c3b09c2362626be29c5df3a2faeca50a2cd42 (patch)
tree0433c87260f3d24d05bf1aeee60740277b0d6406 /polly
parente49c57a4f990d30477825327ceef68321892bfb0 (diff)
[FlattenAlgo] Replace some isl foreach calls with for loops
Replace foreach calls which only return 'ok' with for loops.
Diffstat (limited to 'polly')
-rw-r--r--polly/lib/Transform/FlattenAlgo.cpp18
1 files changed, 7 insertions, 11 deletions
diff --git a/polly/lib/Transform/FlattenAlgo.cpp b/polly/lib/Transform/FlattenAlgo.cpp
index fc88158bdeb..82cce44c7a9 100644
--- a/polly/lib/Transform/FlattenAlgo.cpp
+++ b/polly/lib/Transform/FlattenAlgo.cpp
@@ -113,11 +113,10 @@ isl::union_map scheduleProjectOut(const isl::union_map &UMap, unsigned first,
have no effect on schedule ranges */
auto Result = isl::union_map::empty(UMap.get_space());
- UMap.foreach_map([=, &Result](isl::map Map) -> isl::stat {
+ for (isl::map Map : UMap.get_map_list()) {
auto Outprojected = Map.project_out(isl::dim::out, first, n);
Result = Result.add_map(Outprojected);
- return isl::stat::ok;
- });
+ }
return Result;
}
@@ -128,23 +127,20 @@ isl::union_map scheduleProjectOut(const isl::union_map &UMap, unsigned first,
/// number of dimensions is not supported by the other code in this file.
size_t scheduleScatterDims(const isl::union_map &Schedule) {
unsigned Dims = 0;
- Schedule.foreach_map([&Dims](isl::map Map) -> isl::stat {
+ for (isl::map Map : Schedule.get_map_list())
Dims = std::max(Dims, Map.dim(isl::dim::out));
- return isl::stat::ok;
- });
return Dims;
}
/// Return the @p pos' range dimension, converted to an isl_union_pw_aff.
isl::union_pw_aff scheduleExtractDimAff(isl::union_map UMap, unsigned pos) {
auto SingleUMap = isl::union_map::empty(UMap.get_space());
- UMap.foreach_map([=, &SingleUMap](isl::map Map) -> isl::stat {
- auto MapDims = Map.dim(isl::dim::out);
- auto SingleMap = Map.project_out(isl::dim::out, 0, pos);
+ for (isl::map Map : UMap.get_map_list()) {
+ unsigned MapDims = Map.dim(isl::dim::out);
+ isl::map SingleMap = Map.project_out(isl::dim::out, 0, pos);
SingleMap = SingleMap.project_out(isl::dim::out, 1, MapDims - pos - 1);
SingleUMap = SingleUMap.add_map(SingleMap);
- return isl::stat::ok;
- });
+ };
auto UAff = isl::union_pw_multi_aff(SingleUMap);
auto FirstMAff = isl::multi_union_pw_aff(UAff);