diff options
| author | Tobias Grosser <tobias@grosser.es> | 2017-07-17 20:58:13 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2017-07-17 20:58:13 +0000 |
| commit | 66e38a84be64444dc3fe75c4b3565d390ebca791 (patch) | |
| tree | 2b1af376eccab1187f86ecfd8180928046f1564a /polly/lib/Analysis | |
| parent | 20d28a168ec187e52f735061094b4000d6de7ea0 (diff) | |
| download | bcm5719-llvm-66e38a84be64444dc3fe75c4b3565d390ebca791.tar.gz bcm5719-llvm-66e38a84be64444dc3fe75c4b3565d390ebca791.zip | |
[Polly] Avoid use of `getStmtFor(BB)` in PolyhedralInfo. NFC
Summary: Since there will be no more a 1-1 correspondence between statements and basic block, we would like to get rid of the method `getStmtFor(BB)` and its uses. Here we remove one of its uses in PolyhedralInfo, as suggested by Michael Sir.
Reviewers: grosser, Meinersbur, bollu
Reviewed By: grosser
Subscribers: pollydev
Tags: #polly
Differential Revision: https://reviews.llvm.org/D35300
llvm-svn: 308220
Diffstat (limited to 'polly/lib/Analysis')
| -rw-r--r-- | polly/lib/Analysis/PolyhedralInfo.cpp | 35 |
1 files changed, 17 insertions, 18 deletions
diff --git a/polly/lib/Analysis/PolyhedralInfo.cpp b/polly/lib/Analysis/PolyhedralInfo.cpp index 96f03a79479..19ee3def7da 100644 --- a/polly/lib/Analysis/PolyhedralInfo.cpp +++ b/polly/lib/Analysis/PolyhedralInfo.cpp @@ -126,25 +126,24 @@ __isl_give isl_union_map *PolyhedralInfo::getScheduleForLoop(const Scop *S, DEBUG(dbgs() << "Relative loop depth:\t" << CurrDim << "\n"); assert(CurrDim >= 0 && "Loop in region should have at least depth one"); - for (auto *BB : L->blocks()) { - auto *SS = S->getStmtFor(BB); - if (!SS) - continue; - - unsigned int MaxDim = SS->getNumIterators(); - DEBUG(dbgs() << "Maximum depth of Stmt:\t" << MaxDim << "\n"); - auto *ScheduleMap = SS->getSchedule(); - assert(ScheduleMap && - "Schedules that contain extension nodes require special handling."); - - ScheduleMap = isl_map_project_out(ScheduleMap, isl_dim_out, CurrDim + 1, - MaxDim - CurrDim - 1); - ScheduleMap = - isl_map_set_tuple_id(ScheduleMap, isl_dim_in, SS->getDomainId()); - Schedule = - isl_union_map_union(Schedule, isl_union_map_from_map(ScheduleMap)); + for (auto &SS : *S) { + if (L->contains(SS.getSurroundingLoop())) { + + unsigned int MaxDim = SS.getNumIterators(); + DEBUG(dbgs() << "Maximum depth of Stmt:\t" << MaxDim << "\n"); + auto *ScheduleMap = SS.getSchedule(); + assert( + ScheduleMap && + "Schedules that contain extension nodes require special handling."); + + ScheduleMap = isl_map_project_out(ScheduleMap, isl_dim_out, CurrDim + 1, + MaxDim - CurrDim - 1); + ScheduleMap = + isl_map_set_tuple_id(ScheduleMap, isl_dim_in, SS.getDomainId()); + Schedule = + isl_union_map_union(Schedule, isl_union_map_from_map(ScheduleMap)); + } } - Schedule = isl_union_map_coalesce(Schedule); return Schedule; } |

