diff options
author | Tobias Grosser <tobias@grosser.es> | 2018-06-29 13:06:44 +0000 |
---|---|---|
committer | Tobias Grosser <tobias@grosser.es> | 2018-06-29 13:06:44 +0000 |
commit | 4c4a5c2f09a4538398c92c568db174e0be386cec (patch) | |
tree | a5f00d41d9efdce5f90fe589d5acffa5b7524d71 /polly/lib | |
parent | 8bb15c0f86bec762a0741bc172141964aad5e6dc (diff) |
Use range for in normalizeValInst [NFCI]
Diffstat (limited to 'polly/lib')
-rw-r--r-- | polly/lib/Transform/ZoneAlgo.cpp | 52 |
1 files changed, 25 insertions, 27 deletions
diff --git a/polly/lib/Transform/ZoneAlgo.cpp b/polly/lib/Transform/ZoneAlgo.cpp index ce4d21753c0..0a0be108856 100644 --- a/polly/lib/Transform/ZoneAlgo.cpp +++ b/polly/lib/Transform/ZoneAlgo.cpp @@ -840,33 +840,31 @@ static isl::union_map normalizeValInst(isl::union_map Input, const DenseSet<PHINode *> &ComputedPHIs, isl::union_map NormalizeMap) { isl::union_map Result = isl::union_map::empty(Input.get_space()); - Input.foreach_map( - [&Result, &ComputedPHIs, &NormalizeMap](isl::map Map) -> isl::stat { - isl::space Space = Map.get_space(); - isl::space RangeSpace = Space.range(); - - // Instructions within the SCoP are always wrapped. Non-wrapped tuples - // are therefore invariant in the SCoP and don't need normalization. - if (!RangeSpace.is_wrapping()) { - Result = Result.add_map(Map); - return isl::stat::ok; - } - - auto *PHI = dyn_cast<PHINode>(static_cast<Value *>( - RangeSpace.unwrap().get_tuple_id(isl::dim::out).get_user())); - - // If no normalization is necessary, then the ValInst stands for itself. - if (!ComputedPHIs.count(PHI)) { - Result = Result.add_map(Map); - return isl::stat::ok; - } - - // Otherwise, apply the normalization. - isl::union_map Mapped = isl::union_map(Map).apply_range(NormalizeMap); - Result = Result.unite(Mapped); - NumPHINormialization++; - return isl::stat::ok; - }); + for (isl::map Map : Input.get_map_list()) { + isl::space Space = Map.get_space(); + isl::space RangeSpace = Space.range(); + + // Instructions within the SCoP are always wrapped. Non-wrapped tuples + // are therefore invariant in the SCoP and don't need normalization. + if (!RangeSpace.is_wrapping()) { + Result = Result.add_map(Map); + continue; + } + + auto *PHI = dyn_cast<PHINode>(static_cast<Value *>( + RangeSpace.unwrap().get_tuple_id(isl::dim::out).get_user())); + + // If no normalization is necessary, then the ValInst stands for itself. + if (!ComputedPHIs.count(PHI)) { + Result = Result.add_map(Map); + continue; + } + + // Otherwise, apply the normalization. + isl::union_map Mapped = isl::union_map(Map).apply_range(NormalizeMap); + Result = Result.unite(Mapped); + NumPHINormialization++; + } return Result; } |