summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <tobias@grosser.es>2015-12-21 23:01:53 +0000
committerTobias Grosser <tobias@grosser.es>2015-12-21 23:01:53 +0000
commitc900633d604656556dbed4c3025f51fd841ef8d4 (patch)
tree5a39c7a72c89f17c6567b3cc35b4f9ceeb0555c8
parentcbf7ae8fef4d40248f9b0ff9f2b56546395eebb6 (diff)
downloadbcm5719-llvm-c900633d604656556dbed4c3025f51fd841ef8d4.tar.gz
bcm5719-llvm-c900633d604656556dbed4c3025f51fd841ef8d4.zip
ScopInfo: Small improvement to schedule construction [NFC]
We clarify that certain code is only executed if LSchedule is != nullptr. Previously some of these functions have been executed, but they only passed a nullptr through. This caused some confusion when reading the code. llvm-svn: 256209
-rw-r--r--polly/lib/Analysis/ScopInfo.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/polly/lib/Analysis/ScopInfo.cpp b/polly/lib/Analysis/ScopInfo.cpp
index 0714c3746f9..1e3208e9c35 100644
--- a/polly/lib/Analysis/ScopInfo.cpp
+++ b/polly/lib/Analysis/ScopInfo.cpp
@@ -3396,10 +3396,7 @@ static isl_stat mapToDimension_AddSet(__isl_take isl_set *Set, void *User) {
static __isl_give isl_multi_union_pw_aff *
mapToDimension(__isl_take isl_union_set *USet, int N) {
assert(N >= 0);
-
- if (!USet)
- return nullptr;
-
+ assert(USet);
assert(!isl_union_set_is_empty(USet));
struct MapToDimensionDataTy Data;
@@ -3477,10 +3474,6 @@ void Scop::buildSchedule(
isl_schedule *LSchedule = LSchedulePair.first;
unsigned NumVisited = LSchedulePair.second;
while (L && NumVisited == L->getNumBlocks()) {
- auto *LDomain = isl_schedule_get_domain(LSchedule);
- if (auto *MUPA = mapToDimension(LDomain, LD + 1))
- LSchedule = isl_schedule_insert_partial_schedule(LSchedule, MUPA);
-
auto *PL = L->getParentLoop();
// Either we have a proper loop and we also build a schedule for the
@@ -3493,7 +3486,14 @@ void Scop::buildSchedule(
break;
auto &PSchedulePair = LoopSchedules[PL];
- PSchedulePair.first = combineInSequence(PSchedulePair.first, LSchedule);
+
+ if (LSchedule) {
+ auto *LDomain = isl_schedule_get_domain(LSchedule);
+ auto *MUPA = mapToDimension(LDomain, LD + 1);
+ LSchedule = isl_schedule_insert_partial_schedule(LSchedule, MUPA);
+ PSchedulePair.first = combineInSequence(PSchedulePair.first, LSchedule);
+ }
+
PSchedulePair.second += NumVisited;
L = PL;
OpenPOWER on IntegriCloud